Skip to content

Commit a437823

Browse files
Merge pull request #394 from OffchainLabs/flatcalltracer
backport #393 to nitro v3.3.x - fix flatCallTracer onexit out of bound
2 parents 3382d27 + 1cb0518 commit a437823

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

eth/tracers/api_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ func newTestMergedBackend(t *testing.T, n int, gspec *core.Genesis, generator fu
10191019
SnapshotLimit: 0,
10201020
TrieDirtyDisabled: true, // Archive mode
10211021
}
1022-
chain, err := core.NewBlockChain(backend.chaindb, cacheConfig, gspec, nil, backend.engine, vm.Config{}, nil, nil)
1022+
chain, err := core.NewBlockChain(backend.chaindb, cacheConfig, nil, gspec, nil, backend.engine, vm.Config{}, nil, nil)
10231023
if err != nil {
10241024
t.Fatalf("failed to create tester chain: %v", err)
10251025
}

eth/tracers/native/call_flat.go

+3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ func (t *flatCallTracer) OnExit(depth int, output []byte, gasUsed uint64, err er
195195
if t.config.IncludePrecompiles {
196196
return
197197
}
198+
if len(t.tracer.callstack[len(t.tracer.callstack)-1].Calls) == 0 {
199+
return
200+
}
198201
var (
199202
// call has been nested in parent
200203
parent = t.tracer.callstack[len(t.tracer.callstack)-1]

0 commit comments

Comments
 (0)