pub trait CertifiableAutomaton: Automaton {
// Provided method
fn certify(
&mut self,
_round: Round,
_payload: Self::Digest,
) -> impl Future<Output = Receiver<bool>> + Send { ... }
}Expand description
CertifiableAutomaton extends Automaton with the ability to certify payloads before finalization.
This trait is required by consensus implementations (like Simplex) that support a certification phase between notarization and finalization. Applications that do not need custom certification logic can use the default implementation which always certifies.
Provided Methods§
Sourcefn certify(
&mut self,
_round: Round,
_payload: Self::Digest,
) -> impl Future<Output = Receiver<bool>> + Send
fn certify( &mut self, _round: Round, _payload: Self::Digest, ) -> impl Future<Output = Receiver<bool>> + Send
Determine whether a verified payload is safe to commit.
The round parameter identifies which consensus round is being certified, allowing
applications to associate certification with the correct verification context. The
same payload may appear in multiple rounds, so implementations must key any state
on (round, payload) rather than payload alone.
Like Automaton::verify, payloads produced by Automaton::propose are certifiable-by-construction.
Also like Automaton::verify, certification is single-shot for the given
(round, payload). Once the returned channel resolves or closes, consensus treats
certification as concluded and will not retry the same request.
Implementations should therefore keep the request pending while the verdict may still
change. Return false only when the payload is permanently uncertifiable for that
round. Temporary conditions such as waiting for more data should not conclude
certification with false.
Closing the channel is also terminal for this request and should be reserved for cases where certification can no longer produce a verdict (for example, shutdown), not for temporary inability to decide.
§Determinism Requirement
The decision returned by certify must be deterministic and consistent across
all honest participants to ensure liveness.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<E, A, B, C, H, Z, S, ES> CertifiableAutomaton for Marshaled<E, A, B, C, H, Z, S, ES>where
E: Rng + Storage + Spawner + Metrics + Clock,
A: Application<E, Block = B, SigningScheme = Z::Scheme, Context = Context<Commitment, <Z::Scheme as CertificateScheme>::PublicKey>>,
B: CertifiableBlock<Context = <A as Application<E>>::Context>,
C: CodingScheme,
H: Hasher,
Z: Provider<Scope = Epoch, Scheme: Scheme<Commitment>>,
S: Strategy,
ES: Epocher,
impl<E, S, A, B, ES> CertifiableAutomaton for Deferred<E, S, A, B, ES>where
E: Rng + Spawner + Metrics + Clock,
S: Scheme,
A: Application<E, Block = B, SigningScheme = S, Context = Context<B::Digest, S::PublicKey>>,
B: CertifiableBlock<Context = <A as Application<E>>::Context>,
ES: Epocher,
impl<E, S, A, B, ES> CertifiableAutomaton for Inline<E, S, A, B, ES>
Inline mode only waits for block availability during certification.