pub trait ReadStore: ObjectStore {
Show 24 methods
// Required methods
fn get_committee(&self, epoch: EpochId) -> Option<Arc<Committee>>;
fn get_latest_checkpoint(&self) -> Result<VerifiedCheckpoint>;
fn get_highest_verified_checkpoint(&self) -> Result<VerifiedCheckpoint>;
fn get_highest_synced_checkpoint(&self) -> Result<VerifiedCheckpoint>;
fn get_lowest_available_checkpoint(
&self,
) -> Result<CheckpointSequenceNumber>;
fn get_checkpoint_by_digest(
&self,
digest: &CheckpointDigest,
) -> Option<VerifiedCheckpoint>;
fn get_checkpoint_by_sequence_number(
&self,
sequence_number: CheckpointSequenceNumber,
) -> Option<VerifiedCheckpoint>;
fn get_checkpoint_contents_by_digest(
&self,
digest: &CheckpointContentsDigest,
) -> Option<CheckpointContents>;
fn get_checkpoint_contents_by_sequence_number(
&self,
sequence_number: CheckpointSequenceNumber,
) -> Option<CheckpointContents>;
fn get_transaction(
&self,
tx_digest: &TransactionDigest,
) -> Option<Arc<VerifiedTransaction>>;
fn get_transaction_effects(
&self,
tx_digest: &TransactionDigest,
) -> Option<TransactionEffects>;
fn get_events(
&self,
event_digest: &TransactionDigest,
) -> Option<TransactionEvents>;
fn get_unchanged_loaded_runtime_objects(
&self,
digest: &TransactionDigest,
) -> Option<Vec<ObjectKey>>;
fn get_transaction_checkpoint(
&self,
digest: &TransactionDigest,
) -> Option<CheckpointSequenceNumber>;
fn get_full_checkpoint_contents(
&self,
sequence_number: Option<CheckpointSequenceNumber>,
digest: &CheckpointContentsDigest,
) -> Option<VersionedFullCheckpointContents>;
// Provided methods
fn get_latest_checkpoint_sequence_number(
&self,
) -> Result<CheckpointSequenceNumber> { ... }
fn get_latest_epoch_id(&self) -> Result<EpochId> { ... }
fn multi_get_checkpoint_by_sequence_number(
&self,
sequence_numbers: &[CheckpointSequenceNumber],
) -> Vec<Option<VerifiedCheckpoint>> { ... }
fn multi_get_transactions(
&self,
tx_digests: &[TransactionDigest],
) -> Vec<Option<Arc<VerifiedTransaction>>> { ... }
fn multi_get_transaction_effects(
&self,
tx_digests: &[TransactionDigest],
) -> Vec<Option<TransactionEffects>> { ... }
fn get_execution_data(
&self,
digests: &ExecutionDigests,
) -> Option<ExecutionData> { ... }
fn multi_get_events(
&self,
event_digests: &[TransactionDigest],
) -> Vec<Option<TransactionEvents>> { ... }
fn multi_get_unchanged_loaded_runtime_objects(
&self,
digests: &[TransactionDigest],
) -> Vec<Option<Vec<ObjectKey>>> { ... }
fn get_checkpoint_data(
&self,
checkpoint: VerifiedCheckpoint,
checkpoint_contents: CheckpointContents,
) -> Result<Checkpoint> { ... }
}Required Methods§
fn get_committee(&self, epoch: EpochId) -> Option<Arc<Committee>>
Sourcefn get_latest_checkpoint(&self) -> Result<VerifiedCheckpoint>
fn get_latest_checkpoint(&self) -> Result<VerifiedCheckpoint>
Get the latest available checkpoint. This is the latest executed checkpoint.
All transactions, effects, objects and events are guaranteed to be available for the returned checkpoint.
Sourcefn get_highest_verified_checkpoint(&self) -> Result<VerifiedCheckpoint>
fn get_highest_verified_checkpoint(&self) -> Result<VerifiedCheckpoint>
Get the highest verified checkpint. This is the highest checkpoint summary that has been verified, generally by state-sync. Only the checkpoint header is guaranteed to be present in the store.
Sourcefn get_highest_synced_checkpoint(&self) -> Result<VerifiedCheckpoint>
fn get_highest_synced_checkpoint(&self) -> Result<VerifiedCheckpoint>
Get the highest synced checkpint. This is the highest checkpoint that has been synced from state-synce. The checkpoint header, contents, transactions, and effects of this checkpoint are guaranteed to be present in the store
Sourcefn get_lowest_available_checkpoint(&self) -> Result<CheckpointSequenceNumber>
fn get_lowest_available_checkpoint(&self) -> Result<CheckpointSequenceNumber>
Lowest available checkpoint for which transaction and checkpoint data can be requested.
Specifically this is the lowest checkpoint for which the following data can be requested:
- checkpoints
- transactions
- effects
- events
For object availability see get_lowest_available_checkpoint_objects.
fn get_checkpoint_by_digest( &self, digest: &CheckpointDigest, ) -> Option<VerifiedCheckpoint>
fn get_checkpoint_by_sequence_number( &self, sequence_number: CheckpointSequenceNumber, ) -> Option<VerifiedCheckpoint>
fn get_checkpoint_contents_by_digest( &self, digest: &CheckpointContentsDigest, ) -> Option<CheckpointContents>
fn get_checkpoint_contents_by_sequence_number( &self, sequence_number: CheckpointSequenceNumber, ) -> Option<CheckpointContents>
fn get_transaction( &self, tx_digest: &TransactionDigest, ) -> Option<Arc<VerifiedTransaction>>
fn get_transaction_effects( &self, tx_digest: &TransactionDigest, ) -> Option<TransactionEffects>
fn get_events( &self, event_digest: &TransactionDigest, ) -> Option<TransactionEvents>
fn get_unchanged_loaded_runtime_objects( &self, digest: &TransactionDigest, ) -> Option<Vec<ObjectKey>>
fn get_transaction_checkpoint( &self, digest: &TransactionDigest, ) -> Option<CheckpointSequenceNumber>
Sourcefn get_full_checkpoint_contents(
&self,
sequence_number: Option<CheckpointSequenceNumber>,
digest: &CheckpointContentsDigest,
) -> Option<VersionedFullCheckpointContents>
fn get_full_checkpoint_contents( &self, sequence_number: Option<CheckpointSequenceNumber>, digest: &CheckpointContentsDigest, ) -> Option<VersionedFullCheckpointContents>
Get a “full” checkpoint for purposes of state-sync “full” checkpoints include: header, contents, transactions, effects. sequence_number is optional since we can always query it using the digest. However if it is provided, we can avoid an extra db lookup.
Provided Methods§
Sourcefn get_latest_checkpoint_sequence_number(
&self,
) -> Result<CheckpointSequenceNumber>
fn get_latest_checkpoint_sequence_number( &self, ) -> Result<CheckpointSequenceNumber>
Get the latest available checkpoint sequence number. This is the sequence number of the latest executed checkpoint.
Sourcefn get_latest_epoch_id(&self) -> Result<EpochId>
fn get_latest_epoch_id(&self) -> Result<EpochId>
Get the epoch of the latest checkpoint
fn multi_get_checkpoint_by_sequence_number( &self, sequence_numbers: &[CheckpointSequenceNumber], ) -> Vec<Option<VerifiedCheckpoint>>
fn multi_get_transactions( &self, tx_digests: &[TransactionDigest], ) -> Vec<Option<Arc<VerifiedTransaction>>>
fn multi_get_transaction_effects( &self, tx_digests: &[TransactionDigest], ) -> Vec<Option<TransactionEffects>>
Sourcefn get_execution_data(
&self,
digests: &ExecutionDigests,
) -> Option<ExecutionData>
fn get_execution_data( &self, digests: &ExecutionDigests, ) -> Option<ExecutionData>
Loads the transaction and effects for digests. Returns None if either is missing or the
stored effects do not have the expected digest. Implementations should look up effects by
effects digest, so that checkpoints that are synced but not yet executed can be served.
fn multi_get_events( &self, event_digests: &[TransactionDigest], ) -> Vec<Option<TransactionEvents>>
fn multi_get_unchanged_loaded_runtime_objects( &self, digests: &[TransactionDigest], ) -> Vec<Option<Vec<ObjectKey>>>
fn get_checkpoint_data( &self, checkpoint: VerifiedCheckpoint, checkpoint_contents: CheckpointContents, ) -> Result<Checkpoint>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".