reth icon indicating copy to clipboard operation
reth copied to clipboard

`TrieNodeIter` seeks hashed cursor to the key that we just advanced to

Open shekhirin opened this issue 7 months ago • 1 comments
trafficstars

Describe the feature

https://github.com/paradigmxyz/reth/blob/32e36133c68ab9061fa8389257fce4eff2588433/crates/trie/trie/src/node_iter.rs#L437-L442

Relevant logs:

2025-03-27T12:14:09.484319Z TRACE trie::walker_metrics: Sought the trie table key=Nibbles(0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002) entry=Some((Nibbles(0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002), BranchNodeCompact { state_mask: TrieMask(0000000000000111), tree_mask: TrieMask(0000000000000000), hash_mask: TrieMask(0000000000000010), hashes: [0xd029498d69e20c4121be9f9e08e361e04400c7c067090b8c988e778da2fe7d02], root_hash: None })) exact=false
...
2025-03-27T12:14:09.485857Z TRACE trie::node_iter: seeking to the next hashed entry seek_from=0x0000000000000000000000000000000000000000000000000000000000000212 seek_to=Some(0x0000000000000000000000000000000000000000000000000000000000000220)
// No need to seek, because we just advanced to that key
2025-03-27T12:14:09.485865Z TRACE trie::node_iter: seeking to the next unprocessed hashed entry seek_key=0x0000000000000000000000000000000000000000000000000000000000000220 can_skip_current_node=false

Additional context

No response

shekhirin avatar Mar 27 '25 12:03 shekhirin