pub struct Config<P: PublicKey, S: Scheme, B: Blocker<PublicKey = P>, D: Digest, A: Automaton<Context = Context<D, P>>, R: Relay, F: Reporter<Activity = Activity<S, D>>> {Show 21 fields
pub scheme: S,
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: View,
pub skip_timeout: View,
pub fetch_timeout: Duration,
pub max_fetch_count: usize,
pub fetch_rate_per_peer: Quota,
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.
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::signing_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: ViewNumber of views behind finalized tip to track and persist activity derived from validator messages.
skip_timeout: ViewMove to nullify immediately if the selected leader has been inactive for this many views.
This number should be less than or equal to activity_timeout (how
many views we are tracking).
fetch_timeout: DurationTimeout to wait for a peer to respond to a request.
max_fetch_count: usizeMaximum number of notarizations/nullifications to request/respond with at once.
fetch_rate_per_peer: QuotaMaximum rate of requests to send to a given peer.
Inbound rate limiting is handled by commonware_p2p.
fetch_concurrent: usizeNumber of concurrent requests to make at once.
Implementations§
Auto Trait Implementations§
impl<P, S, B, D, A, R, F> Freeze for Config<P, S, B, D, A, R, F>
impl<P, S, B, D, A, R, F> !RefUnwindSafe for Config<P, S, B, D, A, R, F>
impl<P, S, B, D, A, R, F> Send for Config<P, S, B, D, A, R, F>
impl<P, S, B, D, A, R, F> Sync for Config<P, S, B, D, A, R, F>
impl<P, S, B, D, A, R, F> Unpin for Config<P, S, B, D, A, R, F>
impl<P, S, B, D, A, R, F> !UnwindSafe for Config<P, S, B, D, A, R, F>
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> 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