Skip to content

fix: check call depth in CREATE pre-access checks (EIP-8037) - #3829

Merged
rakita merged 1 commit into
mainfrom
fixlimit
Aug 14, 2026
Merged

rakita merged 1 commit into
mainfrom
fixlimit

Conversation

@rakita

@rakita rakita commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Moves the call-depth limit check from frame creation into the CREATE opcode's pre-access checks. Under EIP-8037, a too-deep CREATE now pushes 0 without reading the destination account, keeping the derived address out of the EIP-7928 block access list and the warm set.

  • Add depth to InputsTr/InputsImpl and thread it through frame creation so the opcode can see the current call depth
  • DummyHost now reports EIP-8037 as enabled when constructed with an Amsterdam spec
  • Add a test asserting that a CREATE at the depth limit pushes 0 without requesting a new frame

Testing

  • cargo nextest run -p revm-interpreter create_too_deep
  • cargo clippy --workspace --all-targets --all-features
  • cargo fmt --all --check

Move the call-depth limit check from frame creation into the CREATE
opcode's pre-access checks. A too-deep CREATE now pushes 0 without
reading the destination account, keeping it out of the EIP-7928 block
access list and the warm set.

- Add depth to InputsTr/InputsImpl so the opcode can see the frame depth
- Enable EIP-8037 in DummyHost when spec is Amsterdam
- Add test covering the too-deep CREATE path
@codspeed

codspeed Bot commented Jul 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 181 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing fixlimit (98bd107) with main (4a646d2)

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. ↩

@rakita

rakita commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

This is not reachable by 16M max gas limit, but either way it does not hurt to have it.

@rakita

rakita commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

Not possible to trigger with 16M gas limit, but the check should be there

@rakita
rakita merged commit 9cf5c53 into main Aug 14, 2026
34 checks passed
This was referenced Aug 14, 2026
RealiCZ added a commit to megaeth-labs/revm that referenced this pull request Sep 16, 2026
@RealiCZ RealiCZ mentioned this pull request Sep 18, 2026
30 tasks done
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