pub enum Activity<S: Scheme, D: Digest> {
Notarize(Notarize<S, D>),
Notarization(Notarization<S, D>),
Nullify(Nullify<S>),
Nullification(Nullification<S>),
Finalize(Finalize<S, D>),
Finalization(Finalization<S, D>),
ConflictingNotarize(ConflictingNotarize<S, D>),
ConflictingFinalize(ConflictingFinalize<S, D>),
NullifyFinalize(NullifyFinalize<S, D>),
}Expand description
Activity represents all possible activities that can occur in the consensus protocol. This includes both regular consensus messages and fault evidence.
§Verification
Some activities issued by consensus are not guaranteed to be cryptographically verified (i.e. if not needed
to produce a minimum quorum certificate). Use Activity::verified to check if an activity may not be verified,
and Activity::verify to perform verification.
§Activity Filtering
For non-attributable schemes like crate::simplex::signing_scheme::bls12381_threshold, exposing
per-validator activity as fault evidence is not safe: with threshold cryptography, any t valid partial signatures can
be used to forge a partial signature for any player.
Use crate::simplex::signing_scheme::reporter::AttributableReporter to automatically filter and
verify activities based on Scheme::is_attributable.
Variants§
Notarize(Notarize<S, D>)
A validator’s notarize vote over a proposal.
Notarization(Notarization<S, D>)
A recovered certificate for a notarization (scheme-specific).
Nullify(Nullify<S>)
A validator’s nullify vote used to skip the current view.
Nullification(Nullification<S>)
A recovered certificate for a nullification (scheme-specific).
Finalize(Finalize<S, D>)
A validator’s finalize vote over a proposal.
Finalization(Finalization<S, D>)
A recovered certificate for a finalization (scheme-specific).
ConflictingNotarize(ConflictingNotarize<S, D>)
Evidence of a validator sending conflicting notarizes (Byzantine behavior).
ConflictingFinalize(ConflictingFinalize<S, D>)
Evidence of a validator sending conflicting finalizes (Byzantine behavior).
NullifyFinalize(NullifyFinalize<S, D>)
Evidence of a validator sending both nullify and finalize for the same view (Byzantine behavior).
Implementations§
Source§impl<S: Scheme, D: Digest> Activity<S, D>
impl<S: Scheme, D: Digest> Activity<S, D>
Sourcepub fn verified(&self) -> bool
pub fn verified(&self) -> bool
Indicates whether the activity is guaranteed to have been verified by consensus.
Sourcepub fn verify<R: Rng + CryptoRng>(
&self,
rng: &mut R,
scheme: &S,
namespace: &[u8],
) -> bool
pub fn verify<R: Rng + CryptoRng>( &self, rng: &mut R, scheme: &S, namespace: &[u8], ) -> bool
Verifies the validity of this activity against the signing scheme.
This method always performs verification regardless of whether the activity has been
previously verified. Callers can use Activity::verified to check if verification is
necessary before calling this method.
Trait Implementations§
Source§impl<S: Scheme, D: Digest> EncodeSize for Activity<S, D>
impl<S: Scheme, D: Digest> EncodeSize for Activity<S, D>
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Source§impl<S: Scheme, D: Digest> Read for Activity<S, D>
impl<S: Scheme, D: Digest> Read for Activity<S, D>
impl<S: Scheme, D: Digest> Eq for Activity<S, D>
Auto Trait Implementations§
impl<S, D> Freeze for Activity<S, D>
impl<S, D> RefUnwindSafe for Activity<S, D>where
<S as Scheme>::Certificate: RefUnwindSafe,
D: RefUnwindSafe,
<S as Scheme>::Signature: RefUnwindSafe,
impl<S, D> Send for Activity<S, D>
impl<S, D> Sync for Activity<S, D>
impl<S, D> Unpin for Activity<S, D>
impl<S, D> UnwindSafe for Activity<S, D>
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<X, U> DecodeRangeExt<X> for U
impl<X, U> DecodeRangeExt<X> for U
Source§fn decode_range(
buf: impl Buf,
range: impl RangeBounds<usize>,
) -> Result<Self, Error>
fn decode_range( buf: impl Buf, range: impl RangeBounds<usize>, ) -> Result<Self, Error>
Source§impl<T> Encode for Twhere
T: Write + EncodeSize,
impl<T> Encode for Twhere
T: Write + EncodeSize,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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