Commits
Click on a commit to change the comparison rangeperf(trie): store extension node hashes
Add opt-in support for storing extension node hashes in parent branch
nodes' hash_mask. This reduces database lookups during proof generation
by avoiding the need to traverse through extension nodes to find the
underlying branch hash.
The feature is controlled via the `with_store_extension_node_hashes`
builder method on `SerialSparseTrie`.
Changes:
- Add `store_extension_node_hashes` field to `SerialSparseTrie`
- Add `with_store_extension_node_hashes` builder method
- Add `is_extension` method to `SparseNodeType`
- Update hash mask computation in `rlp_node` to include extension
node hashes when the feature is enabled
- Add test for the new functionality
Closes #17922 perf(trie): always store extension node hashes
Remove configurable flag - extension node hashes are now always stored
in parent branch nodes' hash_mask. This reduces database lookups during
proof generation.
Updated test to allow sparse trie to have more hash_mask bits than
HashBuilder (since HB doesn't store extension hashes yet). perf(trie): implement extension hash storage on ParallelSparseTrie
Address review comment: extension node hashes are now stored in parent
branch nodes' hash_mask for both SerialSparseTrie and ParallelSparseTrie.
Changes:
- Update rlp_node hash_mask logic to include extension nodes that should
be stored in db
- Update assert_with_hash_builder to allow sparse trie to have MORE
hash_mask bits than HashBuilder (for extension node hashes)
- Update test_mainnet_block_24185431 to expect extension hash at child 1
Note: The alloy-trie branch (alexey/always-store-branch-nodes) is stale
and uses old nybbles. This functionality was implemented directly in
reth's sparse tries without depending on alloy-trie changes. fix: add backticks to doc comment for clippy