pub struct Inline<E, S, A, B, ES>where
E: Rng + Spawner + Metrics + Clock,
S: Scheme,
A: Application<E>,
B: Block + Clone,
ES: Epocher,{ /* private fields */ }Expand description
Standard marshal wrapper that verifies blocks inline in verify.
§Ancestry Validation
Inline always validates immediate ancestry before invoking application
verification:
- Parent digest matches consensus context’s expected parent
- Child height is exactly parent height plus one
This is sufficient because the parent must have already been accepted by consensus.
§Certifiability
This wrapper requires only crate::Block for B, not
crate::CertifiableBlock. It is designed for applications that cannot
recover consensus context directly from block payloads.
Implementations§
Source§impl<E, S, A, B, ES> Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> Inline<E, S, A, B, ES>
Sourcepub fn new(
context: E,
application: A,
marshal: Mailbox<S, Standard<B>>,
epocher: ES,
) -> Self
pub fn new( context: E, application: A, marshal: Mailbox<S, Standard<B>>, epocher: ES, ) -> Self
Creates a new inline-verification wrapper.
Registers a build_duration histogram for proposal latency and initializes
the shared “last built block” cache used by Relay::broadcast.
Trait Implementations§
Source§impl<E, S, A, B, ES> Automaton for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> Automaton for Inline<E, S, A, B, ES>
Source§async fn genesis(&mut self, epoch: Epoch) -> Self::Digest
async fn genesis(&mut self, epoch: Epoch) -> Self::Digest
Returns the genesis digest for epoch.
For epoch zero, returns the application genesis digest. For later epochs, uses the previous epoch’s terminal block from marshal storage.
Source§async fn propose(
&mut self,
consensus_context: Context<Self::Digest, S::PublicKey>,
) -> Receiver<Self::Digest>
async fn propose( &mut self, consensus_context: Context<Self::Digest, S::PublicKey>, ) -> Receiver<Self::Digest>
Proposes a new block or re-proposes an epoch boundary block.
Proposal runs in a spawned task and returns a receiver for the resulting digest.
Built/re-proposed blocks are cached in last_built so relay can broadcast
exactly what was proposed.
Source§async fn verify(
&mut self,
context: Context<Self::Digest, S::PublicKey>,
digest: Self::Digest,
) -> Receiver<bool>
async fn verify( &mut self, context: Context<Self::Digest, S::PublicKey>, digest: Self::Digest, ) -> Receiver<bool>
Performs complete verification inline.
This method:
- Fetches the block by digest
- Enforces epoch/re-proposal rules
- Fetches and validates the parent relationship
- Runs application verification over ancestry
It reports true only after all verification steps finish. Successful
verification marks the block as verified in marshal immediately.
Source§type Digest = <B as Digestible>::Digest
type Digest = <B as Digestible>::Digest
Source§impl<E, S, A, B, ES> CertifiableAutomaton for Inline<E, S, A, B, ES>
Inline mode only waits for block availability during certification.
impl<E, S, A, B, ES> CertifiableAutomaton for Inline<E, S, A, B, ES>
Inline mode only waits for block availability during certification.
Source§impl<E, S, A, B, ES> Relay for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> Relay for Inline<E, S, A, B, ES>
Auto Trait Implementations§
impl<E, S, A, B, ES> Freeze for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> !RefUnwindSafe for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> Send for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> Sync for Inline<E, S, A, B, ES>where
A: Sync,
impl<E, S, A, B, ES> Unpin for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> UnsafeUnpin for Inline<E, S, A, B, ES>
impl<E, S, A, B, ES> !UnwindSafe for Inline<E, S, A, B, ES>
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<B> IntoBlock<B> for B
impl<B> IntoBlock<B> for B
Source§fn into_block(self) -> B
fn into_block(self) -> B
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