Skip to content

Commit

Permalink
eth/tracers: always pop precompiles stack in callTracer (#11004)
Browse files Browse the repository at this point in the history
made a mistake in previous PR
#10986
should always pop the precompiles stack for correctness
  • Loading branch information
taratorio authored Jul 4, 2024
1 parent 9710e98 commit 1a050db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eth/tracers/native/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,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
Expand Down

0 comments on commit 1a050db

Please sign in to comment.