Skip to content

Commit b9c8fa5

Browse files
Merge pull request #28 from OffchainLabs/hostio-gdb
Extend hostio tracing
2 parents 4d61d86 + b1ed2b4 commit b9c8fa5

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

core/vm/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type EVMLogger interface {
3434
CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool)
3535

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

3939
// Transaction level
4040
CaptureTxStart(gasLimit uint64)

eth/tracers/js/tracer_arbitrum.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (jst *jsTracer) CaptureArbitrumTransfer(
5656
func (*jsTracer) CaptureArbitrumStorageGet(key common.Hash, depth int, before bool) {}
5757
func (*jsTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
5858

59-
func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {
59+
func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
6060
hostio, ok := goja.AssertFunction(jst.obj.Get("hostio"))
6161
if !ok {
6262
return
@@ -66,7 +66,8 @@ func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, ink uin
6666
info.Set("name", name)
6767
info.Set("args", args)
6868
info.Set("outs", outs)
69-
info.Set("ink", ink)
69+
info.Set("startInk", startInk)
70+
info.Set("endInk", endInk)
7071

7172
if _, err := hostio(jst.obj, info); err != nil {
7273
jst.err = wrapError("hostio", err)

eth/tracers/logger/logger_arbitrum.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ func (*JSONLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int,
4242
func (*StructLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
4343
func (*mdLogger) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
4444

45-
func (*AccessListTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
46-
func (*JSONLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
47-
func (*StructLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
48-
func (*mdLogger) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
45+
func (*AccessListTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
46+
}
47+
func (*JSONLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
48+
func (*StructLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
49+
func (*mdLogger) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}

eth/tracers/native/mux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ func (t *muxTracer) CaptureArbitrumTransfer(env *vm.EVM, from, to *common.Addres
131131
}
132132
}
133133

134-
func (t *muxTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {
134+
func (t *muxTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {
135135
for _, t := range t.tracers {
136-
t.CaptureStylusHostio(name, args, outs, ink)
136+
t.CaptureStylusHostio(name, args, outs, startInk, endInk)
137137
}
138138
}
139139

eth/tracers/native/tracer_arbitrum.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ func (*noopTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int,
9090
func (*prestateTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
9191
func (*flatCallTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, before bool) {}
9292

93-
func (*callTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
94-
func (*fourByteTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
95-
func (*noopTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
96-
func (*prestateTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
97-
func (*flatCallTracer) CaptureStylusHostio(name string, args, outs []byte, ink uint64) {}
93+
func (*callTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
94+
func (*fourByteTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
95+
func (*noopTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
96+
func (*prestateTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
97+
func (*flatCallTracer) CaptureStylusHostio(name string, args, outs []byte, startInk, endInk uint64) {}
9898

9999
func bigToHex(n *big.Int) string {
100100
if n == nil {

0 commit comments

Comments
 (0)