Expand description
Ledger’s state storage with key-value backed store and a merkle tree
Re-exports§
pub use namada_merkle_tree as merkle_tree;
pub use namada_storage as storage;
Modules§
- collections
- Lazy data structures for storage access where elements are not all loaded into memory.
- ics23_
specs - A module that contains
- mockdb
- DB mock for testing
- prefix_
iter - The storage prefix iterators can be used to iterate over a common prefix of storage keys.
- tx_
queue - Transaction queue
- write_
log - Write log is temporary storage for modifications performed by a transaction. before they are committed to the ledger’s storage.
Macros§
- impl_
storage_ read - Implement [
trait StorageRead
] using its [trait StateRead
] implementation. - impl_
storage_ write - Implement [
trait StorageWrite
] using its [trait State
] implementation.
Structs§
- Block
Hash - Hash of a block as fixed-size byte array
- Block
Header - The block header data from Tendermint header relevant for Namada storage
- Block
Height - Height of a block, i.e. the level. The
default
is theBlockHeight::sentinel
value, which doesn’t correspond to any block. - Block
Results - Represents the indices of the accepted transactions in a block.
- Block
State Read - The block’s state as stored in the database.
- Block
State Write - The block’s state to write into the database.
- Block
Storage - The block storage data
- Conversion
Leaf - A representation of a leaf in the conversion tree
- Conversion
State - A representation of the conversion state
- Epoch
- Epoch identifier. Epochs are identified by consecutive numbers.
- Epochs
- Predecessor block epochs
- EthEvents
Queue - Container of all Ethereum event queues.
- Full
Access State - Owned state with full R/W access.
- InMemory
- The ledger’s state
- Key
- A storage key is made of storage key segments
DbKeySeg
, separated byKEY_SEGMENT_SEPARATOR
. - Last
Block - Last committed block
- Merkle
Tree - Merkle tree storage
- Merkle
Tree Stores Read - The root and store pairs to restore the trees
- Merkle
Tree Stores Write - The root and store pairs to be persistent
- Pattern
Iterator - Storage prefix iterator generic wrapper type.
- Prefix
Iter - Prefix iterator for
StorageRead
implementations. - Prefix
Iterator - Storage prefix iterator generic wrapper type.
- Sha256
Hasher - The storage hasher used for the merkle tree.
- Temp
WlState - State with a temporary write log. This is used for dry-running txs and ABCI prepare and processs proposal, which must not modify the actual state.
- TxHost
EnvState - State with mutable write log and gas metering for tx host env.
- TxIndex
- Transaction index within block.
- VpHost
EnvState - Read-only state with gas metering for VP host env.
- WlState
- State with a write-logged storage.
Enums§
- DbError
- Error
- Membership
Proof - Type of membership proof from a merkle tree
- Process
Proposal Cached Result - The result of process proposal that can be cached for future lookup
- State
Error - Store
Ref - Pointer to backing storage of merkle tree
- Store
Type - Store types for the merkle tree
Constants§
- BLOCK_
HASH_ LENGTH - The length of the block hash
- BLOCK_
HEIGHT_ LENGTH - The length of the block height
- EPOCH_
SWITCH_ BLOCKS_ DELAY - We delay epoch change 2 blocks to keep it in sync with Tendermint, because it has 2 blocks delay on validator set update.
- EPOCH_
TYPE_ LENGTH - The length of the epoch type
Traits§
- DB
- A database backend.
- DBIter
- A database prefix iterator.
- DBWrite
Batch - Atomic batch write.
- KeySeg
- Represents a segment in a path that may be used as a database key
- Option
Ext - An extension to
Option
to allow turningNone
case to an Error from a static string (handy for WASM). - Read
Conversion State - Able to borrow conversion state.
- Result
Ext - Result extension to easily wrap custom errors into
Error
. - State
- Common trait for write log, DB and in-memory state.
- State
Read - Common trait for read-only access to write log, DB and in-memory state.
- Storage
Hasher - The storage hasher used for the merkle tree.
- Storage
Read - Common storage read interface
- Storage
Write - Common storage write interface
- TxWrites
- Perform storage writes and deletions to write-log at tx level.
- With
Conversion State - Able to borrow mutable conversion state.
Functions§
- iter_
prefix - Iterate Borsh encoded items matching the given prefix, ordered by the storage keys.
- iter_
prefix_ bytes - Iterate items matching the given prefix, ordered by the storage keys.
- iter_
prefix_ post - Iterate write-log storage items posterior to a tx execution, matching the given prefix. Returns the iterator and gas cost.
- iter_
prefix_ pre - Iterate write-log storage items prior to a tx execution, matching the given prefix. Returns the iterator and gas cost.
- iter_
prefix_ with_ filter - Iterate Borsh encoded items matching the given prefix and passing the given
filter
predicate, ordered by the storage keys. - iter_
prefix_ with_ filter_ map - Iterate Borsh encoded items matching the given prefix and passing the given
filter
predicate, ordered by the storage keys.