add OnSystemCallStartV2
This commit is contained in:
parent
a2ca5f81ff
commit
85a85d09c7
|
@ -208,8 +208,10 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
|
|||
// contract. This method is exported to be used in tests.
|
||||
func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, statedb *state.StateDB) {
|
||||
if tracer := vmenv.Config.Tracer; tracer != nil {
|
||||
if tracer.OnSystemCallStart != nil {
|
||||
tracer.OnSystemCallStart(vmenv.GetVMContext())
|
||||
if tracer.OnSystemCallStartV2 != nil {
|
||||
tracer.OnSystemCallStartV2(vmenv.GetVMContext())
|
||||
} else if tracer.OnSystemCallStart != nil {
|
||||
tracer.OnSystemCallStart()
|
||||
}
|
||||
if tracer.OnSystemCallEnd != nil {
|
||||
defer tracer.OnSystemCallEnd()
|
||||
|
@ -237,8 +239,10 @@ func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, statedb *stat
|
|||
// as per EIP-2935.
|
||||
func ProcessParentBlockHash(prevHash common.Hash, vmenv *vm.EVM, statedb *state.StateDB) {
|
||||
if tracer := vmenv.Config.Tracer; tracer != nil {
|
||||
if tracer.OnSystemCallStart != nil {
|
||||
tracer.OnSystemCallStart(vmenv.GetVMContext())
|
||||
if tracer.OnSystemCallStartV2 != nil {
|
||||
tracer.OnSystemCallStartV2(vmenv.GetVMContext())
|
||||
} else if tracer.OnSystemCallStart != nil {
|
||||
tracer.OnSystemCallStart()
|
||||
}
|
||||
if tracer.OnSystemCallEnd != nil {
|
||||
defer tracer.OnSystemCallEnd()
|
||||
|
|
|
@ -148,7 +148,11 @@ type (
|
|||
//
|
||||
// Note that system call happens outside normal transaction execution, so the `OnTxStart/OnTxEnd` hooks
|
||||
// will not be invoked.
|
||||
OnSystemCallStartHook = func(vm *VMContext)
|
||||
OnSystemCallStartHook = func()
|
||||
|
||||
// OnSystemCallStartHookV2 is called when a system call is about to be executed. Refer
|
||||
// to `OnSystemCallStartHook` for more information.
|
||||
OnSystemCallStartHookV2 = func(vm *VMContext)
|
||||
|
||||
// OnSystemCallEndHook is called when a system call has finished executing. Today,
|
||||
// this hook is invoked when the EIP-4788 system call is about to be executed to set the
|
||||
|
@ -214,6 +218,7 @@ type Hooks struct {
|
|||
OnGenesisBlock GenesisBlockHook
|
||||
OnReorg ReorgHook
|
||||
OnSystemCallStart OnSystemCallStartHook
|
||||
OnSystemCallStartV2 OnSystemCallStartHookV2
|
||||
OnSystemCallEnd OnSystemCallEndHook
|
||||
// State events
|
||||
OnBalanceChange BalanceChangeHook
|
||||
|
|
|
@ -127,7 +127,7 @@ func (l *jsonLogger) OnOpcode(pc uint64, op byte, gas, cost uint64, scope tracin
|
|||
l.encoder.Encode(log)
|
||||
}
|
||||
|
||||
func (l *jsonLogger) onSystemCallStart(_ *tracing.VMContext) {
|
||||
func (l *jsonLogger) onSystemCallStart() {
|
||||
// Process no events while in system call.
|
||||
hooks := *l.hooks
|
||||
*l.hooks = tracing.Hooks{
|
||||
|
|
Loading…
Reference in New Issue