Expand description
§storage implements the storage of a Node on top of a LinearStore
Nodes are stored at a LinearAddress within a ReadableStorage.
The NodeStore maintains a free list and the LinearAddress of a root node.
A NodeStore is backed by a ReadableStorage which is persisted storage.
Modules§
- logger
- Logger module for handling logging functionality
- macros
- Macros module for defining macros used in the storage module
- registry
- Metrics registry for storage layer metrics Storage layer metric definitions.
Macros§
- noop
- A noop logger, when the logger feature is disabled
Structs§
- Area
Index - The type that uniquely identifies a valid area size. This is not usize because we store this as a single byte
- Branch
Node - A branch node
- Check
Opt - Options for the checker
- Checker
Report - Report of the checker results.
- Children
- Type alias for a collection of children in a branch node.
- Committed
- A committed revision of a merkle trie.
- DBStats
- All statistics about the given database image
- Duplicate
KeyError - A duplicate key error when merging two key-value tries.
- File
Backed - A
ReadableStorageandWritableStoragebacked by a file - File
IoError - An error that occurs when reading or writing to a
ReadableStorageorWritableStorage - Free
Lists Stats - Statistics about the free list
- Hashable
Shunt - A shunt for a hasheable trie that we can use to compute the hash of a node using component parts.
- Hashed
KeyValue Trie Root - The root of a hashed key-value trie.
- Immutable
Proposal - Contains state for a proposed revision of the trie.
- Invalid
Trie Hash Length - An error that occurs when trying to convert a slice to a
TrieHash - Iter
Ascending - A marker type for
TrieEdgeIterthat indicates that the iterator traverses the trie in ascending order. - Iter
Descending - A marker type for
TrieEdgeIterthat indicates that the iterator traverses the trie in descending order. - Joined
Path - Joins two path segments into a single path, retaining the original segments without needing to allocate a new contiguous array.
- KeyValue
Trie Root - The root of a key-value trie.
- Leaf
Node - A leaf node
- Linear
Address - A linear address in the nodestore storage.
- Maybe
Persisted Node - A node that is either in memory or on disk.
- MemStore
- An in-memory impelementation of
WritableStorageandReadableStorage - Mutable
- Contains the state of a nodestore that is still being modified.
- Nibbles
Iterator - Iterates over the nibbles in
data. That is, each byte indatais converted to two nibbles. - Node
Hash Algorithm TryFrom IntError - An error indicating that an integer could not be converted into a
NodeHashAlgorithm. - Node
Store - Contains the state of a revision of a merkle trie.
- Node
Store Header - Persisted metadata for a
NodeStore. TheNodeStoreHeaderis at the start of theReadableStorage. - Packed
Bytes - An iterator over the components of a path that yields them packed into bytes.
- Packed
Path Components - An iterator over the components of a
PackedPathRef. - Packed
Path Ref - A packed representation of a trie path where each byte encodes two path components.
- Path
- Path is part or all of a node’s path in the trie. Each element is a nibble.
- Path
Common Prefix - The common prefix of two paths, along with their respective suffixes.
- Path
Component - A path component in a hexary trie; which is only 4 bits (aka a nibble).
- Path
Guard - A RAII guard that resets a path buffer to its original length when dropped.
- Path
Iter Item - A path iterator item, which has the key nibbles up to this point, a node, the address of the node, and the nibble that points to the next child down the list
- Propose
- Proposal-specific fields for a mutable nodestore.
- Recon
- Reconstruction-specific marker for a mutable nodestore. Zero-size: no delete list and no parent are needed for linear reconstruction chains.
- Reconstructed
- Contains state for a reconstructed revision of the trie. These are unparented, and only contain an in-memory root.
- Root
Store - This structure holds everything related to an open root store
- Trie
Edge Iter - An iterator over the edges in a key-value trie in a specified order.
- Trie
Hash - A hash value inside a merkle trie We use the same type as returned by sha2 here to avoid copies
- Trie
Stats - Statistics about the trie
- Trie
Value Iter - An iterator over the key-value pairs in a key-value trie.
- TryFrom
IntError - An error similar to
std::num::TryFromIntErrorbut able to be created within our crate. - U4
- A 4-bit unsigned integer representing a hexary digit (0-15, inclusive) used as a path component in hexary tries.
Enums§
- Cache
Read Strategy - The strategy for caching nodes that are read from the storage layer. Generally, we only want to cache write operations, but for some read-heavy workloads you can enable caching of branch reads or all reads.
- Checker
Error - Errors returned by the checker
- Child
- A child of a branch node.
- Free
List Parent - This enum encapsulates what points to the stored area allocated for a free list.
- Node
- A node, either a Branch or Leaf
- Node
Hash Algorithm - The hash algorithm used by the node store.
- Partial
Path - A trie path represented as a slice of path components, either borrowed or owned.
- Stored
Area Parent - This enum encapsulates what points to the stored area.
- Trie
Edge State - The state of an edge from a parent node to a child node in a trie.
- Trie
Node Parent - This enum encapsulates what points to the stored area allocated for a trie node.
- Value
Digest - A
ValueDigestis either a node’s value or the hash of its value.
Traits§
- Hashable
- A node in the trie that can be hashed.
- Hashed
Node Reader - Reads from an immutable (i.e. already hashed) merkle trie.
- Hashed
Trie Node - A merkleized node in a fixed-arity radix trie.
- Into
Hash Type - A trait to convert a value into a
HashType. - Into
Split Path - A type that can be converted into a splittable path.
- Mutable
Kind - Behaviour that differs between proposal and reconstruction mutable nodestores.
- Node
Reader - Reads nodes from a merkle trie.
- Parentable
- Some nodestore kinds implement Parentable.
- Path
Component Slice Ext - Extension methods for slices of path components.
- Preimage
- A preimage of a hash.
- Readable
Storage - Trait for readable storage.
- Reconstruction
Source - Marker trait for nodestore states that can serve as the source for reconstruction.
- Root
Reader - Reads the root of a merkle trie.
- Split
Path - A trie path that can be (cheaply) split into two sub-paths.
- Trie
Node - A node in a fixed-arity radix trie.
- Trie
Path - A trie path of components with different underlying representations.
- Trie
Path AsPacked Bytes - Converts this path to an iterator over its packed bytes.
- Trie
Path From Packed Bytes - Constructor for a trie path from a set of packed bytes; where each byte contains as many path components as possible.
- Trie
Path From Unpacked Bytes - Constructor for a trie path from a set of unpacked bytes; where each byte is a whole path component regardless of the normal width of a path component.
- Trie
Reader - Reads nodes and the root address from a merkle trie.
- Writable
Storage - Trait for writable storage.
Functions§
- hash_
node - Returns the hash of
node, which is at the givenpath_prefix. - hash_
preimage - Returns the serialized representation of
nodeused as the pre-image when hashing the node. The node is at the givenpath_prefix.
Type Aliases§
- Children
Slots - Type alias for an iterator over the slots of a branch node’s children
with its corresponding
PathComponent. - Component
Iter - An iterator over path components.
- Hash
Type - The type of a hash. For non-ethereum compatible hashes, this is always a
TrieHash. - PathBuf
- An owned buffer of path components.
- Shared
Node - A shared node, which is just a triophe Arc of a node