Expand description
The essential state read VM implementation.
§Reading State
The primary entrypoint for this crate is the Vm type.
The Vm allows for executing operations that read state and apply any
necessary operations in order to form the final, expected state slot layout
within the VM’s [Memory]. The Vm’s memory can be accessed directly
from the Vm, or the Vm can be consumed and state slots returned with
Vm::into_state_slots.
§Executing Ops
There are three primary methods available for executing operations:
Each have slightly different performance implications, so be sure to read the docs before selecting a method.
§Execution Future
The Vm::exec_* functions all return Futures that not only yield on
async operations, but yield based on a user-specified gas limit too. See the
ExecFuture docs for further details on the implementation.
Re-exports§
pub use essential_types as types;
Modules§
- asm
- Assembly for state read operations.
- constraint
- The essential constraint checking implementation.
- error
- The types of errors that might occur throughout state read execution.
Structs§
- Access
- All necessary solution data and state access required to check an individual predicate.
- Exec
Future - A future that when polled attempts to make progress on VM execution.
- GasLimit
- Gas limits.
- Solution
Access - All necessary solution data access required to check an individual predicate.
- Stack
- The VM’s
Stack, i.e. aVecofWords updated during each step of execution. - State
Memory - A type representing the VM’s mutable state slots.
- State
Slots - The pre and post mutation state slot values for the predicate being solved.
- Vm
- The operation execution state of the State Read VM.
Traits§
- OpAccess
- Types that provide access to operations.
- OpGas
Cost - A mapping from an operation to its gas cost.
- State
Read - Access to state required by the state read VM.
Type Aliases§
- Bytecode
Mapped - Shorthand for the
BytecodeMappedtype representing a mapping to/from state readOps. - Bytecode
Mapped Lazy - Shorthand for the
BytecodeMappedLazytype for mappingOps. - Bytecode
Mapped Slice - Shorthand for the
BytecodeMappedSlicetype for mappingOps. - Gas
- Unit used to measure gas.
- OpAsync
Result - Shorthand for a
Resultwhere the error type is anOpAsyncError. - OpResult
- Shorthand for a
Resultwhere the error type is anOpError. - OpSync
Result - Shorthand for a
Resultwhere the error type is anOpSyncError. - State
Memory Result - Shorthand for a
Resultwhere the error type is aStateMemoryError. - State
Read Result - Shorthand for a
Resultwhere the error type is aStateReadError. - State
Slot Slice - The state slots declared within the predicate.