Skip to content

perf(trie): backport reth#27129 overlay storage roots and historical proofs - #11

Closed
sebastianst wants to merge 2 commits into
joshklop/optimismfrom
seb/overlay-storage-root-nodes
Closed

sebastianst wants to merge 2 commits into
joshklop/optimismfrom
seb/overlay-storage-root-nodes

Conversation

@sebastianst

@sebastianst sebastianst commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Backports upstream reth#27129 (835e42864d, first released in v2.7.0) onto the v2.6.0 pin, plus a regression test for the OP-critical case.

Bug: under state masking (on by default since v2.6.0), OverlayStateProvider::storage_root, storage_proof and storage_multiproof walked the database storage trie and ignored the overlay's trie nodes. Masking leaves database nodes older than the persisted hashed storage, so siblings outside the prefix set were hashed from stale values.

  • Upstream reth: gets wrong storageRoot values from eth_getAccount.
  • OP chains: consensus-critical. Since Isthmus the header's withdrawalsRoot is the L2ToL1MessagePasser storage root, which op-reth computes this way when building and when validating blocks (rust!: update reth to v2.6.0 optimism#23046).

reth#27129 passes the full trie input through DbStorageRoot::overlay_root and overlay_storage_multiproof. It also completes the overlay up to the Finish block before building historical proofs, which fixes proofs and witnesses over masked rows, and it skips loading trie changesets when only roots or proofs are needed. It applies cleanly to 4553cf1cab.

Test: the second commit adds storage_root_over_masked_state_trie. It fails on 4553cf1cab and passes with the backport and on v2.7.0. reth-storage-overlay, reth-trie-db and reth-provider pass (342 tests), and nightly clippy and fmt are clean.

The backport drops out at the next pin bump to v2.7.0 or later. The test is worth proposing upstream.

🤖 Co-created with Claude Opus 5.5

mediocregopher and others added 2 commits October 1, 2026 10:42
Pin that `OverlayStateProvider::storage_root` reads trie nodes through
the overlay when partial persistence leaves database storage-trie nodes
older than the persisted hashed storage. OP Stack consensus depends on
this: the Isthmus withdrawals root is the L2ToL1MessagePasser storage
root, computed through `storage_root` when building and validating
blocks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sebastianst
sebastianst force-pushed the seb/overlay-storage-root-nodes branch from 32c0cd2 to 339cb63 Compare October 1, 2026 08:47
@sebastianst sebastianst changed the title fix(storage-overlay): apply overlay trie nodes to storage roots and proofs perf(trie): backport reth#27129 overlay storage roots and historical proofs Oct 1, 2026
@sebastianst
sebastianst added this pull request to stack #14 October 1, 2026 13:33
@sebastianst

Copy link
Copy Markdown
Member Author

🤖 Opus 5.5 says: Superseded by Josh's pin branch joshklop/v2.6.0-review-fixes (a280002), which carries these picks content-identically plus paradigmxyz#27634, paradigmxyz#27252 and paradigmxyz#27832. #12 is rebased onto that branch.

@sebastianst
sebastianst removed this pull request from stack #14 October 12, 2026 13:07
@sebastianst
sebastianst deleted the seb/overlay-storage-root-nodes branch October 21, 2026 08:24
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.

2 participants