chain(ethereum): treat Reth StackUnderflow/StackOverflow/OpcodeNotFound halts as deterministic#6645
Merged
incrypto32 merged 2 commits intoJun 24, 2026
Conversation
incrypto32
approved these changes
Jun 23, 2026
Member
|
Thanks for the PR @cargopete. |
Contributor
Author
Sure thing, will do later today |
…nd halts as deterministic
622030f to
07ae930
Compare
Contributor
Author
|
@incrypto32 should be done now |
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.
Fixes #6582.
Problem
Reth surfaces EVM halts through reth's
EthApiError::EvmHalt(HaltReason), which is formatted with the reason'sDebugrepresentation:revm's
HaltReason/InstructionResultvariants are derivedDebug, so they render in CamelCase with no spaces. A stack underflow therefore reacheseth_callerror handling as:is_rpc_revert_messagelower-cases the message and checkscontains, so it compares against"evm error: stackunderflow". The existing space-separated entry"stack underflow"never matches this, so the error is treated as non-deterministic — the subgraph stalls/retries instead of recording a deterministic revert.This is the same gap streamingfast/eth-go#10 closed on the Firehose side.
Fix
Add the missing reth halt variants (no spaces, matching the
Debugoutput) toRPC_EXECUTION_ERRORS:stackunderflow← the reported bugstackoverflowopcodenotfoundThe list already contains
invalidjumpandinvalidfeopcode, which catch"EVM error: InvalidJump"/"InvalidFEOpcode"via this exact path — so the pattern is already established and proven; these three siblings were simply missed.Note: reth's
OutOfGasis intercepted beforeEvmHaltand rendered as"out of gas: ..."(with spaces), which the existing"out of gas"entry already matches — so unlike the Firehose list, a no-spaceoutofgasis not required here.Verification
EvmHaltuses{0:?}(crates/rpc/rpc-eth-types/src/error/mod.rs).InstructionResult/HaltReasonare#[derive(Debug)]with variantsStackUnderflow,StackOverflow,OpcodeNotFound,InvalidJump,InvalidFEOpcode(crates/interpreter/src/instruction_result.rs).