From d1b08ad57649e3faf848ab592b39a1a31f681208 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 18 Nov 2024 10:46:42 +0100 Subject: [PATCH] core: simplify layered-state logic --- core/state_processor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/state_processor.go b/core/state_processor.go index 924e0ff4a5..74985b69a1 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -135,9 +135,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg // and uses the input parameters for its environment similar to ApplyTransaction. However, // this method takes an already created EVM instance as input. func ApplyTransactionWithEVM(msg *Message, config *params.ChainConfig, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (receipt *types.Receipt, err error) { - var tracingStateDB = vm.StateDB(statedb) if hooks := evm.Config.Tracer; hooks != nil { - tracingStateDB = state.NewHookedState(statedb, hooks) if hooks.OnTxStart != nil { hooks.OnTxStart(evm.GetVMContext(), tx, msg.From) } @@ -159,7 +157,7 @@ func ApplyTransactionWithEVM(msg *Message, config *params.ChainConfig, gp *GasPo // Update the state with pending changes. var root []byte if config.IsByzantium(blockNumber) { - tracingStateDB.Finalise(true) + evm.StateDB.Finalise(true) } else { root = statedb.IntermediateRoot(config.IsEIP158(blockNumber)).Bytes() }