Skip to content

Commit

Permalink
Call Tracer.CaptureState before memory expansion (#8860)
Browse files Browse the repository at this point in the history
This aligns the tracing behavior with Geth, Besu and Nimbus.
  • Loading branch information
guidovranken authored Nov 30, 2023
1 parent 8d1758c commit 015f6eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,15 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
if err != nil || !contract.UseGas(dynamicCost) {
return nil, ErrOutOfGas
}
// Do tracing before memory expansion
if in.cfg.Debug {
in.cfg.Tracer.CaptureState(_pc, op, gasCopy, cost, callContext, in.returnData, in.depth, err) //nolint:errcheck
logged = true
}
if memorySize > 0 {
mem.Resize(memorySize)
}
}
if in.cfg.Debug {
} else if in.cfg.Debug {
in.cfg.Tracer.CaptureState(_pc, op, gasCopy, cost, callContext, in.returnData, in.depth, err) //nolint:errcheck
logged = true
}
Expand Down

0 comments on commit 015f6eb

Please sign in to comment.