Crate essential_vm

Source
Expand description

The essential VM implementation.

§Reading State

The primary entrypoint for this crate is the Vm type.

The Vm allows for executing arbitrary essential ASM ops. The primary use-case is executing Programs that make up a Predicate’s program graph during Solution validation.

§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 the Essential VM.
bytecode
Items related to bytecode representation for the VM assembly.
error
The types of errors that might occur throughout execution.
sync
Items related to stepping forward VM execution by synchronous operations.

Structs§

Access
All necessary solution access required to check an individual predicate.
ExecFuture
A future that when polled attempts to make progress on VM execution.
GasLimit
Gas limits.
LazyCache
Lazily cache expensive to compute values.
Memory
Memory for temporary storage of words.
OpAsync
The set of operations that are performed asynchronously.
Repeat
A stack of repeat counters.
Stack
The VM’s Stack, i.e. a Vec of Words updated during each step of execution.
Vm
The operation execution state of the VM.

Enums§

Op
All operations available to the Essential VM execution.
OpSync
The set of operations that are performed synchronously.
ProgramControlFlow
Update the program to a new position or halt it.

Traits§

OpAccess
Types that provide access to operations.
OpGasCost
A mapping from an operation to its gas cost.
StateRead
Read-only access to state required by the VM.

Functions§

mut_keys
A helper for collecting all mutable keys that are proposed for mutation for the predicate at the given index.
mut_keys_set
Get the contract of mutable keys for this predicate.
mut_keys_slices
Get the mutable keys as slices

Type Aliases§

BytecodeMapped
Shorthand for the BytecodeMapped type representing a mapping to/from Ops.
BytecodeMappedLazy
Shorthand for the BytecodeMappedLazy type for mapping Ops.
BytecodeMappedSlice
Shorthand for the BytecodeMappedSlice type for mapping Ops.
Gas
Unit used to measure gas.