pub struct ChainStateViewReadGuard<S: Storage>(/* private fields */);Expand description
A read guard providing access to a chain’s ChainStateView.
Holds a read lock on the chain worker state, preventing writes for its
lifetime. The OwnedRwLockReadGuard internally holds a strong Arc
reference to the RwLock<ChainWorkerState>, keeping the state alive.
Dereferences to ChainStateView.
Methods from Deref<Target = ChainStateView<S::Context>>§
pub async fn execution_state( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ExecutionStateView<C>, Error>
pub async fn execution_state_hash( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Option<CryptoHash>>, Error>
pub async fn tip_state( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, ChainTipState>, Error>
pub async fn manager( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ChainManager<C>, Error>
pub async fn pending_validated_blobs( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&PendingBlobsView<C>, Error>
pub async fn pending_proposed_blobs( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>, Error>
pub async fn confirmed_log( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&LogView<C, CryptoHash>, Error>
pub async fn received_log( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&LogView<C, ChainAndHeight>, Error>
pub async fn received_certificate_trackers( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, HashMap<Secp256k1PublicKey, u64>>, Error>
pub async fn inboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ReentrantCollectionView<C, ChainId, InboxStateView<C>>, Error>
pub async fn unskippable_bundles( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&BucketQueueView<C, TimestampedBundleInInbox, linera_chain::::chain::{impl#38}::unskippable_bundles::{constant#0}>, Error>
pub async fn removed_unskippable_bundles( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&SetView<C, BundleInInbox>, Error>
pub async fn previous_message_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, ChainId, BlockHeight>, Error>
pub async fn previous_event_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, StreamId, BlockHeight>, Error>
pub async fn outboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ReentrantCollectionView<C, ChainId, OutboxStateView<C>>, Error>
pub async fn outbox_counters( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, NonCanonicalBTreeMap<BlockHeight, u32>>, Error>
pub async fn nonempty_outboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, BTreeSet<ChainId>>, Error>
pub async fn preprocessed_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, BlockHeight, CryptoHash>, Error>
pub async fn next_expected_events( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, StreamId, u32>, Error>
pub async fn nonempty_inboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Option<BTreeSet<ChainId>>>, Error>
pub async fn block_zero_executed_at( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Timestamp>, Error>
pub async fn outbox_index_tracked_hash( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Option<CryptoHash>>, Error>
Sourcepub fn chain_id(&self) -> ChainId
pub fn chain_id(&self) -> ChainId
Returns the ChainId of the chain this ChainStateView represents.
Sourcepub fn all_messages_delivered_up_to(&self, height: BlockHeight) -> bool
pub fn all_messages_delivered_up_to(&self, height: BlockHeight) -> bool
Returns true if there are no more outgoing messages in flight up to the given block height.
Sourcepub async fn is_active(&self) -> Result<bool, ChainError>
pub async fn is_active(&self) -> Result<bool, ChainError>
Invariant for the states of active chains.
Sourcepub async fn next_height_to_preprocess(&self) -> Result<BlockHeight, ChainError>
pub async fn next_height_to_preprocess(&self) -> Result<BlockHeight, ChainError>
Returns the height of the highest block we have, plus one. Includes preprocessed blocks.
The “+ 1” is so that it can be used in the same places as next_block_height.
Sourcepub async fn current_committee(
&self,
) -> Result<(Epoch, Arc<Committee>), ChainError>
pub async fn current_committee( &self, ) -> Result<(Epoch, Arc<Committee>), ChainError>
Returns the current epoch and committee of this chain.
Sourcepub async fn ownership(&self) -> Result<&ChainOwnership, ChainError>
pub async fn ownership(&self) -> Result<&ChainOwnership, ChainError>
Returns the ownership configuration of this chain.
Sourcepub fn nonempty_outbox_chain_ids(&self) -> Vec<ChainId>
pub fn nonempty_outbox_chain_ids(&self) -> Vec<ChainId>
Returns the chain IDs of all recipients for which a message is waiting in the outbox.
Sourcepub async fn load_outboxes(
&self,
targets: &[ChainId],
) -> Result<Vec<ReadGuardedView<OutboxStateView<C>>>, ChainError>
pub async fn load_outboxes( &self, targets: &[ChainId], ) -> Result<Vec<ReadGuardedView<OutboxStateView<C>>>, ChainError>
Returns the outboxes for the given targets, or an error if any of them are missing.
Sourcepub fn outbox_index_is_reconciled(
&self,
tracked: Option<&Hashed<ChainIdSet>>,
) -> bool
pub fn outbox_index_is_reconciled( &self, tracked: Option<&Hashed<ChainIdSet>>, ) -> bool
Returns whether the outbox index is already reconciled to tracked (the stored hash
matches), so the read-only network-actions path can read it without a write-lock rebuild.
Sourcepub async fn block_hashes(
&self,
heights: impl IntoIterator<Item = BlockHeight>,
) -> Result<Vec<CryptoHash>, ChainError>
pub async fn block_hashes( &self, heights: impl IntoIterator<Item = BlockHeight>, ) -> Result<Vec<CryptoHash>, ChainError>
Returns the hashes of all blocks we have in the given range.
If the input heights are in ascending order, the hashes will be in the same order. Otherwise they may be unordered.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ChainStateViewReadGuard<S>
impl<S> !UnwindSafe for ChainStateViewReadGuard<S>
impl<S> Freeze for ChainStateViewReadGuard<S>
impl<S> Send for ChainStateViewReadGuard<S>
impl<S> Sync for ChainStateViewReadGuard<S>
impl<S> Unpin for ChainStateViewReadGuard<S>
impl<S> UnsafeUnpin for ChainStateViewReadGuard<S>
Blanket Implementations§
impl<_INNER> AutoTraits for _INNER
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Requestimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
impl<T> Post for Twhere
T: Send + 'static,
Source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length bytes from memory from the provided location.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.