mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
core: initialize tracer before DAO fork logic (#33214)
`StateDB` lacks recording functionality, so it has been replaced with `tractStateDB` and advanced
This commit is contained in:
parent
e0d81d1e99
commit
f4817b7a53
1 changed files with 6 additions and 5 deletions
|
|
@ -69,9 +69,14 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||
gp = new(GasPool).AddGas(block.GasLimit())
|
||||
)
|
||||
|
||||
var tracingStateDB = vm.StateDB(statedb)
|
||||
if hooks := cfg.Tracer; hooks != nil {
|
||||
tracingStateDB = state.NewHookedState(statedb, hooks)
|
||||
}
|
||||
|
||||
// Mutate the block and state according to any hard-fork specs
|
||||
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(block.Number()) == 0 {
|
||||
misc.ApplyDAOHardFork(statedb)
|
||||
misc.ApplyDAOHardFork(tracingStateDB)
|
||||
}
|
||||
var (
|
||||
context vm.BlockContext
|
||||
|
|
@ -79,10 +84,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||
)
|
||||
|
||||
// Apply pre-execution system calls.
|
||||
var tracingStateDB = vm.StateDB(statedb)
|
||||
if hooks := cfg.Tracer; hooks != nil {
|
||||
tracingStateDB = state.NewHookedState(statedb, hooks)
|
||||
}
|
||||
context = NewEVMBlockContext(header, p.chain, nil)
|
||||
evm := vm.NewEVM(context, tracingStateDB, config, cfg)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue