Skip to content
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

Traversable Trie Advanced Data Layout #45

Open
nasdf opened this issue Jan 17, 2022 · 0 comments
Open

Traversable Trie Advanced Data Layout #45

nasdf opened this issue Jan 17, 2022 · 0 comments
Assignees

Comments

@nasdf
Copy link
Contributor

nasdf commented Jan 17, 2022

Traversal of MMPTs requires logic that cannot be done within standard IPLD selectors.
Creating a simple ADL for trie nodes will enable much simpler IPLD queries.

  • Select transaction <tx-root>/<rlp-index>
  • Select account <state-root>/<keccak256-address>
  • Select storage <storage-root>/<keccak256-slot>

The ADL would transform TrieBranchNode, TrieExtensionNode, and TrieLeafNode types.
The proposed ADL could take the following form.

type TraversableTrie struct {
    Child0 nullable &TraversableTrie
    Child1 nullable &TraversableTrie
    Child2 nullable &TraversableTrie
    Child3 nullable &TraversableTrie
    Child4 nullable &TraversableTrie
    Child5 nullable &TraversableTrie
    Child6 nullable &TraversableTrie
    Child7 nullable &TraversableTrie
    Child8 nullable &TraversableTrie
    Child9 nullable &TraversableTrie
    ChildA nullable &TraversableTrie
    ChildB nullable &TraversableTrie
    ChildC nullable &TraversableTrie
    ChildD nullable &TraversableTrie
    ChildE nullable &TraversableTrie
    ChildF nullable &TraversableTrie
    Value  nullable Value
    PartialPath nullable Bytes
}
@nasdf nasdf mentioned this issue Jan 17, 2022
@i-norden i-norden self-assigned this Jan 20, 2022
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

No branches or pull requests

2 participants