pub enum OpCode {
Show 36 variants
AbortIfNullKey {
key: Register,
is_account_event: bool,
},
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,
},
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,
},
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,
},
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.
LoadEventField
LoadConstant
CopyRegister
CopyRegisterIfNull
Copy from source to dest only if dest is currently null
GetEventType
CreateObject
SetField
SetFields
GetField
ReadOrInitState
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
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
SegmentBoundary
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.