From a9e96011f6c4ed884cf52aa11f3e458fbba6c05c Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Mon, 6 Jan 2025 18:36:17 +0530 Subject: [PATCH 1/3] fix flatCallTracer onexit out of bound --- eth/tracers/native/call_flat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index a51af560d..06e10f76d 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -195,6 +195,9 @@ func (t *flatCallTracer) OnExit(depth int, output []byte, gasUsed uint64, err er if t.config.IncludePrecompiles { return } + if len(t.tracer.callstack[len(t.tracer.callstack)-1].Calls) > 0 { + return + } var ( // call has been nested in parent parent = t.tracer.callstack[len(t.tracer.callstack)-1] From e83770c3c1c3cc25819114dda3a2c4c1b02819d5 Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Mon, 6 Jan 2025 18:37:32 +0530 Subject: [PATCH 2/3] fix --- eth/tracers/native/call_flat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index 06e10f76d..b1baf0ade 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -195,7 +195,7 @@ func (t *flatCallTracer) OnExit(depth int, output []byte, gasUsed uint64, err er if t.config.IncludePrecompiles { return } - if len(t.tracer.callstack[len(t.tracer.callstack)-1].Calls) > 0 { + if len(t.tracer.callstack[len(t.tracer.callstack)-1].Calls) == 0 { return } var ( From 1cb05188a54fad9e9f067b01fb066fec91b9c790 Mon Sep 17 00:00:00 2001 From: Joshua Colvin Date: Mon, 6 Jan 2025 14:16:25 -0700 Subject: [PATCH 3/3] Fix merge issues --- eth/tracers/api_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 8467fb323..f371d7b54 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -1019,7 +1019,7 @@ func newTestMergedBackend(t *testing.T, n int, gspec *core.Genesis, generator fu SnapshotLimit: 0, TrieDirtyDisabled: true, // Archive mode } - chain, err := core.NewBlockChain(backend.chaindb, cacheConfig, gspec, nil, backend.engine, vm.Config{}, nil, nil) + chain, err := core.NewBlockChain(backend.chaindb, cacheConfig, nil, gspec, nil, backend.engine, vm.Config{}, nil, nil) if err != nil { t.Fatalf("failed to create tester chain: %v", err) }