Skip to content

Commit

Permalink
Merge pull request ethereum#28 from OffchainLabs/hostio-gdb
Browse files Browse the repository at this point in the history
Extend hostio tracing
  • Loading branch information
rachel-bousfield authored Oct 3, 2023
2 parents 4d61d86 + b1ed2b4 commit b9c8fa5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/vm/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type EVMLogger interface {
CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool)

// Stylus: capture hostio invocation
CaptureStylusHostio(name string, args, outs []byte, ink uint64)
CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64)

// Transaction level
CaptureTxStart(gasLimit uint64)
Expand Down
5 changes: 3 additions & 2 deletions eth/tracers/js/tracer_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (jst *jsTracer) CaptureArbitrumTransfer(
func (*jsTracer) CaptureArbitrumStorageGet(key common.Hash, depth int, before bool) {}
func (*jsTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}

func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {
func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
hostio, ok := goja.AssertFunction(jst.obj.Get("hostio"))
if !ok {
return
Expand All @@ -66,7 +66,8 @@ func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, ink uin
info.Set("name", name)
info.Set("args", args)
info.Set("outs", outs)
info.Set("ink", ink)
info.Set("startInk", startInk)
info.Set("endInk", endInk)

if _, err := hostio(jst.obj, info); err != nil {
jst.err = wrapError("hostio", err)
Expand Down
9 changes: 5 additions & 4 deletions eth/tracers/logger/logger_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (*JSONLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int,
func (*StructLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
func (*mdLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}

func (*AccessListTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*JSONLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*StructLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*mdLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*AccessListTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
}
func (*JSONLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*StructLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*mdLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
4 changes: 2 additions & 2 deletions eth/tracers/native/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ func (t *muxTracer) CaptureArbitrumTransfer(env *vm.EVM, from, to *common.Addres
}
}

func (t *muxTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {
func (t *muxTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
for _, t := range t.tracers {
t.CaptureStylusHostio(name, args, outs, ink)
t.CaptureStylusHostio(name, args, outs, startInk, endInk)
}
}

Expand Down
10 changes: 5 additions & 5 deletions eth/tracers/native/tracer_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func (*noopTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int,
func (*prestateTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
func (*flatCallTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}

func (*callTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*fourByteTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*noopTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*prestateTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*flatCallTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
func (*callTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*fourByteTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*noopTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*prestateTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
func (*flatCallTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}

func bigToHex(n *big.Int) string {
if n == nil {
Expand Down

0 comments on commit b9c8fa5

Please sign in to comment.