pub struct Config<S: Scheme, L: Elector<S>, B: Blocker<PublicKey = S::PublicKey>, D: Digest, A: CertifiableAutomaton<Context = Context<D, S::PublicKey>>, R: Relay, F: Reporter<Activity = Activity<S, D>>> {Show 20 fields
pub scheme: S,
pub elector: L,
pub blocker: B,
pub automaton: A,
pub relay: R,
pub reporter: F,
pub partition: String,
pub mailbox_size: usize,
pub epoch: Epoch,
pub namespace: Vec<u8>,
pub replay_buffer: NonZeroUsize,
pub write_buffer: NonZeroUsize,
pub buffer_pool: PoolRef,
pub leader_timeout: Duration,
pub notarization_timeout: Duration,
pub nullify_retry: Duration,
pub activity_timeout: ViewDelta,
pub skip_timeout: ViewDelta,
pub fetch_timeout: Duration,
pub fetch_concurrent: usize,
}Expand description
Configuration for the consensus engine.
Fields§
§scheme: SSigning scheme for the consensus engine.
Consensus messages can be signed with a cryptosystem that differs from the static
participant identity keys exposed in participants. For example, we can authenticate peers
on the network with commonware_cryptography::ed25519 keys while signing votes with shares distributed
via commonware_cryptography::bls12381::dkg (which change each epoch). The scheme implementation is
responsible for reusing the exact participant ordering carried by participants so that signer indices
remain stable across both key spaces; if the order diverges, validators will reject votes as coming from
the wrong validator.
elector: LLeader election configuration.
Determines how leaders are selected for each view. Built-in options include
RoundRobin for deterministic rotation and
Random for unpredictable selection using BLS
threshold signatures.
blocker: BBlocker for the network.
Blocking is handled by commonware_p2p.
automaton: AAutomaton for the consensus engine.
relay: RRelay for the consensus engine.
reporter: FReporter for the consensus engine.
All activity is exported for downstream applications that benefit from total observability,
consider wrapping with crate::simplex::scheme::reporter::AttributableReporter to
automatically filter and verify activities based on scheme attributability.
partition: StringPartition for the consensus engine.
mailbox_size: usizeMaximum number of messages to buffer on channels inside the consensus engine before blocking.
epoch: EpochEpoch for the consensus engine. Each running engine should have a unique epoch.
namespace: Vec<u8>Prefix for all signed messages to prevent replay attacks.
replay_buffer: NonZeroUsizeNumber of bytes to buffer when replaying during startup.
write_buffer: NonZeroUsizeThe size of the write buffer to use for each blob in the journal.
buffer_pool: PoolRefBuffer pool for the journal.
leader_timeout: DurationAmount of time to wait for a leader to propose a payload in a view.
notarization_timeout: DurationAmount of time to wait for a quorum of notarizations in a view before attempting to skip the view.
nullify_retry: DurationAmount of time to wait before retrying a nullify broadcast if stuck in a view.
activity_timeout: ViewDeltaNumber of views behind finalized tip to track and persist activity derived from validator messages.
skip_timeout: ViewDeltaMove to nullify immediately if the selected leader has been inactive for this many recent known views (we ignore views we don’t have data for).
This number should be less than or equal to activity_timeout (how
many views we are tracking below the finalized tip).
fetch_timeout: DurationTimeout to wait for a peer to respond to a request.
fetch_concurrent: usizeNumber of concurrent requests to make at once.
Implementations§
Auto Trait Implementations§
impl<S, L, B, D, A, R, F> Freeze for Config<S, L, B, D, A, R, F>
impl<S, L, B, D, A, R, F> !RefUnwindSafe for Config<S, L, B, D, A, R, F>
impl<S, L, B, D, A, R, F> Send for Config<S, L, B, D, A, R, F>
impl<S, L, B, D, A, R, F> Sync for Config<S, L, B, D, A, R, F>
impl<S, L, B, D, A, R, F> Unpin for Config<S, L, B, D, A, R, F>
impl<S, L, B, D, A, R, F> !UnwindSafe for Config<S, L, B, D, A, R, F>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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