Skip to main content

Module vm_decode

Module vm_decode 

Source
Expand description

Decode IR vm-ops JSON into ledger Op<ResultModeGather, InMemoryDB>.

Each vm-op JSON object is one VM instruction the on-chain runtime consumes (push, idx, addi, ins, …). The IR emitter pre-expands the recipe so consumers see concrete ops, but argument values can still reference runtime-evaluated expressions via {"vm": "ref", "type": <descriptor>, "value": <expression>}. The decoder resolves those refs against the current scope before constructing the typed Op.

Structs§

CompiledLedgerQuery
Pre-compiled ledger VM query for a vm-ops instruction list, paired with conservative static QueryFlags for lazy context/effects/state handling.
EvalScope
Evaluation scope passed to the vm-op decoder so vm: ref refs can resolve to concrete values.
QueryFlags
Static summary of which VM stack slots a ledger query may touch.

Enums§

CompiledAlignedValue
CompiledIntArg
CompiledOp
One pre-compiled VM instruction inside a CompiledLedgerQuery.
CompiledPathKey
CompiledQueryBody
Instruction payload of a CompiledLedgerQuery.
CompiledRefExpr
CompiledStateValue

Functions§

analyze_compiled_ops
Conservatively analyze a compiled dynamic VM-op slice for context/effects/state access.
analyze_ops
Conservatively analyze a concrete VM-op slice for context/effects/state access.
compile_vm_ops
Pre-compile a slice of raw IR VmInstr objects into a CompiledLedgerQuery.
decode_int_arg
Decode a value that should resolve to an integer. Handles raw JSON numbers, {vm: align, value, bytes} literal-aligned values, and {vm: value->int, value: <ref-or-align>} runtime helpers.
decode_op
Decode one vm-instr into a typed Op<ResultModeGather, InMemoryDB>.
decode_state_value
Decode a vm: state-value object into a ledger StateValue.