Skip to main content

Module vote

Module vote 

Source
Expand description

Per-view vote collection and certificate formation.

Votes for views arrive concurrently, and each view is tallied on its own until it crosses a threshold and forms a certificate. VoteCollector owns the machinery common to every kind of vote, inspecting each vote only through the Ballot trait. It creates a task per view and voted epoch and routes votes to the appropriate task, drops duplicate and stale votes, buffers votes whose epoch is not yet resolved, and GCs decided views. How a task actually combines votes into an output is delegated to a pluggable Tally strategy.

Modules§

accumulate 🔒

Structs§

EpochRootTally
Accumulates epoch-root Vote1s into the (quorum, state) certificate pair.
SimpleTally
Accumulates votes into a single Certificate via a CheckedAccumulator.
TimeoutTally
Accumulates TimeoutBallots into a TimeoutCertificate3 once their signers’ combined stake reaches the threshold Th.
VoteCollector
Collects votes per view and epoch and forms certificate(s) using the strategy S.
VoteStats
What a single view and epoch has collected.

Traits§

Ballot
Information about a vote.
Tally
How to count votes to form a certificate.

Functions§

run_tally 🔒

Type Aliases§

EpochRootCerts
The quorum and light-client state certificates formed at an epoch-root view.
Key 🔒
What a tally is keyed by: the view and the epoch.
UpgradeTally
Accumulates UpgradeVote2s into an UpgradeCertificate2, under the epoch the votes bind.