Skip to main content

Inline

Struct Inline 

Source
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>
where E: Rng + Spawner + Metrics + Clock, S: Scheme, A: VerifyingApplication<E, Block = B, SigningScheme = S, Context = Context<B::Digest, S::PublicKey>>, B: Block + Clone, ES: Epocher,

Source

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>
where E: Rng + Spawner + Metrics + Clock, S: Scheme, A: VerifyingApplication<E, Block = B, SigningScheme = S, Context = Context<B::Digest, S::PublicKey>>, B: Block + Clone, ES: Epocher,

Source§

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>

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>

Performs complete verification inline.

This method:

  1. Fetches the block by digest
  2. Enforces epoch/re-proposal rules
  3. Fetches and validates the parent relationship
  4. 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

Hash of an arbitrary payload.
Source§

type Context = Context<<Inline<E, S, A, B, ES> as Automaton>::Digest, <S as Scheme>::PublicKey>

Context is metadata provided by the consensus engine associated with a given payload. Read more
Source§

impl<E, S, A, B, ES> CertifiableAutomaton for Inline<E, S, A, B, ES>
where E: Rng + Spawner + Metrics + Clock, S: Scheme, A: VerifyingApplication<E, Block = B, SigningScheme = S, Context = Context<B::Digest, S::PublicKey>>, B: Block + Clone, ES: Epocher,

Inline mode only waits for block availability during certification.

Source§

async fn certify( &mut self, round: Round, digest: Self::Digest, ) -> Receiver<bool>

Determine whether a verified payload is safe to commit. Read more
Source§

impl<E, S, A, B, ES> Clone for Inline<E, S, A, B, ES>
where E: Rng + Spawner + Metrics + Clock + Clone, S: Scheme + Clone, A: Application<E> + Clone, B: Block + Clone + Clone, ES: Epocher + Clone, B::Digest: Clone,

Source§

fn clone(&self) -> Inline<E, S, A, B, ES>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E, S, A, B, ES> Relay for Inline<E, S, A, B, ES>
where E: Rng + Spawner + Metrics + Clock, S: Scheme, A: Application<E, Block = B, Context = Context<B::Digest, S::PublicKey>>, B: Block + Clone, ES: Epocher,

Source§

type Digest = <B as Digestible>::Digest

Hash of an arbitrary payload.
Source§

type PublicKey = <S as Scheme>::PublicKey

Identity key of a network participant.
Source§

type Plan = Plan<<S as Scheme>::PublicKey>

Directive for how a payload should be broadcast. Read more
Source§

async fn broadcast(&mut self, digest: Self::Digest, plan: Plan<S::PublicKey>)

Broadcast a payload to the given recipients.
Source§

impl<E, S, A, B, ES> Reporter for Inline<E, S, A, B, ES>
where E: Rng + Spawner + Metrics + Clock, S: Scheme, A: Application<E, Block = B, Context = Context<B::Digest, S::PublicKey>> + Reporter<Activity = Update<B>>, B: Block + Clone, ES: Epocher,

Source§

async fn report(&mut self, update: Self::Activity)

Forwards consensus activity to the wrapped application reporter.

Source§

type Activity = <A as Reporter>::Activity

Activity is specified by the underlying consensus implementation and can be interpreted if desired. Read more

Auto Trait Implementations§

§

impl<E, S, A, B, ES> Freeze for Inline<E, S, A, B, ES>
where E: Freeze, A: Freeze, ES: Freeze,

§

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>
where E: Unpin, A: Unpin, ES: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<B> IntoBlock<B> for B
where B: Clone + Send,

Source§

fn into_block(self) -> B

Convert this cached block into the underlying block type.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,