From 1f04e44e96d47b8609ec1c958cce4a98188540f8 Mon Sep 17 00:00:00 2001 From: milen <94537774+taratorio@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:07:09 +0100 Subject: [PATCH] eth/tracers: always pop precompiles stack in callTracer (#11004) made a mistake in previous PR https://github.com/ledgerwatch/erigon/pull/10986 should always pop the precompiles stack for correctness --- eth/tracers/native/call.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index 31f0f08cf60..f1781a06474 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -254,8 +254,13 @@ func (t *callTracer) CaptureExit(output []byte, gasUsed uint64, err error) { return } precompilesLastIdx := len(t.precompiles) - 1 - if !t.config.IncludePrecompiles && precompilesLastIdx > -1 && t.precompiles[precompilesLastIdx] { - t.precompiles = t.precompiles[:precompilesLastIdx] + if precompilesLastIdx < 0 { + return + } + // pop precompile + precompile := t.precompiles[precompilesLastIdx] + t.precompiles = t.precompiles[:precompilesLastIdx] + if precompile && !t.config.IncludePrecompiles { return } // pop call