pub struct Config<S, L, B, D, A, R, F, T>where
S: Scheme,
L: Config<S>,
B: Blocker<PublicKey = S::PublicKey>,
D: Digest,
A: CertifiableAutomaton<Context = Context<D, S::PublicKey>>,
R: Relay,
F: Reporter<Activity = Activity<S, D>>,
T: Strategy,{Show 22 fields
pub scheme: S,
pub elector: L,
pub blocker: B,
pub automaton: A,
pub relay: R,
pub reporter: F,
pub track_historical_votes: bool,
pub strategy: T,
pub partition: String,
pub mailbox_size: NonZeroUsize,
pub epoch: Epoch,
pub floor: Floor<S, D>,
pub replay_buffer: NonZeroUsize,
pub write_buffer: NonZeroUsize,
pub page_cache: CacheRef,
pub leader_timeout: Duration,
pub certification_timeout: Duration,
pub timeout_retry: Duration,
pub view_retention: ViewDelta,
pub skip: SkipPolicy,
pub fetch_timeout: Duration,
pub forward: ForwardPolicy,
}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.
Schemes must provide deterministic signatures (a participant must produce the same signature encoding every time it signs the same subject) because Simplex compares encoded votes when detecting equivocation.
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.
Activity is exported for every tracked view, including votes that arrive up to
view_retention views below the highest finalized view; votes below that window
are dropped without being reported. Reported votes are not guaranteed to be
verified (see crate::simplex::types::Activity). Consider wrapping with
crate::simplex::scheme::reporter::AttributableReporter to automatically filter
and verify activities based on scheme attributability.
Locally constructed votes are exported only after their journal entries are durable. Network votes are not persisted, so an equivocating sender may have different votes exported before and after a restart.
track_historical_votes: boolTrack individual votes after certification.
By default, full vote evidence is released when the corresponding certificate is constructed or received, making later conflict reporting and peer blocking best effort. Enabling this retains each recorded vote until its round is pruned, increasing memory usage.
strategy: TStrategy for parallel operations.
partition: StringPartition for the consensus engine.
mailbox_size: NonZeroUsizeMaximum 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.
floor: Floor<S, D>Certified root for the consensus engine.
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.
page_cache: CacheRefPage cache for the journal.
leader_timeout: DurationAmount of time to wait for a leader to propose a payload in a view.
certification_timeout: DurationAmount of time to wait for certification progress in a view before attempting to skip the view.
This timeout must be greater than the leader timeout.
timeout_retry: DurationAmount of time to wait before retrying a nullify broadcast if stuck in a view.
view_retention: ViewDeltaNumber of views behind the finalized tip to track (in memory and in the journal) for recent activity.
skip: SkipPolicyPolicy governing whether nullify(v) may be broadcast before the normal round deadlines.
fetch_timeout: DurationTimeout to wait for a peer to respond to a request.
forward: ForwardPolicyPolicy for proactively forwarding blocks when entering the next view.
Implementations§
Auto Trait Implementations§
impl<S, L, B, D, A, R, F, T> !RefUnwindSafe for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> !UnwindSafe for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> Freeze for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> Send for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> Sync for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> Unpin for Config<S, L, B, D, A, R, F, T>
impl<S, L, B, D, A, R, F, T> UnsafeUnpin for Config<S, L, B, D, A, R, F, T>where
S: UnsafeUnpin,
L: UnsafeUnpin,
B: UnsafeUnpin,
A: UnsafeUnpin,
R: UnsafeUnpin,
F: UnsafeUnpin,
T: UnsafeUnpin,
Floor<S, D>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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