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 two 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.
GasLimit
Gas limits.
LazyCache
Lazily cache expensive to compute values.
Memory
Memory for temporary storage of words.
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.
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.
StateReads
Pre and post sync state reads.

Type Aliases§

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