diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 632a37479f3..6d08911110e 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -683,7 +683,7 @@ func (b *SimulatedBackend) callContract(_ context.Context, call ethereum.CallMsg txContext := core.NewEVMTxContext(msg) header := block.Header() - evmContext := core.NewEVMBlockContext(header, core.GetHashFn(header, b.getHeader), b.m.Engine, nil) + evmContext := core.NewEVMBlockContext(header, core.GetHashFn(header, b.getHeader), b.m.Engine, nil, nil /*excessDataGas*/) // Create a new environment which holds all relevant information // about the transaction and calling mechanisms. vmEnv := vm.NewEVM(evmContext, txContext, statedb, b.m.ChainConfig, vm.Config{}) diff --git a/cmd/rpcdaemon/commands/otterscan_generic_tracer.go b/cmd/rpcdaemon/commands/otterscan_generic_tracer.go index 8b46f309fa5..72ae92f241e 100644 --- a/cmd/rpcdaemon/commands/otterscan_generic_tracer.go +++ b/cmd/rpcdaemon/commands/otterscan_generic_tracer.go @@ -88,7 +88,7 @@ func (api *OtterscanAPIImpl) genericTracer(dbtx kv.Tx, ctx context.Context, bloc msg, _ := tx.AsMessage(*signer, header.BaseFee, rules) - BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil) + BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil, nil /*excessDataGas*/) TxContext := core.NewEVMTxContext(msg) vmenv := vm.NewEVM(BlockContext, TxContext, ibs, chainConfig, vm.Config{Debug: true, Tracer: tracer}) diff --git a/cmd/rpcdaemon/commands/otterscan_search_trace.go b/cmd/rpcdaemon/commands/otterscan_search_trace.go index 47924536d66..86cb6aa623e 100644 --- a/cmd/rpcdaemon/commands/otterscan_search_trace.go +++ b/cmd/rpcdaemon/commands/otterscan_search_trace.go @@ -85,7 +85,7 @@ func (api *OtterscanAPIImpl) traceBlock(dbtx kv.Tx, ctx context.Context, blockNu msg, _ := tx.AsMessage(*signer, header.BaseFee, rules) tracer := NewTouchTracer(searchAddr) - BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil) + BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil, nil /*excessDataGas*/) TxContext := core.NewEVMTxContext(msg) vmenv := vm.NewEVM(BlockContext, TxContext, ibs, chainConfig, vm.Config{Debug: true, Tracer: tracer}) diff --git a/cmd/state/exec3/state.go b/cmd/state/exec3/state.go index e7783145ca8..e9845fcc196 100644 --- a/cmd/state/exec3/state.go +++ b/cmd/state/exec3/state.go @@ -207,7 +207,7 @@ func (rw *Worker) RunTxTaskNoLock(txTask *exec22.TxTask) { blockContext := txTask.EvmBlockContext if !rw.background { getHashFn := core.GetHashFn(header, rw.getHeader) - blockContext = core.NewEVMBlockContext(header, getHashFn, rw.engine, nil /* author */) + blockContext = core.NewEVMBlockContext(header, getHashFn, rw.engine, nil /* author */, nil /*excessDataGas*/) } rw.evm.ResetBetweenBlocks(blockContext, core.NewEVMTxContext(msg), ibs, vmConfig, rules) vmenv := rw.evm diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index ead553e051d..07af91c1b15 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1262,7 +1262,7 @@ func (p *Parlia) systemCall(from, contract libcommon.Address, data []byte, ibs * ) vmConfig := vm.Config{NoReceipts: true} // Create a new context to be used in the EVM environment - blockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, nil), p, &from) + blockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, nil), p, &from, nil /*excessDataGas*/) evm := vm.NewEVM(blockContext, core.NewEVMTxContext(msg), ibs, chainConfig, vmConfig) ret, leftOverGas, err := evm.Call( vm.AccountRef(msg.From()), diff --git a/core/blockchain.go b/core/blockchain.go index 694cd3d42c6..9addcc92d15 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -493,7 +493,7 @@ func SysCallContract(contract libcommon.Address, data []byte, chainConfig chain. author = &state.SystemAddress txContext = NewEVMTxContext(msg) } - blockContext := NewEVMBlockContext(header, GetHashFn(header, nil), engine, author) + blockContext := NewEVMBlockContext(header, GetHashFn(header, nil), engine, author, nil /*excessDataGas*/) evm := vm.NewEVM(blockContext, txContext, ibs, &chainConfig, vmConfig) ret, _, err := evm.Call( @@ -529,7 +529,7 @@ func SysCreate(contract libcommon.Address, data []byte, chainConfig chain.Config // Create a new context to be used in the EVM environment author := &contract txContext := NewEVMTxContext(msg) - blockContext := NewEVMBlockContext(header, GetHashFn(header, nil), nil, author) + blockContext := NewEVMBlockContext(header, GetHashFn(header, nil), nil, author, nil /*excessDataGas*/) evm := vm.NewEVM(blockContext, txContext, ibs, &chainConfig, vmConfig) ret, _, err := evm.SysCreate( diff --git a/core/evm.go b/core/evm.go index 7c03d5c43f5..99eac863ee7 100644 --- a/core/evm.go +++ b/core/evm.go @@ -31,7 +31,7 @@ import ( ) // NewEVMBlockContext creates a new context for use in the EVM. -func NewEVMBlockContext(header *types.Header, blockHashFunc func(n uint64) libcommon.Hash, engine consensus.EngineReader, author *libcommon.Address) evmtypes.BlockContext { +func NewEVMBlockContext(header *types.Header, blockHashFunc func(n uint64) libcommon.Hash, engine consensus.EngineReader, author *libcommon.Address, excessDataGas *big.Int) evmtypes.BlockContext { // If we don't have an explicit author (i.e. not mining), extract from the header var beneficiary libcommon.Address if author == nil { diff --git a/core/state_processor.go b/core/state_processor.go index 37497315eeb..db058ac664e 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -104,7 +104,7 @@ func ApplyTransaction(config *chain.Config, blockHashFunc func(n uint64) libcomm // about the transaction and calling mechanisms. cfg.SkipAnalysis = SkipAnalysis(config, header.Number.Uint64()) - blockContext := NewEVMBlockContext(header, blockHashFunc, engine, author) + blockContext := NewEVMBlockContext(header, blockHashFunc, engine, author, nil /*excessDataGas*/) vmenv := vm.NewEVM(blockContext, evmtypes.TxContext{}, ibs, config, cfg) return applyTransaction(config, engine, gp, ibs, stateWriter, header, tx, usedGas, vmenv, cfg) diff --git a/eth/stagedsync/exec3.go b/eth/stagedsync/exec3.go index 20efbf545c4..f438b567818 100644 --- a/eth/stagedsync/exec3.go +++ b/eth/stagedsync/exec3.go @@ -545,7 +545,7 @@ Loop: defer getHashFnMute.Unlock() return f(n) } - blockContext := core.NewEVMBlockContext(header, getHashFn, engine, nil /* author */) + blockContext := core.NewEVMBlockContext(header, getHashFn, engine, nil /* author */, nil /*excessDataGas*/) if parallel { select { @@ -1057,7 +1057,7 @@ func reconstituteStep(last bool, defer getHashFnMute.Unlock() return f(n) } - blockContext := core.NewEVMBlockContext(header, getHashFn, engine, nil /* author */) + blockContext := core.NewEVMBlockContext(header, getHashFn, engine, nil /* author */, nil /*excessDataGas*/) rules := chainConfig.Rules(bn, b.Time()) for txIndex := -1; txIndex <= len(txs); txIndex++ { diff --git a/tests/state_test_util.go b/tests/state_test_util.go index a681098dfb1..7a9ed03040e 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -221,7 +221,7 @@ func (t *StateTest) RunNoVerify(tx kv.RwTx, subtest StateSubtest, vmconfig vm.Co // Prepare the EVM. txContext := core.NewEVMTxContext(msg) header := block.Header() - context := core.NewEVMBlockContext(header, core.GetHashFn(header, nil), nil, &t.json.Env.Coinbase) + context := core.NewEVMBlockContext(header, core.GetHashFn(header, nil), nil, &t.json.Env.Coinbase, nil /*excessDataGas*/) context.GetHash = vmTestBlockHash if baseFee != nil { context.BaseFee = new(uint256.Int) diff --git a/turbo/transactions/call.go b/turbo/transactions/call.go index d1ceaeadcad..aeb0cf0c58b 100644 --- a/turbo/transactions/call.go +++ b/turbo/transactions/call.go @@ -107,7 +107,7 @@ func DoCall( } func NewEVMBlockContext(engine consensus.EngineReader, header *types.Header, requireCanonical bool, tx kv.Tx, headerReader services.HeaderReader) evmtypes.BlockContext { - return core.NewEVMBlockContext(header, MakeHeaderGetter(requireCanonical, tx, headerReader), engine, nil /* author */) + return core.NewEVMBlockContext(header, MakeHeaderGetter(requireCanonical, tx, headerReader), engine, nil /* author */, nil /*excessDataGas*/) } func MakeHeaderGetter(requireCanonical bool, tx kv.Tx, headerReader services.HeaderReader) func(uint64) libcommon.Hash { diff --git a/turbo/transactions/tracing.go b/turbo/transactions/tracing.go index 9ec1844a18f..3f4d11b7126 100644 --- a/turbo/transactions/tracing.go +++ b/turbo/transactions/tracing.go @@ -53,7 +53,7 @@ func ComputeTxEnv(ctx context.Context, engine consensus.EngineReader, block *typ return h } header := block.HeaderNoCopy() - BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil) + BlockContext := core.NewEVMBlockContext(header, core.GetHashFn(header, getHeader), engine, nil, nil /*excessDataGas*/) // Recompute transactions up to the target index. signer := types.MakeSigner(cfg, block.NumberU64())