Expand description
Substrate state machine implementation.
Re-exports§
pub use crate::backend::Backend;
pub use crate::backend::BackendTransaction;
pub use crate::backend::IterArgs;
pub use crate::backend::KeysIter;
pub use crate::backend::PairsIter;
pub use crate::backend::StorageIterator;
Modules§
- backend
- State machine backends. These manage the code and storage of contracts.
Macros§
- debug
- Logs a message at the debug level.
- log_
error - Logs a message at the error level.
- trace
- Constructs an event at the trace level.
- warn
- Logs a message at the warn level.
Structs§
- Basic
Externalities - Simple Map-based Externalities impl.
- Compact
Proof - Storage proof in compact form.
- Ext
- Wraps a read-only backend, call executor, and current overlayed changes.
- KeyValue
States - Multiple key value state. States are ordered by root storage key.
- KeyValue
Storage Level - A key value state at any storage level.
- Layout
V0 - substrate trie layout
- Layout
V1 - substrate trie layout, with external value nodes.
- Offchain
Overlayed Changes - In-memory storage for offchain workers recoding changes for the actual offchain storage implementation.
- Overlayed
Changes - The set of changes that are overlaid onto the backend.
- Read
Only Externalities - Simple read-only externalities for any backend.
- State
Machine - The substrate state machine.
- State
Machine Stats - Accumulated usage statistics specific to state machine crate.
- Storage
Changes - A storage changes structure that can be generated by the data collected in
OverlayedChanges
. - 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.
- Test
Externalities - Simple HashMap-based Externalities impl.
- Trie
Backend - Patricia trie-based backend. Transaction type is an overlay of changes to commit.
- Trie
Backend Builder - Builder for creating a
TrieBackend
. - Usage
Info - Usage statistics for state backend.
- Usage
Unit - Measured count of operations and total bytes.
Enums§
- Backend
Trust Level - Storage backend trust level.
- Execution
Error - Externalities Error.
- Index
Operation - Transaction index operation.
Constants§
- MAX_
NESTED_ TRIE_ DEPTH - State machine only allows a single level of child trie.
Traits§
- Error
- State Machine Error bound.
- Inspect
State - Trait for inspecting state in any backend.
- Storage
- Patricia trie-based storage trait.
- Trie
Backend Storage - Key-value pairs storage that is used by trie backend essence.
- Trie
Cache Provider - A provider of trie caches that are compatible with
trie_db::TrieDB
. - TrieMut
- A key-value datastore implemented as a database-backed modified Merkle tree.
Functions§
- create_
proof_ check_ backend - Create a backend used for checking the proof, using
H
as hasher. - execution_
proof_ check - Check execution proof, generated by
prove_execution
call. - execution_
proof_ check_ on_ trie_ backend - Check execution proof on proving backend, generated by
prove_execution
call. - new_
in_ mem - Create a new empty instance of in-memory backend.
- prove_
child_ read - Generate child storage read proof.
- prove_
child_ read_ on_ trie_ backend - Generate storage read proof on pre-created trie backend.
- prove_
execution - Prove execution using the given state backend, overlayed changes, and call executor.
- prove_
execution_ on_ trie_ backend - Prove execution using the given trie backend, overlayed changes, and call executor. Produces a state-backend-specific “transaction” which can be used to apply the changes to the backing store, such as the disk. Execution proof is the set of all ‘touched’ storage DBValues from the backend.
- prove_
range_ read_ with_ child_ with_ size - Generate range storage read proof, with child tries
content.
A size limit is applied to the proof with the
exception that
start_at
and its following element are always part of the proof. If a key different thanstart_at
is a child trie root, the child trie content will be included in the proof. - prove_
range_ read_ with_ child_ with_ size_ on_ trie_ backend - Generate range storage read proof, with child tries
content.
See
prove_range_read_with_child_with_size
. - prove_
range_ read_ with_ size - Generate range storage read proof.
- prove_
range_ read_ with_ size_ on_ trie_ backend - Generate range storage read proof on an existing trie backend.
- prove_
read - Generate storage read proof.
- prove_
read_ on_ trie_ backend - Generate storage read proof on pre-created trie backend.
- read_
child_ proof_ check - Check child storage read proof, generated by
prove_child_read
call. - read_
child_ proof_ check_ on_ proving_ backend - Check child storage read proof on pre-created proving backend.
- read_
proof_ check - Check storage read proof, generated by
prove_read
call. - read_
proof_ check_ on_ proving_ backend - Check storage read proof on pre-created proving backend.
- read_
range_ proof_ check - Check child storage range proof, generated by
prove_range_read_with_size
call. - read_
range_ proof_ check_ on_ proving_ backend - Check storage range proof on pre-created proving backend.
- read_
range_ proof_ check_ with_ child - Check storage range proof with child trie included, generated by
prove_range_read_with_child_with_size
call. - read_
range_ proof_ check_ with_ child_ on_ proving_ backend - Check storage range proof on pre-created proving backend.
Type Aliases§
- Child
Storage Collection - In memory arrays of storage values for multiple child tries.
- DBValue
- Database value
- Default
Error - Default error type to use with state machine trie backend.
- Default
Handler - Default handler of the execution manager.
- InMemory
Backend - Trie backend with in-memory storage.
- 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). - Offchain
Changes Collection - In memory array of storage values.
- Storage
Collection - In memory array of storage values.
- Storage
Key - Storage key.
- Storage
Value - Storage value.
- TrieDB
MutV0 - Persistent trie database write-access interface for a given hasher.
- TrieDB
MutV1 - Persistent trie database write-access interface for a given hasher.