Skip to content

Operand stack in Tracer::step - #32

Open
sbillig wants to merge 1 commit into
mainfrom
feat/tracer-stack
Open

sbillig wants to merge 1 commit into
mainfrom
feat/tracer-stack

Conversation

@sbillig

@sbillig sbillig commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Tracer::step gets a read-only view of the frame's stack, top word last:

fn step(mut self, _ step: Step, stack: MemSlice<u256>) {}

A tracer can now see an opcode's operands, such as the address BALANCE or EXTCODEHASH is about to read. The hook runs before the opcode's own checks, so the stack may hold fewer words than the opcode needs.

Every step impl gains the parameter. Step, Trace's records and the fevm serve protocol are unchanged.

With the () tracer the view is erased: the fevm_conformance binary is byte-identical to main's at -O1 and -O2. In the fevm CLI, which also holds Trace copies, every handler is unchanged, but a few functions outside them come out differently (the untraced apply now inlines execute_message).

`step` gets a view of the frame's stack, top word last, so a tracer can
see an opcode's operands, such as the address BALANCE or EXTCODEHASH
reads. `Step`, `Trace`'s records and the `fevm serve` protocol are
unchanged. With `()` the view is erased: the untraced `fevm_conformance`
build is byte-identical at -O1 and -O2.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T22:48:08.934701Z 78eb8f8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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