pub enum OpCode {
Show 40 variants
AbortIfNullKey {
key: Register,
is_account_event: bool,
},
EvaluateEventExpr {
expr: ComputedExpr,
transform: Option<Transformation>,
dest: Register,
},
LoadEventField {
path: FieldPath,
dest: Register,
default: Option<Value>,
},
LoadConstant {
value: Value,
dest: Register,
},
CopyRegister {
source: Register,
dest: Register,
},
CopyRegisterIfNull {
source: Register,
dest: Register,
},
GetEventType {
dest: Register,
},
CreateObject {
dest: Register,
},
SetField {
object: Register,
path: String,
value: Register,
},
SetFields {
object: Register,
fields: Vec<(String, Register)>,
},
GetField {
object: Register,
path: String,
dest: Register,
},
ReadOrInitState {
state_id: u32,
key: Register,
default: Value,
dest: Register,
dedup_route: Option<String>,
},
UpdateState {
state_id: u32,
key: Register,
value: Register,
},
AppendToArray {
object: Register,
path: String,
value: Register,
},
GetCurrentTimestamp {
dest: Register,
},
CreateEvent {
dest: Register,
event_value: Register,
},
CreateCapture {
dest: Register,
capture_value: Register,
},
Transform {
source: Register,
dest: Register,
transformation: Transformation,
},
EmitMutation {
entity_name: String,
key: Register,
state: Register,
},
SetFieldIfNull {
object: Register,
path: String,
value: Register,
},
SetFieldMax {
object: Register,
path: String,
value: Register,
},
UpdateTemporalIndex {
state_id: u32,
index_name: String,
lookup_value: Register,
primary_key: Register,
timestamp: Register,
},
LookupTemporalIndex {
state_id: u32,
index_name: String,
lookup_value: Register,
timestamp: Register,
dest: Register,
},
UpdateLookupIndex {
state_id: u32,
index_name: String,
lookup_value: Register,
primary_key: Register,
},
LookupIndex {
state_id: u32,
index_name: String,
lookup_value: Register,
dest: Register,
strict: bool,
},
SetFieldSum {
object: Register,
path: String,
value: Register,
},
SetFieldIncrement {
object: Register,
path: String,
},
SetFieldMin {
object: Register,
path: String,
value: Register,
},
SetFieldWhen {
object: Register,
path: String,
value: Register,
when_instruction: String,
entity_name: String,
key_reg: Register,
condition_field: Option<FieldPath>,
condition_op: Option<ComparisonOp>,
condition_value: Option<Value>,
},
SetFieldUnlessStopped {
object: Register,
path: String,
value: Register,
stop_field: String,
stop_instruction: String,
entity_name: String,
key_reg: Register,
},
AddToUniqueSet {
state_id: u32,
set_name: String,
value: Register,
count_object: Register,
count_path: String,
},
ConditionalSetField {
object: Register,
path: String,
value: Register,
condition_field: FieldPath,
condition_op: ComparisonOp,
condition_value: Value,
},
ConditionalIncrement {
object: Register,
path: String,
condition_field: FieldPath,
condition_op: ComparisonOp,
condition_value: Value,
},
EvaluateComputedFields {
state: Register,
computed_paths: Vec<String>,
},
QueueResolver {
state_id: u32,
entity_name: String,
resolver: ResolverType,
input_path: Option<String>,
input_value: Option<Value>,
url_template: Option<Vec<UrlTemplatePart>>,
strategy: ResolveStrategy,
extracts: Vec<ResolverExtractSpec>,
condition: Option<ResolverCondition>,
schedule_at: Option<String>,
state: Register,
key: Register,
},
UpdatePdaReverseLookup {
state_id: u32,
lookup_name: String,
pda_address: Register,
primary_key: Register,
},
SkipUnless {
predicate: Register,
count: usize,
},
CaptureSibling {
state_id: u32,
paths: Vec<FieldPath>,
},
RegisterPdaFromSibling {
state_id: u32,
lookup_name: String,
sibling: SiblingSelector,
pda_field: FieldPath,
seed_field: FieldPath,
pda_address: Register,
primary_key: Register,
},
SegmentBoundary,
}Variants§
AbortIfNullKey
Abort the handler with empty mutations when the key register is null and the event is an account-state update (not IxState / CpiEvent). Placed immediately after key resolution so that downstream opcodes (index updates, field mappings, resolvers, emit) never execute with a garbage key. The null-key event is then eligible for queueing by process_event’s miss-handling logic.
EvaluateEventExpr
Evaluate an expression against the event into dest; null when the
expression fails. transform applies to a non-null result only, so a
null key stays null.
LoadEventField
LoadConstant
CopyRegister
CopyRegisterIfNull
Copy from source to dest only if dest is currently null
GetEventType
CreateObject
SetField
SetFields
GetField
ReadOrInitState
Fields
dedup_route: Option<String>The declared route (lookup index) of this handler. A duplicate
instruction is detected per route when set, so a second route of
the same instruction to the same row is not skipped. None for
every handler without a declared lookup, which keeps the
row-and-event-type deduplication.
UpdateState
AppendToArray
GetCurrentTimestamp
Load the Unix-seconds timestamp of the update being processed (its
UpdateContext timestamp, else the wall clock). It is the update’s
time, not the processing time, so a replay reproduces it.
CreateEvent
Wrap an event as {timestamp, data, slot?, signature?, event_index?, ix_path?}, stamped with the update’s timestamp.
CreateCapture
Wrap a captured account as {timestamp, account_address, data, slot?, signature?}, stamped with the update’s timestamp.
Transform
EmitMutation
SetFieldIfNull
SetFieldMax
UpdateTemporalIndex
Fields
LookupTemporalIndex
UpdateLookupIndex
LookupIndex
Fields
SetFieldSum
Sum a numeric value to a field (accumulator)
SetFieldIncrement
Increment a counter field by 1
SetFieldMin
Set field to minimum value
SetFieldWhen
Set field only if a specific instruction type was seen in the same transaction. If not seen yet, defers the operation for later completion.
Fields
condition_op: Option<ComparisonOp>SetFieldUnlessStopped
Set field unless stopped by a specific instruction. Stop is tracked by a per-entity stop flag.
Fields
AddToUniqueSet
Add value to unique set and update count Maintains internal Set, field stores count
ConditionalSetField
Conditionally set a field based on a comparison
Fields
condition_op: ComparisonOpConditionalIncrement
Conditionally increment a field based on a comparison
Fields
condition_op: ComparisonOpEvaluateComputedFields
Evaluate computed fields (calls external hook if provided) computed_paths: List of paths that will be computed (for dirty tracking)
QueueResolver
Queue a resolver for asynchronous enrichment
Fields
resolver: ResolverTypeurl_template: Option<Vec<UrlTemplatePart>>strategy: ResolveStrategyextracts: Vec<ResolverExtractSpec>condition: Option<ResolverCondition>UpdatePdaReverseLookup
Update PDA reverse lookup table Maps a PDA address to its primary key for reverse lookups
SkipUnless
Skip the next count opcodes unless predicate holds exactly true.
Emitted only for write-gating guards (ParsedCondition::Guard): the
guard is evaluated into predicate and the guarded mapping’s opcodes
follow, so a false, null or failed guard leaves the row untouched.
CaptureSibling
Remember the fields paths of this instruction for the transaction’s
sibling registrations, then complete the registrations waiting for an
instruction of this type (see SiblingSelector).
RegisterPdaFromSibling
Register PDA mappings read partly or wholly from sibling instructions
of sibling.instruction_type in the same transaction. The fields read
from this instruction are in pda_address / primary_key; the ones
read from a sibling are paths. Siblings that have not arrived yet are
registered when they do.
Fields
sibling: SiblingSelectorSegmentBoundary
Separates independently keyed handler segments for one event type.
When one event updates the same entity through different keys (for
example split_position touching both its first_position and its
second_position), each key gets its own segment: its own key loading,
state read, mappings, state write and mutation. The VM runs segments in
order and isolates them, so an early exit in one segment never skips
another. Handlers with a single key never contain a boundary.