diff --git a/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs b/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs index 8a2d3cd2652..1aa4e408dd3 100644 --- a/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs +++ b/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs @@ -551,6 +551,16 @@ protected virtual TransactionResult BuyGas(Transaction tx, IReleaseSpec spec, IT TraceLogInvalidTx(tx, $"INSUFFICIENT_MAX_FEE_PER_BLOB_GAS_FOR_SENDER_BALANCE: ({tx.SenderAddress})_BALANCE = {senderBalance}"); return TransactionResult.InsufficientSenderBalance; } + + // Check that tx.MaxFeePerBlobGas >= feePerBlobGas (the current blob gas price) + if (validate && BlobGasCalculator.TryCalculateFeePerBlobGas(header, spec.BlobBaseFeeUpdateFraction, out UInt256 feePerBlobGas)) + { + if ((UInt256)tx.MaxFeePerBlobGas! < feePerBlobGas) + { + TraceLogInvalidTx(tx, $"INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: tx.MaxFeePerBlobGas ({tx.MaxFeePerBlobGas}) < feePerBlobGas ({feePerBlobGas})"); + return TransactionResult.InsufficientMaxFeePerBlobGas; + } + } } } @@ -984,6 +994,7 @@ private TransactionResult(ErrorType error = ErrorType.None, EvmExceptionType evm ErrorType.GasLimitBelowIntrinsicGas => "gas limit below intrinsic gas", ErrorType.InsufficientMaxFeePerGasForSenderBalance => "insufficient MaxFeePerGas for sender balance", ErrorType.InsufficientSenderBalance => "insufficient sender balance", + ErrorType.InsufficientMaxFeePerBlobGas => "max fee per blob gas less than block blob gas fee", ErrorType.MalformedTransaction => "malformed", ErrorType.MinerPremiumNegative => "miner premium is negative", ErrorType.NonceOverflow => "nonce overflow", @@ -1015,6 +1026,7 @@ public static TransactionResult EvmException(EvmExceptionType evmExceptionType, public static readonly TransactionResult GasLimitBelowIntrinsicGas = ErrorType.GasLimitBelowIntrinsicGas; public static readonly TransactionResult InsufficientMaxFeePerGasForSenderBalance = ErrorType.InsufficientMaxFeePerGasForSenderBalance; public static readonly TransactionResult InsufficientSenderBalance = ErrorType.InsufficientSenderBalance; + public static readonly TransactionResult InsufficientMaxFeePerBlobGas = ErrorType.InsufficientMaxFeePerBlobGas; public static readonly TransactionResult MalformedTransaction = ErrorType.MalformedTransaction; public static readonly TransactionResult MinerPremiumNegative = ErrorType.MinerPremiumNegative; public static readonly TransactionResult NonceOverflow = ErrorType.NonceOverflow; @@ -1031,6 +1043,7 @@ public enum ErrorType GasLimitBelowIntrinsicGas, InsufficientMaxFeePerGasForSenderBalance, InsufficientSenderBalance, + InsufficientMaxFeePerBlobGas, MalformedTransaction, MinerPremiumNegative, NonceOverflow,