Config

Struct Config 

Source
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: S

Signing 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: L

Leader 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: B

Blocker for the network.

Blocking is handled by commonware_p2p.

§automaton: A

Automaton for the consensus engine.

§relay: R

Relay for the consensus engine.

§reporter: F

Reporter 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: String

Partition for the consensus engine.

§mailbox_size: usize

Maximum number of messages to buffer on channels inside the consensus engine before blocking.

§epoch: Epoch

Epoch 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: NonZeroUsize

Number of bytes to buffer when replaying during startup.

§write_buffer: NonZeroUsize

The size of the write buffer to use for each blob in the journal.

§buffer_pool: PoolRef

Buffer pool for the journal.

§leader_timeout: Duration

Amount of time to wait for a leader to propose a payload in a view.

§notarization_timeout: Duration

Amount of time to wait for a quorum of notarizations in a view before attempting to skip the view.

§nullify_retry: Duration

Amount of time to wait before retrying a nullify broadcast if stuck in a view.

§activity_timeout: ViewDelta

Number of views behind finalized tip to track and persist activity derived from validator messages.

§skip_timeout: ViewDelta

Move 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: Duration

Timeout to wait for a peer to respond to a request.

§fetch_concurrent: usize

Number of concurrent requests to make at once.

Implementations§

Source§

impl<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>>> Config<S, L, B, D, A, R, F>

Source

pub fn assert(&self)

Assert enforces that all configuration values are valid.

Auto Trait Implementations§

§

impl<S, L, B, D, A, R, F> Freeze for Config<S, L, B, D, A, R, F>
where S: Freeze, L: Freeze, B: Freeze, A: Freeze, R: Freeze, F: Freeze,

§

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>
where L: Sync, B: Sync, A: Sync, R: Sync, F: Sync,

§

impl<S, L, B, D, A, R, F> Unpin for Config<S, L, B, D, A, R, F>
where S: Unpin, L: Unpin, B: Unpin, A: Unpin, R: Unpin, F: Unpin,

§

impl<S, L, B, D, A, R, F> !UnwindSafe for Config<S, L, B, D, A, R, F>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,