@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
@ -212,9 +213,7 @@ func ApplyTransaction(evm *vm.EVM, gp *GasPool, statedb *state.StateDB, header *
// contract. This method is exported to be used in tests.
func ProcessBeaconBlockRoot ( beaconRoot common . Hash , evm * vm . EVM ) {
if tracer := evm . Config . Tracer ; tracer != nil {
if tracer . OnSystemCallStart != nil {
tracer . OnSystemCallStart ( )
}
onSystemCallStart ( tracer , evm . GetVMContext ( ) )
if tracer . OnSystemCallEnd != nil {
defer tracer . OnSystemCallEnd ( )
}
@ -238,9 +237,7 @@ func ProcessBeaconBlockRoot(beaconRoot common.Hash, evm *vm.EVM) {
// as per EIP-2935.
func ProcessParentBlockHash ( prevHash common . Hash , evm * vm . EVM ) {
if tracer := evm . Config . Tracer ; tracer != nil {
if tracer . OnSystemCallStart != nil {
tracer . OnSystemCallStart ( )
}
onSystemCallStart ( tracer , evm . GetVMContext ( ) )
if tracer . OnSystemCallEnd != nil {
defer tracer . OnSystemCallEnd ( )
}
@ -274,9 +271,7 @@ func ProcessConsolidationQueue(requests *[][]byte, evm *vm.EVM) {
func processRequestsSystemCall ( requests * [ ] [ ] byte , evm * vm . EVM , requestType byte , addr common . Address ) {
if tracer := evm . Config . Tracer ; tracer != nil {
if tracer . OnSystemCallStart != nil {
tracer . OnSystemCallStart ( )
}
onSystemCallStart ( tracer , evm . GetVMContext ( ) )
if tracer . OnSystemCallEnd != nil {
defer tracer . OnSystemCallEnd ( )
}
@ -322,3 +317,11 @@ func ParseDepositLogs(requests *[][]byte, logs []*types.Log, config *params.Chai
}
return nil
}
func onSystemCallStart ( tracer * tracing . Hooks , ctx * tracing . VMContext ) {
if tracer . OnSystemCallStartV2 != nil {
tracer . OnSystemCallStartV2 ( ctx )
} else if tracer . OnSystemCallStart != nil {
tracer . OnSystemCallStart ( )
}
}