pub trait ObjectCacheRead: Send + Sync {
Show 25 methods
// Required methods
fn get_package_object(
&self,
id: &ObjectID,
) -> SuiResult<Option<PackageObject>>;
fn force_reload_system_packages(&self, system_package_ids: &[ObjectID]);
fn get_object(&self, id: &ObjectID) -> Option<Object>;
fn get_latest_object_ref_or_tombstone(
&self,
object_id: ObjectID,
) -> Option<ObjectRef>;
fn get_latest_object_or_tombstone(
&self,
object_id: ObjectID,
) -> Option<(ObjectKey, ObjectOrTombstone)>;
fn get_object_by_key(
&self,
object_id: &ObjectID,
version: SequenceNumber,
) -> Option<Object>;
fn multi_get_objects_by_key(
&self,
object_keys: &[ObjectKey],
) -> Vec<Option<Object>>;
fn object_exists_by_key(
&self,
object_id: &ObjectID,
version: SequenceNumber,
) -> bool;
fn multi_object_exists_by_key(&self, object_keys: &[ObjectKey]) -> Vec<bool>;
fn find_object_lt_or_eq_version(
&self,
object_id: ObjectID,
version: SequenceNumber,
) -> Option<Object>;
fn get_lock(
&self,
obj_ref: ObjectRef,
epoch_store: &AuthorityPerEpochStore,
) -> SuiResult<ObjectLockStatus>;
fn _get_live_objref(&self, object_id: ObjectID) -> SuiResult<ObjectRef>;
fn check_owned_objects_are_live(
&self,
owned_object_refs: &[ObjectRef],
) -> SuiResult;
fn get_sui_system_state_object_unsafe(&self) -> SuiResult<SuiSystemState>;
fn get_bridge_object_unsafe(&self) -> SuiResult<Bridge>;
fn get_marker_value(
&self,
object_key: FullObjectKey,
epoch_id: EpochId,
) -> Option<MarkerValue>;
fn get_latest_marker(
&self,
object_id: FullObjectID,
epoch_id: EpochId,
) -> Option<(SequenceNumber, MarkerValue)>;
fn get_highest_pruned_checkpoint(&self) -> Option<CheckpointSequenceNumber>;
// Provided methods
fn get_objects(&self, objects: &[ObjectID]) -> Vec<Option<Object>> { ... }
fn multi_get_objects_with_more_accurate_error_return(
&self,
object_refs: &[ObjectRef],
) -> Result<Vec<Object>, SuiError> { ... }
fn multi_input_objects_available(
&self,
keys: &[InputKey],
receiving_objects: HashSet<InputKey>,
epoch: EpochId,
) -> Vec<bool> { ... }
fn get_last_consensus_stream_end_info(
&self,
object_id: FullObjectID,
epoch_id: EpochId,
) -> Option<(SequenceNumber, TransactionDigest)> { ... }
fn get_consensus_stream_end_tx_digest(
&self,
object_key: FullObjectKey,
epoch_id: EpochId,
) -> Option<TransactionDigest> { ... }
fn have_received_object_at_version(
&self,
object_key: FullObjectKey,
epoch_id: EpochId,
) -> bool { ... }
fn fastpath_stream_ended_at_version_or_after(
&self,
object_id: ObjectID,
version: SequenceNumber,
epoch_id: EpochId,
) -> bool { ... }
}
Required Methods§
fn get_package_object(&self, id: &ObjectID) -> SuiResult<Option<PackageObject>>
fn force_reload_system_packages(&self, system_package_ids: &[ObjectID])
fn get_object(&self, id: &ObjectID) -> Option<Object>
fn get_latest_object_ref_or_tombstone( &self, object_id: ObjectID, ) -> Option<ObjectRef>
fn get_latest_object_or_tombstone( &self, object_id: ObjectID, ) -> Option<(ObjectKey, ObjectOrTombstone)>
fn get_object_by_key( &self, object_id: &ObjectID, version: SequenceNumber, ) -> Option<Object>
fn multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Vec<Option<Object>>
fn object_exists_by_key( &self, object_id: &ObjectID, version: SequenceNumber, ) -> bool
fn multi_object_exists_by_key(&self, object_keys: &[ObjectKey]) -> Vec<bool>
Sourcefn find_object_lt_or_eq_version(
&self,
object_id: ObjectID,
version: SequenceNumber,
) -> Option<Object>
fn find_object_lt_or_eq_version( &self, object_id: ObjectID, version: SequenceNumber, ) -> Option<Object>
Return the object with version less then or eq to the provided seq number. This is used by indexer to find the correct version of dynamic field child object. We do not store the version of the child object, but because of lamport timestamp, we know the child must have version number less then or eq to the parent.
fn get_lock( &self, obj_ref: ObjectRef, epoch_store: &AuthorityPerEpochStore, ) -> SuiResult<ObjectLockStatus>
fn _get_live_objref(&self, object_id: ObjectID) -> SuiResult<ObjectRef>
fn check_owned_objects_are_live( &self, owned_object_refs: &[ObjectRef], ) -> SuiResult
fn get_sui_system_state_object_unsafe(&self) -> SuiResult<SuiSystemState>
fn get_bridge_object_unsafe(&self) -> SuiResult<Bridge>
Sourcefn get_marker_value(
&self,
object_key: FullObjectKey,
epoch_id: EpochId,
) -> Option<MarkerValue>
fn get_marker_value( &self, object_key: FullObjectKey, epoch_id: EpochId, ) -> Option<MarkerValue>
Get the marker at a specific version
Sourcefn get_latest_marker(
&self,
object_id: FullObjectID,
epoch_id: EpochId,
) -> Option<(SequenceNumber, MarkerValue)>
fn get_latest_marker( &self, object_id: FullObjectID, epoch_id: EpochId, ) -> Option<(SequenceNumber, MarkerValue)>
Get the latest marker for a given object.
Sourcefn get_highest_pruned_checkpoint(&self) -> Option<CheckpointSequenceNumber>
fn get_highest_pruned_checkpoint(&self) -> Option<CheckpointSequenceNumber>
Return the watermark for the highest checkpoint for which we’ve pruned objects.
Provided Methods§
fn get_objects(&self, objects: &[ObjectID]) -> Vec<Option<Object>>
Sourcefn multi_get_objects_with_more_accurate_error_return(
&self,
object_refs: &[ObjectRef],
) -> Result<Vec<Object>, SuiError>
fn multi_get_objects_with_more_accurate_error_return( &self, object_refs: &[ObjectRef], ) -> Result<Vec<Object>, SuiError>
Load a list of objects from the store by object reference. If they exist in the store, they are returned directly. If any object missing, we try to figure out the best error to return. If the object we are asking is currently locked at a future version, we know this transaction is out-of-date and we return a ObjectVersionUnavailableForConsumption, which indicates this is not retriable. Otherwise, we return a ObjectNotFound error, which indicates this is retriable.
Sourcefn multi_input_objects_available(
&self,
keys: &[InputKey],
receiving_objects: HashSet<InputKey>,
epoch: EpochId,
) -> Vec<bool>
fn multi_input_objects_available( &self, keys: &[InputKey], receiving_objects: HashSet<InputKey>, epoch: EpochId, ) -> Vec<bool>
Used by transaction manager to determine if input objects are ready. Distinct from multi_get_object_by_key because it also consults markers to handle the case where an object will never become available (e.g. because it has been received by some other transaction already).
Sourcefn get_last_consensus_stream_end_info(
&self,
object_id: FullObjectID,
epoch_id: EpochId,
) -> Option<(SequenceNumber, TransactionDigest)>
fn get_last_consensus_stream_end_info( &self, object_id: FullObjectID, epoch_id: EpochId, ) -> Option<(SequenceNumber, TransactionDigest)>
If the given consensus object stream was ended, return related version and transaction digest.
Sourcefn get_consensus_stream_end_tx_digest(
&self,
object_key: FullObjectKey,
epoch_id: EpochId,
) -> Option<TransactionDigest>
fn get_consensus_stream_end_tx_digest( &self, object_key: FullObjectKey, epoch_id: EpochId, ) -> Option<TransactionDigest>
If the given consensus object stream was ended at the specified version, return related transaction digest.