fix pre-post block process fns
This commit is contained in:
parent
ea92ef4d16
commit
fbd1d19cdb
|
@ -77,11 +77,15 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
||||||
context = NewEVMBlockContext(header, p.chain, nil)
|
context = NewEVMBlockContext(header, p.chain, nil)
|
||||||
|
|
||||||
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, p.config, cfg)
|
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, p.config, cfg)
|
||||||
|
var tracingStateDB = vm.StateDB(statedb)
|
||||||
|
if hooks := cfg.Tracer; hooks != nil {
|
||||||
|
tracingStateDB = state.NewHookedState(statedb, hooks)
|
||||||
|
}
|
||||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||||
ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
ProcessBeaconBlockRoot(*beaconRoot, vmenv, tracingStateDB)
|
||||||
}
|
}
|
||||||
if p.config.IsPrague(block.Number(), block.Time()) {
|
if p.config.IsPrague(block.Number(), block.Time()) {
|
||||||
ProcessParentBlockHash(block.ParentHash(), vmenv, statedb)
|
ProcessParentBlockHash(block.ParentHash(), vmenv, tracingStateDB)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over and process the individual transactions
|
// Iterate over and process the individual transactions
|
||||||
|
@ -99,10 +103,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
||||||
receipts = append(receipts, receipt)
|
receipts = append(receipts, receipt)
|
||||||
allLogs = append(allLogs, receipt.Logs...)
|
allLogs = append(allLogs, receipt.Logs...)
|
||||||
}
|
}
|
||||||
var tracingStateDB = vm.StateDB(statedb)
|
|
||||||
if hooks := cfg.Tracer; hooks != nil {
|
|
||||||
tracingStateDB = state.NewHookedState(statedb, hooks)
|
|
||||||
}
|
|
||||||
// Read requests if Prague is enabled.
|
// Read requests if Prague is enabled.
|
||||||
var requests [][]byte
|
var requests [][]byte
|
||||||
if p.config.IsPrague(block.Number(), block.Time()) {
|
if p.config.IsPrague(block.Number(), block.Time()) {
|
||||||
|
@ -292,14 +292,15 @@ func ProcessConsolidationQueue(vmenv *vm.EVM, statedb vm.StateDB) []byte {
|
||||||
|
|
||||||
func processRequestsSystemCall(vmenv *vm.EVM, statedb vm.StateDB, requestType byte, addr common.Address) []byte {
|
func processRequestsSystemCall(vmenv *vm.EVM, statedb vm.StateDB, requestType byte, addr common.Address) []byte {
|
||||||
if tracer := vmenv.Config.Tracer; tracer != nil {
|
if tracer := vmenv.Config.Tracer; tracer != nil {
|
||||||
if tracer.OnSystemCallStart != nil {
|
if tracer.OnSystemCallStartV2 != nil {
|
||||||
|
tracer.OnSystemCallStartV2(vmenv.GetVMContext())
|
||||||
|
} else if tracer.OnSystemCallStart != nil {
|
||||||
tracer.OnSystemCallStart()
|
tracer.OnSystemCallStart()
|
||||||
}
|
}
|
||||||
if tracer.OnSystemCallEnd != nil {
|
if tracer.OnSystemCallEnd != nil {
|
||||||
defer tracer.OnSystemCallEnd()
|
defer tracer.OnSystemCallEnd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := &Message{
|
msg := &Message{
|
||||||
From: params.SystemAddress,
|
From: params.SystemAddress,
|
||||||
GasLimit: 30_000_000,
|
GasLimit: 30_000_000,
|
||||||
|
|
Loading…
Reference in New Issue