- 
                Notifications
    You must be signed in to change notification settings 
- Fork 24
feat: add TriePathIter for iterating over the nodes along a path #1367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: brandon.leblanc/hashable-assoc-types
Are you sure you want to change the base?
feat: add TriePathIter for iterating over the nodes along a path #1367
Conversation
6d39ab2    to
    d710821      
    Compare
  
    3e79cd6    to
    99974a1      
    Compare
  
    d710821    to
    2446fa7      
    Compare
  
    99974a1    to
    dbb899d      
    Compare
  
    2446fa7    to
    787fe3c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's chat about this and how it differs from the existing MerkleNodeIter. The existing code is tested heavily as it forms the basis of MerkleKeyValueIter.
If this code is better/faster/more generic, lets describe which and the motivation for a new iterator more clearly in the PR description.
dbb899d    to
    366441a      
    Compare
  
    787fe3c    to
    30e63e5      
    Compare
  
    `TrieNode` is a generic trait that abstracts over the behavior of nodes in a fixed-arity radix trie. This trait allows for different structures to represent tries while enabling similar operations on them. `TrieNode` is merkle-aware, meaning it can represent nodes that are a mix of locally described children or children referenced by only their hash. This is accomplished through `TrieEdgeState` and is used later in proof verification. The `HashedTrieNode` trait is for post-hashed nodes and is distinctly different from the hash described on `TrieNode`. This trait is intended to represent the computed hash of the node itself; whereas, the hash accessed via `TrieNode` is the hash of a child node as seen from its parent. While they are usually the same, they can differ during intermediate states of a trie or during proof verification when some information is incomplete. `KeyValueTrieRoot` is an implementation of `TrieNode` that only represents a key-value store and is not merkleized. This is really a separate change and is a component of proof verification but is also needed here as it is used to test and verify the iterator.
This expands on the previously added key-value trie by adding a hashed variant and mechanism to convert from unhashed to hashed.
30e63e5    to
    8b019d4      
    Compare
  
    7cf3d26    to
    9087e50      
    Compare
  
    
This is used to walk along a path to yield all of the edges. In proof verification, this is used to verify the paths of the proof are valid.