fix(op-reth): surface pruned block bodies as a typed error instead of state-root mismatch#21495
Merged
Merged
Conversation
… state-root mismatch
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
sebastianst
reviewed
Jun 22, 2026
Member
There was a problem hiding this comment.
🤖 Claude says: Rust review of the pruned-body detection. The core approach is sound — both detection heuristics are logically correct (engine: transactions_root != EMPTY && empty body; backfill: empty per-block revert + state_root[N] != state_root[N-1], correctly guarded for genesis), and the engine + backfill paths are well tested.
Findings inline, by severity:
- 🔴 High — the
unwind.rsguard returns an error before unwinding, contradicting its own comment/message ("unwind proceeds") and turning a safe unwind into a hard failure. Likely meant to be awarn!+ continue. - 🟠 Medium — the new
alloy-triedependency is unnecessary (alloy_consensus::EMPTY_ROOT_HASHis already in scope). - 🟡 Low —
Cargo.tomltabs/trailing-comma; doc comments claim a (non-existent) mirrored check inadvance_sync; the backfill test only covers v1 storage settings (acceptable, but worth noting v2 pruning isn't exercised).
Recommend addressing the High finding before merge; the rest are scope-hygiene cleanups.
sebastianst
approved these changes
Jun 22, 2026
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.
Description
Replace the misleading
StateRootMismatchthat surfaces when reth has pruned a block we depend on with a dedicatedBlockBodyPrunederror variant. Detection sits in two places: the engine'stasks::execute_block::run(covers live syncand any caller of
EngineHandle::execute_block) and the backfill'scompute_block_backfill_diff(covers the changeset-pruning path that backfill actually reads from).Tests
Test cases added
Additional context
NA
Metadata
NA