Skip to content

fix(trie): tighten iterator seek boundary (v2.5.2 backport) - #39

Merged
danyalprout merged 1 commit into
backport/v2.5.2/mainfrom
backport/v2.5.2/trie-node-iter-seek
Nov 5, 2026
Merged

danyalprout merged 1 commit into
backport/v2.5.2/mainfrom
backport/v2.5.2/trie-node-iter-seek

Conversation

@danyalprout

Copy link
Copy Markdown

Why

Backports the upstream trie node iterator seek-boundary fix onto backport/v2.5.2/main for the Base releases/v1.5.3 line.

When the iterator seeks to a hashed key at a cached branch boundary, it decides whether it can skip the seek by checking the walker's current key. The old check accepted any walker key that merely started with the seek prefix. If the stored branch sits deeper than the seek prefix, hashed entries between the prefix and that branch were never visited, so an inserted leaf in that gap was left out of the incremental root.

What

Cherry-picked with -x provenance: fix(trie): tighten iterator seek boundary.

The skip now requires the walker key to equal the seek prefix exactly. The production change applied cleanly. The only conflict was a U256 import in the test module, resolved by taking the upstream import list. The upstream incremental-root test is carried along unchanged.

Testing

  • cargo test -p reth-trie --lib node_iter: 2 passed.
  • cargo clippy -p reth-trie --lib --tests -- -D warnings: clean.

Notes

Not tagged yet; after merge the next tag in the series is base-v2.5.2.11.

@danyalprout
danyalprout merged commit 9e380dd into backport/v2.5.2/main Nov 5, 2026
9 of 11 checks passed
danyalprout added a commit to base/base that referenced this pull request Nov 5, 2026
Carries base/reth#39, the trie node iterator seek-boundary fix, on the
releases/v1.5.3 line.

Generated with Claude Code

Co-authored-by: Claude <noreply@anthropic.com>
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.

4 participants