diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index fcba46a32e..6f5d08660a 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -205,7 +205,14 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig, continue } if tx.Type() == types.BlobTxType { - blobGasUsed += uint64(params.BlobTxBlobGasPerBlob * len(tx.BlobHashes())) + txBlobGas := uint64(params.BlobTxBlobGasPerBlob * len(tx.BlobHashes())) + if blobGasUsed+txBlobGas > params.BlobTxBlobGasPerBlob { + err := fmt.Errorf("blob gas (%d) would exceed maximum allowance %d", blobGasUsed+txBlobGas, params.MaxBlobGasPerBlock) + log.Warn("rejected tx", "index", i, "err", err) + rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()}) + continue + } + blobGasUsed += txBlobGas } msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee) if err != nil {