pub struct StateTable {
pub data: DashMap<Value, Value>,
pub lookup_indexes: HashMap<String, LookupIndex>,
pub temporal_indexes: HashMap<String, TemporalIndex>,
pub pda_reverse_lookups: HashMap<String, PdaReverseLookup>,
pub pending_updates: DashMap<String, Vec<PendingAccountUpdate>>,
pub pending_instruction_events: DashMap<String, Vec<PendingInstructionEvent>>,
pub last_account_data: DashMap<String, PendingAccountUpdate>,
pub recent_tx_instructions: Mutex<LruCache<String, HashSet<String>>>,
pub deferred_when_ops: DashMap<(String, String), Vec<DeferredWhenOperation>>,
/* private fields */
}Fields§
§data: DashMap<Value, Value>§lookup_indexes: HashMap<String, LookupIndex>§temporal_indexes: HashMap<String, TemporalIndex>§pda_reverse_lookups: HashMap<String, PdaReverseLookup>§pending_updates: DashMap<String, Vec<PendingAccountUpdate>>§pending_instruction_events: DashMap<String, Vec<PendingInstructionEvent>>§last_account_data: DashMap<String, PendingAccountUpdate>Cache of the most recent account data per PDA address. When a PDA mapping changes (same PDA, different seed) the cached data is returned for reprocessing so cross-account Lookup handlers resolve to the new key.
recent_tx_instructions: Mutex<LruCache<String, HashSet<String>>>§deferred_when_ops: DashMap<(String, String), Vec<DeferredWhenOperation>>Implementations§
Source§impl StateTable
impl StateTable
pub fn is_at_capacity(&self) -> bool
pub fn entries_over_limit(&self) -> usize
pub fn max_array_length(&self) -> usize
pub fn insert_with_eviction(&self, key: Value, value: Value)
pub fn get_and_touch(&self, key: &Value) -> Option<Value>
Sourcepub fn is_fresh_update(
&self,
primary_key: &Value,
event_type: &str,
slot: u64,
ordering_value: u64,
) -> bool
pub fn is_fresh_update( &self, primary_key: &Value, event_type: &str, slot: u64, ordering_value: u64, ) -> bool
Check if an update is fresh and update the version tracker. Returns true if the update should be processed (is fresh). Returns false if the update is stale and should be skipped.
Comparison is lexicographic on (slot, ordering_value): (100, 5) > (100, 3) > (99, 999)
Sourcepub fn is_duplicate_instruction(
&self,
primary_key: &Value,
event_type: &str,
slot: u64,
txn_index: u64,
) -> bool
pub fn is_duplicate_instruction( &self, primary_key: &Value, event_type: &str, slot: u64, txn_index: u64, ) -> bool
Check if an instruction is a duplicate of one we’ve seen recently. Returns true if this exact instruction has been seen before (is a duplicate). Returns false if this is a new instruction that should be processed.
Unlike account updates, instructions don’t use recency checks - all unique instructions are processed. Only exact duplicates are skipped. Uses a smaller cache capacity for shorter effective TTL.