pub struct Application<A, B, V, C>{ /* private fields */ }Expand description
An Application wrapper that enforces the
reshare block-validity contract and drives the reshare payload for proposals.
When the reshare actor tracks an epoch’s ceremony, the wrapper rejects a
final block whose payload differs from the independently reconstructed
EpochInfo. An actor that starts following
mid-epoch lacks the protocol history required for that comparison, so its
final-block verification remains pending. The wrapper always rejects stray
payloads carried by non-final blocks in the early dealing window.
For proposals, the wrapper selects and fetches the payload for the block being
built (a dealer log from the midpoint onward, the epoch info on the final
block) and hands it to the inner application through Input, so the
inner application neither talks to the reshare mailbox nor tracks epoch
boundaries. It only attaches the handed-over payload to the block it builds,
because the wrapper cannot build the application’s block type itself.
The wrapper is a plain Application, so
it composes with any consensus application, including one adapted through
stateful. It forwards its own upstream input to the inner
application as Input::upstream, so nesting under another
input-providing application still works.
Implementations§
Source§impl<A, B, V, C> Application<A, B, V, C>
impl<A, B, V, C> Application<A, B, V, C>
Sourcepub const fn new(
inner: A,
reshare: Mailbox<B, V, C>,
blocks_per_epoch: NonZeroU64,
) -> Self
pub const fn new( inner: A, reshare: Mailbox<B, V, C>, blocks_per_epoch: NonZeroU64, ) -> Self
Wraps inner, using reshare to select final-block epoch info and dealer
logs and blocks_per_epoch to locate epoch boundaries and phases.
Trait Implementations§
Source§impl<A, E, B, V, C, I> Application<E> for Application<A, B, V, C>where
E: Rng + Spawner + Metrics + Clock,
A: ConsensusApplication<E, Block = B, Input = Input<I, V, C, B::Directory>>,
A::Context: Send,
B: ReshareBlock<Variant = V, Signer = C> + CertifiableBlock + Clone,
V: Variant,
C: Signer,
I: Send,
impl<A, E, B, V, C, I> Application<E> for Application<A, B, V, C>where
E: Rng + Spawner + Metrics + Clock,
A: ConsensusApplication<E, Block = B, Input = Input<I, V, C, B::Directory>>,
A::Context: Send,
B: ReshareBlock<Variant = V, Signer = C> + CertifiableBlock + Clone,
V: Variant,
C: Signer,
I: Send,
Source§type SigningScheme = <A as Application<E>>::SigningScheme
type SigningScheme = <A as Application<E>>::SigningScheme
Source§type Context = <A as Application<E>>::Context
type Context = <A as Application<E>>::Context
Source§type Block = <A as Application<E>>::Block
type Block = <A as Application<E>>::Block
Source§type Input = I
type Input = I
propose. Applications
that need no input set this to ().Source§impl<A, B, V, C> Clone for Application<A, B, V, C>
impl<A, B, V, C> Clone for Application<A, B, V, C>
Auto Trait Implementations§
impl<A, B, V, C> !RefUnwindSafe for Application<A, B, V, C>
impl<A, B, V, C> !UnwindSafe for Application<A, B, V, C>
impl<A, B, V, C> Freeze for Application<A, B, V, C>
impl<A, B, V, C> Send for Application<A, B, V, C>
impl<A, B, V, C> Sync for Application<A, B, V, C>
impl<A, B, V, C> Unpin for Application<A, B, V, C>
impl<A, B, V, C> UnsafeUnpin for Application<A, B, V, C>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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