Expand description
Tetcore state machine implementation.
Re-exports§
pub use crate::backend::Backend;
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
- Logs a message at the trace level.
- warn
- Logs a message at the warn level.
Structs§
- Basic
Externalities - Simple Map-based Externalities impl.
- Changes
Trie Anchor Block Id - Block identifier that could be used to determine fork of this block.
- Changes
Trie Build Cache - Changes trie build cache.
- Changes
Trie Configuration Range - Blocks range where configuration has been constant.
- Changes
Trie State - Changes tries state at some block.
- Ext
- Wraps a read-only backend, call executor, and current overlayed changes.
- InMemory
Changes Trie Storage - In-memory implementation of changes trie storage.
- 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.
- Proving
Backend - Patricia trie-based backend which also tracks all touched storage trie values. These can be sent to remote node and used as a proof of execution.
- Proving
Backend Recorder - Patricia trie-based backend specialized in get value proofs.
- Read
Only Externalities - Simple read-only externalities for any backend.
- State
Machine - The tetcore 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.
- Storage
Transaction Cache - The storage transaction are calculated as part of the
storage_rootandchanges_trie_storage_root. These transactions can be reused for importing the block into the storage. So, we cache them to not require a recomputation of those transactions. - Test
Externalities - Simple HashMap-based Externalities impl.
- Trie
Backend - Patricia trie-based backend. Transaction type is an overlay of changes to commit.
- Usage
Info - Usage statistics for state backend.
- Usage
Unit - Measured count of operations and total bytes.
Enums§
- Backend
Trust Level - Storage backend trust level.
- Changes
Trie Cache Action - The action to perform when block-with-changes-trie is imported.
- Execution
Error - Externalities Error.
- Execution
Manager - Like
ExecutionStrategyonly it also stores a handler in case of consensus failure. - Execution
Strategy - Strategy for executing a call into the runtime.
Traits§
- Changes
Trie Block Number - Requirements for block number that can be used with changes tries.
- Changes
Trie Roots Storage - Changes trie storage. Provides access to trie roots and trie nodes.
- Changes
Trie Storage - Changes trie storage. Provides access to trie roots and trie nodes.
- 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.
- TrieMut
- A key-value datastore implemented as a database-backed modified Merkle tree.
Functions§
- create_
proof_ check_ backend - Create proof check backend.
- disabled_
changes_ trie_ state - Create state where changes tries are disabled.
- execution_
proof_ check - Check execution proof, generated by
prove_executioncall. - execution_
proof_ check_ on_ trie_ backend - Check execution proof on proving backend, generated by
prove_executioncall. - key_
changes - Return changes of given key at given blocks range.
maxis the number of best known block. Changes are returned in descending order (i.e. last block comes first). - key_
changes_ proof - Returns proof of changes of given key at given blocks range.
maxis the number of best known block. - key_
changes_ proof_ check - Check key changes proof and return changes of the key at given blocks range.
maxis the number of best known block. Changes are returned in descending order (i.e. last block comes first). - key_
changes_ proof_ check_ with_ db - Similar to the
key_changes_proof_checkfunction, but works with prepared proof storage. - native_
else_ wasm - Evaluate to ExecutionManager::NativeElseWasm, without having to figure out the type.
- 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_
read - Generate storage read proof.
- prove_
read_ on_ trie_ backend - Generate storage read proof on pre-created trie backend.
- prune_
changes_ tries - Prune obsolete changes tries. Pruning happens at the same block, where highest
level digest is created. Pruning guarantees to save changes tries for last
min_blocks_to_keepblocks. We only prune changes tries atmax_digest_intervalranges. - read_
child_ proof_ check - Check child storage read proof, generated by
prove_child_readcall. - 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_readcall. - read_
proof_ check_ on_ proving_ backend - Check storage read proof on pre-created proving backend.
Type Aliases§
- Changes
Trie Transaction - Type of changes trie transaction.
- 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.
- Layout
- MemoryDB
- Reexport from
hash_db, with genericity set forHashertrait. 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.
- Proof
Recorder - Global proof recorder, act as a layer over a hash db for recording queried data.
- Storage
Collection - In memory array of storage values.
- Storage
Key - Storage key.
- Storage
Value - Storage value.
- TrieDB
Mut - Persistent trie database write-access interface for the a given hasher.