Skip to content

fix(evm): remove OrderDetector::selfdestruct frame pop (ENG-2293)#238

Merged
prestwich merged 1 commit into
mainfrom
prestwich/eng-2293
May 25, 2026
Merged

fix(evm): remove OrderDetector::selfdestruct frame pop (ENG-2293)#238
prestwich merged 1 commit into
mainfrom
prestwich/eng-2293

Conversation

@prestwich

@prestwich prestwich commented May 24, 2026

Copy link
Copy Markdown
Member

Summary

  • OrderDetector::selfdestruct called self.exit_frame(), but revm's selfdestruct inspector hook is not a call/create frame boundary — the enclosing frame still terminates via call_end/create_end. The double pop made the next call_end panic in Framed::exit_frame at frame_boundaries.pop().unwrap().
  • Removed the selfdestruct Inspector method. SELFDESTRUCT doesn't revert events emitted earlier in the frame, and the frame's normal end-of-call hook handles the pop.
  • Added a regression test (selfdestruct_inside_frame_does_not_unbalance_stack) covering call → events → selfdestructcall_end(success), asserting the exact frame-boundary stack (&[0]) is preserved across the selfdestruct hook.
  • Added a pub(crate) test-only Framed::frame_boundaries(&self) -> &[usize] accessor for stack introspection.

Fixes ENG-2293. Reported externally as an asymmetric-DoS source-only vulnerability affecting v0.16.0, v0.18.0, v0.19.0.

Test plan

  • cargo test -p signet-evm orders::inspector
  • cargo clippy -p signet-evm --all-features --all-targets -- -D warnings
  • cargo clippy -p signet-evm --no-default-features --all-targets -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc -p signet-evm --no-deps --all-features
  • cargo +nightly fmt

🤖 Generated with Claude Code

@prestwich prestwich requested a review from a team as a code owner May 24, 2026 08:03
revm's `selfdestruct` inspector hook is not a call/create frame boundary
— the enclosing frame still terminates via `call_end`/`create_end`.
Popping the frame stack on selfdestruct caused a double-pop and panicked
in `Framed::exit_frame` on the subsequent `call_end`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@prestwich prestwich force-pushed the prestwich/eng-2293 branch from de65347 to bfe2211 Compare May 24, 2026 08:13

@Evalir Evalir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, lgtm

@prestwich prestwich merged commit 20807c7 into main May 25, 2026
7 checks passed
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.

3 participants