Skip to content

blockchain/vm: fix onlyTopCall discarding the top frame's logs - #1027

Open
2dvorak wants to merge 1 commit into
kaiachain:devfrom
2dvorak:fix/calltracer-onlytopcall-log-depth
Open

blockchain/vm: fix onlyTopCall discarding the top frame's logs#1027
2dvorak wants to merge 1 commit into
kaiachain:devfrom
2dvorak:fix/calltracer-onlytopcall-log-depth

Conversation

@2dvorak

@2dvorak 2dvorak commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

  • callTracer with withLog && onlyTopCall returned no logs at all, including the top frame's own
  • depth is the opcode depth, which counts active frames and therefore reads 1 while the top frame executes, not 0
  • replace > 0 to > 1 accordingly

Types of changes

  • 🐛 Bug fix
  • ✨ Non-hardfork changes (node upgrade not required)
  • 💥 Hardfork / consensus-breaking changes
  • 🧪 Test improvements
  • 🧰 CI / build tool
  • ♻️ Chore / Refactor / Non-functional changes

Checklist

  • 📖 I have read the CONTRIBUTING GUIDELINES doc
  • 📝 I have signed in the PR comment I have read the CLA Document and I hereby sign the CLA in first time contribute after having read CLA
  • 🟢 Lint and unit tests pass locally with my changes ($ make test)

Related issues

Before refactoring, geth had the same issue.

Further comments

callTracer with `{"withLog":true,"onlyTopCall":true}` returned no logs at all,
including the top frame's own: `depth` is the opcode depth, which counts active
frames and therefore reads 1 while the top frame executes, not 0.
@2dvorak 2dvorak self-assigned this Aug 10, 2026
@2dvorak 2dvorak mentioned this pull request Aug 10, 2026
15 tasks
@2dvorak 2dvorak added the do not merge Do not merge just yet label Aug 10, 2026
@2dvorak
2dvorak marked this pull request as ready for review August 10, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Do not merge just yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants