Expand description
Utility functions to interact with Substrate’s Base-16 Modified Merkle Patricia tree (“trie”).
Modules§
- accessed_
nodes_ tracker - Helpers for checking for duplicate nodes.
- cache
- Trie Cache
- nibble_
ops - Various re-exports from the
trie-db
crate. Utility methods to work on radix 16 nibble. - proof_
size_ extension - Externalities extension that provides access to the current proof size of the underlying recorder.
- recorder
- Trie recorder
- recorder_
ext - Extension for the default recorder.
- trie_
types - This module is for non generic definition of trie type.
Only the
Hasher
trait is generic in this case.
Structs§
- Compact
Proof - Storage proof in compact form.
- HashKey
- Various re-exports from the
memory-db
crate. Key function that only uses the hash - KeySpacedDB
HashDB
implementation that append a encoded prefix (unique id bytes) in addition to the prefix of every key value.- KeySpacedDB
Mut HashDBMut
implementation that append a encoded prefix (unique id bytes) in addition to the prefix of every key value.- Layout
V0 - substrate trie layout
- Layout
V1 - substrate trie layout, with external value nodes.
- Node
Codec - The Substrate format implementation of
NodeCodec
. Concrete implementation of aNodeCodecT
with SCALE encoding. - Prefixed
Key - Various re-exports from the
memory-db
crate. Key function that concatenates prefix and hash. - Recorder
- Various re-exports from the
trie-db
crate. Records trie nodes as they pass it. - Storage
Proof - A proof that some set of key-value pairs are included in the storage trie. The proof contains the storage values so that the partial storage backend can be reconstructed by a verifier that does not already have access to the key-value pairs.
- TrieDB
Double Ended Iterator - Various re-exports from the
trie-db
crate. Double ended iterator for going through all values in the trie in pre-order traversal order. - TrieDB
Iterator - Various re-exports from the
trie-db
crate. Iterator for going through all values in the trie in pre-order traversal order. - TrieDB
KeyDouble Ended Iterator - Various re-exports from the
trie-db
crate. Double ended iterator for going through all of key with values in the trie in pre-order traversal order. - TrieDB
KeyIterator - Various re-exports from the
trie-db
crate. Iterator for going through all of key with values in the trie in pre-order traversal order. - TrieDB
Node Double Ended Iterator - Various re-exports from the
trie-db
crate. Double ended iterator for going through all nodes in the trie in pre-order traversal order. - TrieDB
RawIterator - Various re-exports from the
trie-db
crate. Iterator for going through all nodes in the trie in pre-order traversal order. - Trie
Stream - The Substrate format implementation of
TrieStream
. Codec-flavored TrieStream.
Enums§
- Compact
Proof Error - Trie codec reexport, mainly child trie support for trie compact proof. Error for trie node decoding.
- Error
- Our
NodeCodec
-specific error. Error type used for trie related errors. - Merkle
Value - Either the
hash
orvalue
of a node depending on its size. - Node
Plan - Various re-exports from the
trie-db
crate. ANodePlan
is a blueprint for decoding a node from a byte slice. TheNodePlan
is created by parsing an encoded node and can be reused multiple times. This is useful as aNode
borrows from a byte slice and this struct does not. - Storage
Proof Error - Error associated with the
storage_proof
module. - Value
Plan - Various re-exports from the
trie-db
crate. Plan for value representation inNodePlan
. - Verify
Error - Errors that may occur during proof verification. Most of the errors types simply indicate that the proof is invalid with respect to the statement being verified, and the exact error type can be used for debugging.
Statics§
- EMPTY_
PREFIX - Various re-exports from the
hash-db
crate. An empty prefix constant. Can be use when the prefix is not use internally or for root nodes.
Traits§
- AsHashDB
- Reexport from
hash_db
, with genericity set forHasher
trait. - HashDBT
- Various re-exports from the
hash-db
crate. Trait modelling datastore keyed by a hash defined by theHasher
. - KeyFunction
- Various re-exports from the
memory-db
crate. - Proof
Size Provider - Type that is able to provide a proof size estimation.
- Query
- Various re-exports from the
trie-db
crate. Description of what kind of query will be made to the trie. - Trie
- Various re-exports from the
trie-db
crate. A key-value datastore implemented as a database-backed modified Merkle tree. - Trie
Cache - Various re-exports from the
trie-db
crate. A cache that can be used to speed-up certain operations when accessing the trie. - Trie
Configuration - Various re-exports from the
trie-db
crate. This trait associates a trie definition with preferred methods. It also contains own default implementations and can be used to allow switching implementation. - Trie
Layout - Various re-exports from the
trie-db
crate. Trait with definition of trie layout. Contains all associated trait needed for a trie definition or implementation. - TrieMut
- Various re-exports from the
trie-db
crate. A key-value datastore implemented as a database-backed modified Merkle tree. - Trie
Recorder - Various re-exports from the
trie-db
crate. A trie recorder that can be used to record all kind ofTrieAccess
’s. - Trie
Recorder Provider - Type that is able to provide a
trie_db::TrieRecorder
.
Functions§
- child_
delta_ trie_ root - Determine a child trie root given a hash DB and delta values. H is the default hasher, but a generic implementation may ignore this type parameter and use other hashers.
- child_
trie_ root - Determine a child trie root given its ordered contents, closed form. H is the default hasher, but a generic implementation may ignore this type parameter and use other hashers.
- decode_
compact - Trie codec reexport, mainly child trie support for trie compact proof. Decode a compact proof.
- delta_
trie_ root - Determine a trie root given a hash DB and delta values.
- empty_
child_ trie_ root - Determine the empty child trie root.
- empty_
trie_ root - Determine the empty trie root.
- encode_
compact - Trie codec reexport, mainly child trie support for trie compact proof. Encode a compact proof.
- generate_
trie_ proof - Create a proof for a subset of keys in a trie.
- prefixed_
key - Various re-exports from the
memory-db
crate. Derive a database key from hash value of the node (key) and the node prefix. - read_
child_ trie_ first_ descendant_ value - Read the
trie_db::MerkleValue
of the node that is the closest descendant for the provided child key. - read_
child_ trie_ hash - Read a hash from the child trie.
- read_
child_ trie_ value - Read a value from the child trie.
- read_
child_ trie_ value_ with - Read a value from the child trie with given query.
- read_
trie_ first_ descendant_ value - Read the
trie_db::MerkleValue
of the node that is the closest descendant for the provided key. - read_
trie_ value - Read a value from the trie.
- read_
trie_ value_ with - Read a value from the trie with given Query.
- verify_
trie_ proof - Verify a set of key-value pairs against a trie root and a proof.
Type Aliases§
- CError
- Various re-exports from the
trie-db
crate. Alias accessor toNodeCodec
associatedError
type from aTrieLayout
. - DBValue
- Various re-exports from the
trie-db
crate. Database value - Generic
MemoryDB - Reexport from
hash_db
, with genericity set forHasher
trait. - HashDB
- Reexport from
hash_db
, with genericity set forHasher
trait. - Lookup
- Querying interface, as in
trie_db
but less generic. - MemoryDB
- Reexport from
hash_db
, with genericity set forHasher
trait. This uses a noopsKeyFunction
(key addressing must be hashed or using an encoding scheme that avoid key conflict). - Prefixed
MemoryDB - Reexport from
hash_db
, with genericity set forHasher
trait. This uses aKeyFunction
for prefixing keys internally (avoiding key conflict for non random keys). - RawStorage
Proof - Raw storage proof type (just raw trie nodes).
- TrieDB
- Persistent trie database read-access interface for a given hasher.
- TrieDB
Builder - Builder for creating a
TrieDB
. - TrieDB
Mut - Persistent trie database write-access interface for a given hasher.
- TrieDB
MutBuilder - Builder for creating a
TrieDBMut
. - Trie
Error - TrieDB error over
TrieConfiguration
trait. - Trie
Hash - Hash type for a trie layout.