Skip to content

Commit

Permalink
Merge pull request #2382 from OffchainLabs/addgasopcode-stylus-tracing
Browse files Browse the repository at this point in the history
Add GAS opcode to Stylus tracing, and after producing a fake GAS opcode in a trace, add a POP afterwards
  • Loading branch information
PlasmaPower authored Jun 27, 2024
2 parents f867ae4 + 6321019 commit c223cd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arbos/programs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ func newApiClosures(
}
captureHostio := func(name string, args, outs []byte, startInk, endInk uint64) {
tracingInfo.Tracer.CaptureStylusHostio(name, args, outs, startInk, endInk)
if name == "evm_gas_left" || name == "evm_ink_left" {
tracingInfo.Tracer.CaptureState(0, vm.GAS, 0, 0, scope, []byte{}, depth, nil)
tracingInfo.Tracer.CaptureState(0, vm.POP, 0, 0, scope, []byte{}, depth, nil)
}
}

return func(req RequestType, input []byte) ([]byte, []byte, uint64) {
Expand Down

0 comments on commit c223cd8

Please sign in to comment.