Crate kona_mpt

Source
Expand description

§kona-mpt

CI Kona MPT License Codecov

A recursive, in-memory implementation of Ethereum’s hexary Merkle Patricia Trie (MPT), supporting:

  • Retrieval
  • Insertion
  • Deletion
  • Root Computation
    • Trie Node RLP Encoding

This implementation is intended to serve as a backend for a stateless executor of Ethereum blocks, like the one in the kona-executor crate. Starting with a trie root, the TrieNode can be unravelled to access, insert, or delete values. These operations are all backed by the TrieProvider, which enables fetching the preimages of hashed trie nodes.

Structs§

Nibbles
Structure representing a sequence of nibbles.
NoopTrieHinter
The default, no-op implementation of the TrieHinter trait, used for testing.
NoopTrieProvider
The default, no-op implementation of the TrieProvider trait, used for testing.
OrderedListWalker
A OrderedListWalker allows for traversing over a Merkle Patricia Trie containing a derivable ordered list.

Enums§

OrderedListWalkerError
An error type for OrderedListWalker operations.
TrieNode
A TrieNode is a node within a standard Ethereum Merkle Patricia Trie. In this implementation, keys are expected to be fixed-size nibble sequences, and values are arbitrary byte sequences.
TrieNodeError
An error type for TrieNode operations.

Traits§

TrieHinter
The TrieHinter trait defines the synchronous interface for hinting the host to fetch trie node preimages.
TrieProvider
The TrieProvider trait defines the synchronous interface for fetching trie node preimages.

Functions§

ordered_trie_with_encoder
Compute a trie root of the collection of items with a custom encoder.

Type Aliases§

OrderedListWalkerResult
A Result type alias where the error is OrderedListWalkerError.
TrieNodeResult
A Result type alias where the error is TrieNodeError.