Skip to content

Commit fc378f4

Browse files
committed
all: support calltracer2
1 parent 604310c commit fc378f4

26 files changed

+331
-305
lines changed

core/tracing/hooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ type (
9393
// Take note that EnterHook, when in the context of a live tracer, can be invoked
9494
// outside of the `OnTxStart` and `OnTxEnd` hooks when dealing with system calls,
9595
// see [OnSystemCallStartHook] and [OnSystemCallEndHook] for more information.
96-
EnterHook = func(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)
96+
EnterHook = func(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int, order uint64)
9797

9898
// ExitHook is invoked when the processing of a message ends.
9999
// `revert` is true when there was an error during the execution.

core/vm/evm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ func (evm *EVM) SetHook(evmHook EVMHook) {
663663
func (evm *EVM) captureBegin(depth int, typ OpCode, from common.Address, to common.Address, input []byte, startGas uint64, value *big.Int) {
664664
tracer := evm.Config.Tracer
665665
if tracer.OnEnter != nil {
666-
tracer.OnEnter(depth, byte(typ), from, to, input, startGas, value)
666+
tracer.OnEnter(depth, byte(typ), from, to, input, startGas, value, evm.Context.Counter)
667667
}
668668
if tracer.OnGasChange != nil {
669669
tracer.OnGasChange(0, startGas, tracing.GasChangeCallInitialBalance)

core/vm/instructions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext
809809
interpreter.evm.StateDB.SelfDestruct(scope.Contract.Address())
810810
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
811811
if tracer.OnEnter != nil {
812-
tracer.OnEnter(interpreter.evm.depth, byte(SELFDESTRUCT), scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance)
812+
tracer.OnEnter(interpreter.evm.depth, byte(SELFDESTRUCT), scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance, interpreter.evm.Context.Counter)
813813
}
814814
if tracer.OnExit != nil {
815815
tracer.OnExit(interpreter.evm.depth, []byte{}, 0, nil, false)
@@ -826,7 +826,7 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon
826826
interpreter.evm.StateDB.SelfDestruct6780(scope.Contract.Address())
827827
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
828828
if tracer.OnEnter != nil {
829-
tracer.OnEnter(interpreter.evm.depth, byte(SELFDESTRUCT), scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance)
829+
tracer.OnEnter(interpreter.evm.depth, byte(SELFDESTRUCT), scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance, interpreter.evm.Context.Counter)
830830
}
831831
if tracer.OnExit != nil {
832832
tracer.OnExit(interpreter.evm.depth, []byte{}, 0, nil, false)

0 commit comments

Comments
 (0)