pub struct Coding<B, C, H, P>(/* private fields */)
where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey;Expand description
The coding variant of Marshal, which uses erasure coding for block dissemination.
This variant distributes blocks as erasure-coded shards, allowing reconstruction from a subset of shards. This reduces bandwidth requirements for block propagation.
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§type CachedBlock = Arc<CodedBlock<B, C, H>>
type CachedBlock = Arc<CodedBlock<B, C, H>>
The cached block type held internally by the buffer. Read more
Source§async fn find_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Option<Self::CachedBlock>
async fn find_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Option<Self::CachedBlock>
Attempt to find a block by its digest. Read more
Source§async fn find_by_commitment(
&self,
commitment: Commitment,
) -> Option<Self::CachedBlock>
async fn find_by_commitment( &self, commitment: Commitment, ) -> Option<Self::CachedBlock>
Attempt to find a block by its commitment. Read more
Source§async fn subscribe_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Receiver<Self::CachedBlock>
async fn subscribe_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Receiver<Self::CachedBlock>
Subscribe to a block’s availability by its digest. Read more
Source§async fn subscribe_by_commitment(
&self,
commitment: Commitment,
) -> Receiver<Self::CachedBlock>
async fn subscribe_by_commitment( &self, commitment: Commitment, ) -> Receiver<Self::CachedBlock>
Subscribe to a block’s availability by its commitment. Read more
Source§async fn finalized(&self, commitment: Commitment)
async fn finalized(&self, commitment: Commitment)
Notify the buffer that a block has been finalized. Read more
Source§impl<B, C, H, P> Clone for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>> + Clone,
C: CodingScheme + Clone,
H: Hasher + Clone,
P: PublicKey + Clone,
impl<B, C, H, P> Clone for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>> + Clone,
C: CodingScheme + Clone,
H: Hasher + Clone,
P: PublicKey + Clone,
Source§impl<B, C, H, P> Default for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>> + Default,
C: CodingScheme + Default,
H: Hasher + Default,
P: PublicKey + Default,
impl<B, C, H, P> Default for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>> + Default,
C: CodingScheme + Default,
H: Hasher + Default,
P: PublicKey + Default,
Source§impl<B, C, H, P> Variant for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
impl<B, C, H, P> Variant for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
Source§type ApplicationBlock = B
type ApplicationBlock = B
The application block type.
Source§type Block = CodedBlock<B, C, H>
type Block = CodedBlock<B, C, H>
The working block type of marshal, supporting the consensus commitment. Read more
Source§type StoredBlock = StoredCodedBlock<B, C, H>
type StoredBlock = StoredCodedBlock<B, C, H>
The type of block stored in the archive. Read more
Source§type Commitment = Commitment
type Commitment = Commitment
The
Digest type used by consensus.Source§fn commitment(block: &Self::Block) -> Self::Commitment
fn commitment(block: &Self::Block) -> Self::Commitment
Computes the consensus commitment for a block. Read more
Source§fn commitment_to_inner(
commitment: Self::Commitment,
) -> <Self::Block as Digestible>::Digest
fn commitment_to_inner( commitment: Self::Commitment, ) -> <Self::Block as Digestible>::Digest
Extracts the block digest from a consensus commitment. Read more
Source§fn parent_commitment(block: &Self::Block) -> Self::Commitment
fn parent_commitment(block: &Self::Block) -> Self::Commitment
Returns the parent commitment referenced by
block.Source§fn into_inner(block: Self::Block) -> Self::ApplicationBlock
fn into_inner(block: Self::Block) -> Self::ApplicationBlock
Converts a working block to an application block. Read more
impl<B, C, H, P> Copy for Coding<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>> + Copy,
C: CodingScheme + Copy,
H: Hasher + Copy,
P: PublicKey + Copy,
Auto Trait Implementations§
impl<B, C, H, P> Freeze for Coding<B, C, H, P>
impl<B, C, H, P> RefUnwindSafe for Coding<B, C, H, P>
impl<B, C, H, P> Send for Coding<B, C, H, P>
impl<B, C, H, P> Sync for Coding<B, C, H, P>
impl<B, C, H, P> Unpin for Coding<B, C, H, P>
impl<B, C, H, P> UnsafeUnpin for Coding<B, C, H, P>
impl<B, C, H, P> UnwindSafe for Coding<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
Mutably borrows from an owned value. Read more
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<B> IntoBlock<B> for B
impl<B> IntoBlock<B> for B
Source§fn into_block(self) -> B
fn into_block(self) -> B
Convert this cached block into the underlying block type.
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>
Converts
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>
Converts
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