pub struct Mailbox<B, C, H, P>{ /* private fields */ }Expand description
A mailbox for sending messages to the Engine.
Implementations§
Source§impl<B, C, H, P> Mailbox<B, C, H, P>
impl<B, C, H, P> Mailbox<B, C, H, P>
Sourcepub fn proposed(&self, round: Round, block: CodedBlock<B, C, H>)
pub fn proposed(&self, round: Round, block: CodedBlock<B, C, H>)
Broadcast a proposed erasure coded block’s shards to the participants.
Sourcepub fn discovered(&self, commitment: Commitment, leader: P, round: Round)
pub fn discovered(&self, commitment: Commitment, leader: P, round: Round)
Inform the engine of an externally proposed Commitment.
Sourcepub fn notarized(&self, commitment: Commitment, round: Round)
pub fn notarized(&self, commitment: Commitment, round: Round)
Inform the engine that a Commitment was notarized.
This is the leaderless reconstruction signal used by certification. It
lets the engine drain sender-indexed gossip shards from its peer buffers
for the commitment. Leader-specific validation and assigned shard
verification still require a later Self::discovered call.
Sourcepub async fn get(&self, commitment: Commitment) -> Option<CodedBlock<B, C, H>>
pub async fn get(&self, commitment: Commitment) -> Option<CodedBlock<B, C, H>>
Request a reconstructed block by its Commitment.
Sourcepub async fn get_by_digest(
&self,
digest: B::Digest,
) -> Option<CodedBlock<B, C, H>>
pub async fn get_by_digest( &self, digest: B::Digest, ) -> Option<CodedBlock<B, C, H>>
Request a reconstructed block by its digest.
Sourcepub fn subscribe_assigned_shard_verified(
&self,
commitment: Commitment,
) -> Receiver<()>
pub fn subscribe_assigned_shard_verified( &self, commitment: Commitment, ) -> Receiver<()>
Subscribe to assigned shard verification for a commitment.
For participants, this resolves once the leader-delivered shard for the local participant index has been verified. Reconstructing the full block from gossiped shards does not resolve this subscription: that block may still be used for later certification, but it is not enough to claim the participant received the shard it is expected to echo.
For proposers, this resolves immediately after the locally built block is cached because they trivially have all shards.
Sourcepub fn subscribe(&self, commitment: Commitment) -> Receiver<CodedBlock<B, C, H>>
pub fn subscribe(&self, commitment: Commitment) -> Receiver<CodedBlock<B, C, H>>
Subscribe to the reconstruction of a CodedBlock by its Commitment.
Sourcepub fn subscribe_by_digest(
&self,
digest: B::Digest,
) -> Receiver<CodedBlock<B, C, H>>
pub fn subscribe_by_digest( &self, digest: B::Digest, ) -> Receiver<CodedBlock<B, C, H>>
Subscribe to the reconstruction of a CodedBlock by its digest.
Sourcepub fn prune(&self, through: Commitment)
pub fn prune(&self, through: Commitment)
Request to prune all caches at and below the given commitment.
Trait Implementations§
Source§impl<B, C, H, P> Buffer<Coding<B, C, H, P>> for Mailbox<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
impl<B, C, H, P> Buffer<Coding<B, C, H, P>> for Mailbox<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
Source§async fn find_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Option<CodedBlock<B, C, H>>
async fn find_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Option<CodedBlock<B, C, H>>
Source§async fn find_by_commitment(
&self,
commitment: Commitment,
) -> Option<CodedBlock<B, C, H>>
async fn find_by_commitment( &self, commitment: Commitment, ) -> Option<CodedBlock<B, C, H>>
Source§fn subscribe_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Option<Receiver<CodedBlock<B, C, H>>>
fn subscribe_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Option<Receiver<CodedBlock<B, C, H>>>
Source§fn subscribe_by_commitment(
&self,
commitment: Commitment,
) -> Option<Receiver<CodedBlock<B, C, H>>>
fn subscribe_by_commitment( &self, commitment: Commitment, ) -> Option<Receiver<CodedBlock<B, C, H>>>
Source§fn finalized(&self, commitment: Commitment)
fn finalized(&self, commitment: Commitment)
Source§fn send(
&self,
round: Round,
block: CodedBlock<B, C, H>,
_recipients: Recipients<P>,
)
fn send( &self, round: Round, block: CodedBlock<B, C, H>, _recipients: Recipients<P>, )
Auto Trait Implementations§
impl<B, C, H, P> Freeze for Mailbox<B, C, H, P>
impl<B, C, H, P> !RefUnwindSafe for Mailbox<B, C, H, P>
impl<B, C, H, P> Send for Mailbox<B, C, H, P>
impl<B, C, H, P> Sync for Mailbox<B, C, H, P>
impl<B, C, H, P> Unpin for Mailbox<B, C, H, P>
impl<B, C, H, P> UnsafeUnpin for Mailbox<B, C, H, P>
impl<B, C, H, P> !UnwindSafe for Mailbox<B, C, H, P>
Blanket Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more