Skip to main content

Reporter

Trait Reporter 

Source
pub trait Reporter:
    Clone
    + Send
    + 'static {
    type Activity;

    // Required method
    fn report(&mut self, activity: Self::Activity) -> Feedback;
}
Expand description

Reporter is the interface responsible for reporting activity to some external actor.

Required Associated Types§

Source

type Activity

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

Examples of activity would be “vote”, “finalize”, or “fault”. Various consensus implementations may want to reward (or penalize) participation in different ways and in different places. For example, validators could be required to send multiple types of messages (i.e. vote and finalize) and rewarding both equally may better align incentives with desired behavior.

Required Methods§

Source

fn report(&mut self, activity: Self::Activity) -> Feedback

Report some activity observed by the consensus implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<R: Reporter> Reporter for Option<R>

An implementation of Reporter for an optional Reporter.

This is useful for reporting activity to a Reporter that may not be present. Reporting is ignored if the Reporter is None.

Source§

type Activity = <R as Reporter>::Activity

Source§

fn report(&mut self, activity: Self::Activity) -> Feedback

Implementors§

Source§

impl<E, A, B, C, H, Z, S, ES> Reporter for Marshaled<E, A, B, C, H, Z, S, ES>
where E: Send + Sync + 'static, A: Application<E, Block = B, Context = Context<Commitment<B, C, H>, <Z::Scheme as Verifier>::PublicKey>>, B: CertifiableBlock<Context = <A as Application<E>>::Context> + Codec, C: CodingScheme, H: Hasher, Z: Provider<Scope = Epoch, Scheme: Scheme<Commitment<B, C, H>>>, S: Strategy, ES: Epocher,

The wrapper is the consensus engine’s reporter, as it is its automaton and relay: it forwards every activity to marshal and first releases the state it keeps per round (certification gates, staged proposals, and sent marks). A finalization releases its round and the rounds below it. Any activity of a later epoch releases every earlier epoch, whose engine has been retired, which covers finalized progress that marshal imported while no engine reported it. The voter reports from the same task that requests the lock-in broadcast and certification, so pruning is ordered with both.

Source§

impl<E, S, A, B, ES> Reporter for Deferred<E, S, A, B, ES>
where E: Send + Sync + 'static, S: Scheme, A: Application<E, Block = B, Context = Context<B::Digest, S::PublicKey>>, B: CertifiableBlock<Context = <A as Application<E>>::Context> + Codec, ES: Epocher,

The wrapper is the consensus engine’s reporter, as it is its automaton and relay: it forwards every activity to marshal and first releases the state it keeps per round (certification gates, staged proposals, and sent marks). A finalization releases its round and the rounds below it. Any activity of a later epoch releases every earlier epoch, whose engine has been retired, which covers finalized progress that marshal imported while no engine reported it. The voter reports from the same task that requests the lock-in broadcast and certification, so pruning is ordered with both.

Source§

impl<E, S, A, B, ES> Reporter for Inline<E, S, A, B, ES>
where E: Send + Sync + 'static, S: Scheme, A: Application<E, Block = B, Context = Context<B::Digest, S::PublicKey>>, B: Block + Codec, ES: Epocher,

The wrapper is the consensus engine’s reporter, as it is its automaton and relay: it forwards every activity to marshal and first releases the state it keeps per round (certification gates, staged proposals, and sent marks). A finalization releases its round and the rounds below it. Any activity of a later epoch releases every earlier epoch, whose engine has been retired, which covers finalized progress that marshal imported while no engine reported it. The voter reports from the same task that requests the lock-in broadcast and certification, so pruning is ordered with both.

Source§

impl<E: CryptoRng + Send + 'static, S: Scheme<D>, D: Digest, T: Strategy, R: Reporter<Activity = Activity<S, D>>> Reporter for AttributableReporter<E, S, D, T, R>

Source§

impl<R1, R2> Reporter for Reporters<R1, R2>
where R1: Reporter, R2: Reporter<Activity = R1::Activity>, R1::Activity: Clone,

Source§

impl<S: Scheme, V: Variant> Reporter for Mailbox<S, V>