Skip to content

Traversable Trie Advanced Data Layout #45

@nasdf

Description

@nasdf

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
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions