Repository navigation
fix(evm,jit): reject Amsterdam CREATE pre-access failures before child frames - #366
Merged
rakita merged 3 commits intoSep 4, 2026
Merged
Conversation
0xalpharush
marked this pull request as ready for review
August 28, 2026 12:55
0xalpharush
requested review from
DaniPopes,
onbjerg and
rakita
as code owners
August 28, 2026 12:55
rakita
reviewed
Aug 30, 2026
| // pass: a create that early-fails on those never accesses the destination, so reading it | ||
| // here would leak it into the EIP-7928 block access list (and warm the address). The | ||
| // early-fail itself (pushing 0) is handled by the child frame below. | ||
| if depth <= CALL_DEPTH_LIMIT |
Member
There was a problem hiding this comment.
Yeah this was a bug, depth needed to be checked every time.
Fortunately this can't be triggered as with 16M gas limit, 1024 call depth will never be hit (max is around 400-500calls iirc)
Member
There was a problem hiding this comment.
I see what this did, it skipped loading of target here, so it can be loaded later in subcall. This kinda worked but it is brittle.
rakita
reviewed
Aug 30, 2026
| if let Some(caller_info) = caller_info.as_ref().filter(|_| state.feature(EvmFeatures::EIP8037)) | ||
| && (caller_info.balance < value || caller_info.nonce == u64::MAX) | ||
| { | ||
| state.clear_return_data(); |
Member
There was a problem hiding this comment.
It was previously fine for consensus, but path was not great, it would skip loading of account and do subcall and in essence call inspector.
Member
|
@decofe audit |
Member
|
cyclops audit |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CREATE/CREATE2when the caller cannot fund the endowment or its nonce is exhaustedDivergence
Under EIP-8037, revm performs the caller balance and nonce checks in the CREATE opcode before yielding a child frame. evm2 already used those checks to suppress destination state-gas access, but still split child gas, constructed a create message, and invoked the host/inspector. That produced a spurious CREATE/CREATE2 inspector frame for an operation revm completed locally.
This keeps the opcode charge and caller load, then matches revm by clearing returndata, pushing zero, and returning immediately. The destination remains untouched and no child gas split or inspector hook occurs.
The earlier CALL runtime-OOG candidate is intentionally excluded: the frame-preparation changes from #315 already charge runtime gas before host/inspector execution, and its saved artifact passes.
Validation
cargo test -p evm2 --lib(480 passed)LLVM_SYS_221_PREFIX=/usr/lib/llvm-22 cargo test -p evm2-jit-builtins --lib(7 passed)LLVM_SYS_221_PREFIX=/usr/lib/llvm-22 cargo clippy -p evm2 -p evm2-jit-builtins --all-targets -- -D warningscargo +nightly fmt --all -- --checkstructured_compare_amsterdam/crash-32ae6735a8cc706d748eb11f591a96e9bb24d096bytecode_compare_amsterdam/crash-3fd99af48ccd1bbe3ef5a22fe6f9580add92ab9abytecode_compare_amsterdam/crash-f97ed6c8940d4ebaf809c86eeb31dd32af83455eBuilt as one commit from
a48e281c76f5fd0011b7f13f17c32d3db0ffbf11.