Skip to content

fix(inspector): ignore stale SELFDESTRUCT journal entries#3805

Open
0xalpharush wants to merge 1 commit into
bluealloy:mainfrom
0xalpharush:agent/selfdestruct-inspector-journal-main
Open

fix(inspector): ignore stale SELFDESTRUCT journal entries#3805
0xalpharush wants to merge 1 commit into
bluealloy:mainfrom
0xalpharush:agent/selfdestruct-inspector-journal-main

Conversation

@0xalpharush

@0xalpharush 0xalpharush commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • record the journal index immediately before each interpreter instruction
  • derive SELFDESTRUCT callback metadata only from entries produced by the terminating instruction
  • add a Cancun regression test for SELFDESTRUCT-to-self after a transaction value transfer

This reapplies the standalone fix from #3797 directly onto main, per the maintainer feedback in that PR.

Root cause

Under EIP-6780, SELFDESTRUCT-to-self can be a state no-op and append no destruction entry. The inspector previously read journal.last(), which could reuse an unrelated earlier balance transfer or destruction and emit a false SELFDESTRUCT callback with stale metadata.

Execution, state, and receipts are unaffected; this corrects inspector/tracer callbacks.

Validation

  • cargo test -p revm-inspector cancun_selfdestruct_to_self_does_not_reuse_prior_journal_entry
  • cargo test -p revm-inspector --lib
  • cargo check -p revm-inspector --all-features
  • cargo check -p revm-inspector --no-default-features
  • cargo clippy -p revm-inspector --all-targets --all-features -- -D warnings
  • cargo fmt --all --check

@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 181 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing 0xalpharush:agent/selfdestruct-inspector-journal-main (dee35be) with main (5199506)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@0xalpharush
0xalpharush force-pushed the agent/selfdestruct-inspector-journal-main branch from aafdfd5 to dee35be Compare July 17, 2026 14:14
@0xalpharush
0xalpharush marked this pull request as ready for review July 17, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant