TransactionCacheRead

Trait TransactionCacheRead 

Source
pub trait TransactionCacheRead: Send + Sync {
Show 17 methods // Required methods fn multi_get_transaction_blocks( &self, digests: &[TransactionDigest], ) -> Vec<Option<Arc<VerifiedTransaction>>>; fn multi_get_executed_effects_digests( &self, digests: &[TransactionDigest], ) -> Vec<Option<TransactionEffectsDigest>>; fn transaction_executed_in_last_epoch( &self, digest: &TransactionDigest, current_epoch: EpochId, ) -> bool; fn multi_get_effects( &self, digests: &[TransactionEffectsDigest], ) -> Vec<Option<TransactionEffects>>; fn multi_get_events( &self, digests: &[TransactionDigest], ) -> Vec<Option<TransactionEvents>>; fn get_unchanged_loaded_runtime_objects( &self, digest: &TransactionDigest, ) -> Option<Vec<ObjectKey>>; fn take_accumulator_events( &self, digest: &TransactionDigest, ) -> Option<Vec<AccumulatorEvent>>; fn notify_read_executed_effects_digests<'a>( &'a self, task_name: &'static str, digests: &'a [TransactionDigest], ) -> BoxFuture<'a, Vec<TransactionEffectsDigest>>; // Provided methods fn get_transaction_block( &self, digest: &TransactionDigest, ) -> Option<Arc<VerifiedTransaction>> { ... } fn get_transactions_and_serialized_sizes( &self, digests: &[TransactionDigest], ) -> SuiResult<Vec<Option<(VerifiedTransaction, usize)>>> { ... } fn is_tx_already_executed(&self, digest: &TransactionDigest) -> bool { ... } fn multi_get_executed_effects( &self, digests: &[TransactionDigest], ) -> Vec<Option<TransactionEffects>> { ... } fn get_executed_effects( &self, digest: &TransactionDigest, ) -> Option<TransactionEffects> { ... } fn get_effects( &self, digest: &TransactionEffectsDigest, ) -> Option<TransactionEffects> { ... } fn get_events( &self, digest: &TransactionDigest, ) -> Option<TransactionEvents> { ... } fn notify_read_executed_effects<'a>( &'a self, task_name: &'static str, digests: &'a [TransactionDigest], ) -> BoxFuture<'a, Vec<TransactionEffects>> { ... } fn notify_read_executed_effects_may_fail<'a>( &'a self, task_name: &'static str, digests: &'a [TransactionDigest], ) -> BoxFuture<'a, SuiResult<Vec<TransactionEffects>>> { ... }
}

Required Methods§

Provided Methods§

Source

fn get_transaction_block( &self, digest: &TransactionDigest, ) -> Option<Arc<VerifiedTransaction>>

Source

fn get_transactions_and_serialized_sizes( &self, digests: &[TransactionDigest], ) -> SuiResult<Vec<Option<(VerifiedTransaction, usize)>>>

Source

fn is_tx_already_executed(&self, digest: &TransactionDigest) -> bool

Source

fn multi_get_executed_effects( &self, digests: &[TransactionDigest], ) -> Vec<Option<TransactionEffects>>

Source

fn get_executed_effects( &self, digest: &TransactionDigest, ) -> Option<TransactionEffects>

Source

fn get_effects( &self, digest: &TransactionEffectsDigest, ) -> Option<TransactionEffects>

Source

fn get_events(&self, digest: &TransactionDigest) -> Option<TransactionEvents>

Source

fn notify_read_executed_effects<'a>( &'a self, task_name: &'static str, digests: &'a [TransactionDigest], ) -> BoxFuture<'a, Vec<TransactionEffects>>

Wait until the effects of the given transactions are available and return them. WARNING: If calling this on a transaction that could be reverted, you must be sure that this function cannot be called during reconfiguration. The best way to do this is to wrap your future in EpochStore::within_alive_epoch. Holding an ExecutionLockReadGuard would also prevent reconfig from happening while waiting, but this is very dangerous, as it could prevent reconfiguration from ever occurring!

This function panics if any of the requested effects are not found. Use this in critical paths where effects are expected to exist (e.g., checkpoint building, consensus commit processing). For non-critical paths where effects may have been pruned (e.g., serving historical data to clients), use notify_read_executed_effects_may_fail.

Source

fn notify_read_executed_effects_may_fail<'a>( &'a self, task_name: &'static str, digests: &'a [TransactionDigest], ) -> BoxFuture<'a, SuiResult<Vec<TransactionEffects>>>

Returns an error if any of the requested effects have been pruned from the database. Use this in non-critical paths where effects may not exist (e.g., serving historical data that may have been pruned). For critical paths where effects must exist, use notify_read_executed_effects.

Implementors§