Expand description
Leader election strategies for simplex consensus.
This module provides the Config and Elector traits for customizing
how leaders are selected for each consensus round, along with built-in implementations.
§Built-in Electors
-
RoundRobin/RoundRobinElector: Deterministic rotation through participants based on view number. Optionally shuffled using a seed. Works with any signing scheme. -
Random/RandomElector: Uses randomness derived from BLS threshold VRF signatures for unpredictable leader selection. Falls back to round-robin for the first view (no certificate available). Requiressuper::scheme::bls12381_threshold::vrf(implementssuper::scheme::bls12381_threshold::vrf::Seedable).
§Custom Electors
Applications can implement Config and Elector for custom leader
selection logic such as stake-weighted selection or other application-specific strategies.
§Usage
Users configure leader election with an elector Config (for example,
RoundRobin) and pass it to the consensus configuration. Consensus builds
the initialized Elector with the scheme participants before starting.
Structs§
- Random
- Configuration for leader election using threshold signature randomness.
- Random
Elector - Initialized random leader elector using threshold signature randomness.
- Round
Robin - Configuration for round-robin leader election.
- Round
Robin Elector - Initialized round-robin leader elector.
- Terms
- Leadership term structure reported by an
Elector.
Enums§
- Random
Version - Signature-to-leader mapping used by
Random.