Skip to content

[Peras 23] wFA^LS and EveryoneVotes voting committee implementations#1975

Merged
agustinmista merged 5 commits into
mainfrom
peras/wfals-everyonevotes-implementations
May 5, 2026
Merged

[Peras 23] wFA^LS and EveryoneVotes voting committee implementations#1975
agustinmista merged 5 commits into
mainfrom
peras/wfals-everyonevotes-implementations

Conversation

@agustinmista
Copy link
Copy Markdown
Contributor

@agustinmista agustinmista commented Apr 13, 2026

This PR implements two concrete voting committee strategies:

  1. Weighted Fait-Accompli with Local Sortition (WFALS), and
  2. A simpler one where every pool with positive stake can vote (EveryoneVotes)

While Peras will use WFALS at the beginning, EveryoneVotes serves as a baseline for future benchmarks, as well as a starting point for Leios shall they end up opting for a simpler approach.

NOTES:

  • WFALS depends on two separate sub-componenents:

    • WFA: the pure weighted Fait-Accompli seat split algorithm, which relies on an "extended stake distribution" ExtWFAStakeDistr (a sorted array of pools with cumulative stake). The latter can be precomputed at the beginning of an epoch and shared across multiple voting committees (e.g. shared between Leios and Peras).
    • LS: the Local Sortition check for non-persistent voters, mapping their VRF outputs into seats sampled through a Poisson distribution.
  • For simplicity, EveryoneVotes reuses the same ExtWFAStakeDistr as WFALS. This way, if Leios is instantiated with EveryoneVotes, it could still use the same precomputed data as Peras.

  • Both voting committee implementations defined their own abstract vote and certificate type and it's up to the clients to marshal between these types and their concrete ones (possibly using the same underlying representation and serialization routines)

@agustinmista agustinmista self-assigned this Apr 13, 2026
@agustinmista agustinmista marked this pull request as ready for review April 13, 2026 12:00
@dnadales dnadales moved this to 🗓️ Next up in Consensus Team Backlog Apr 13, 2026
@dnadales dnadales self-assigned this Apr 13, 2026
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 4fcfdf3 to 19f3766 Compare April 14, 2026 07:48
@agustinmista agustinmista force-pushed the peras/generic-voting-committee-api branch from d6a1575 to 8ead4f4 Compare April 14, 2026 07:48
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 19f3766 to 9c10f37 Compare April 14, 2026 14:04
@agustinmista agustinmista force-pushed the peras/generic-voting-committee-api branch from 8ead4f4 to 7381729 Compare April 14, 2026 14:04
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 9c10f37 to 9bd7727 Compare April 15, 2026 12:44
@agustinmista agustinmista force-pushed the peras/generic-voting-committee-api branch from 7381729 to 047702c Compare April 15, 2026 12:44
@tbagrel1 tbagrel1 force-pushed the peras/generic-voting-committee-api branch from 047702c to c5b05a6 Compare April 20, 2026 07:37
Base automatically changed from peras/generic-voting-committee-api to main April 20, 2026 08:47
@qnikst qnikst linked an issue Apr 21, 2026 that may be closed by this pull request
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 9bd7727 to ddbf3ee Compare April 21, 2026 09:53
Array
SeatIndex
( PoolId -- Voter ID of this voter
, a -- Extra payload associated to this voter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give an example here (eg pubkey I guess?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not I understand what you would like to see here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant an example of the extra payload associated to the voter (I don't know if pubkey is one such example).

Comment thread ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Committee/WFA.hs Outdated
Comment thread ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Committee/WFA.hs Outdated
Comment thread ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Committee/WFA.hs Outdated
Comment thread ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Committee/LS.hs Outdated
@jasagredo jasagredo moved this from 🗓️ Next up to 👀 In review in Consensus Team Backlog Apr 24, 2026
Copy link
Copy Markdown
Member

@dnadales dnadales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the round of fixes.

One follow-up worth surfacing: with UniqueVotesWithSameTarget from #2020 closing the type-level dedup hazard, the remaining caller contract — cmpVotes must order Eq on shared SeatIndex for both WFALS and EveryoneVotes Vote constructors — will need to be wired correctly at the Peras integration site. Worth adding this to a production-readiness tracker (new or existing).

Copy link
Copy Markdown
Member

@dnadales dnadales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the round of fixes.

@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 544897f to 8fa80b6 Compare May 4, 2026 17:34
@agustinmista agustinmista force-pushed the peras/unique-votes-with-same-target branch from 2165523 to 663a8cb Compare May 4, 2026 17:34
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 8fa80b6 to 3fe34cd Compare May 5, 2026 07:04
@agustinmista agustinmista force-pushed the peras/unique-votes-with-same-target branch from 663a8cb to 3c84f5e Compare May 5, 2026 07:04
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 3fe34cd to 465919f Compare May 5, 2026 09:27
@agustinmista agustinmista force-pushed the peras/unique-votes-with-same-target branch from 3c84f5e to 93a201b Compare May 5, 2026 09:27
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 465919f to 1e8dc62 Compare May 5, 2026 13:11
@agustinmista agustinmista force-pushed the peras/unique-votes-with-same-target branch from 93a201b to 8915540 Compare May 5, 2026 13:11
@agustinmista agustinmista force-pushed the peras/wfals-everyonevotes-implementations branch from 1e8dc62 to ff292c6 Compare May 5, 2026 14:12
@agustinmista agustinmista force-pushed the peras/unique-votes-with-same-target branch from 8915540 to 54452b6 Compare May 5, 2026 14:12
Base automatically changed from peras/unique-votes-with-same-target to main May 5, 2026 15:52
agustinmista and others added 5 commits May 5, 2026 17:56
This commit implements the deterministic core of the weighted
Fait-Accompli algorithm using a precomputed extended stake distribution,
shareable across multiple voting committees running on the same epoch.

The implementation includes a tiebreaker mechanism to allow altering the
order of pools with the same stake when the threshold index between
persistent and non-persistent voters would land between them. This can
later be instantiated to allow for a fair split across epochs.

Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
This commit implements the local sortition fallback scheme needed by
wFA^LS to allocate non-persistent voters. Each non-persistent voter
provides a VRF output that gets normalized and compared against the
output of a numerically-stable stake-weighted Poisson distribution.

Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
This commit defined the weighted Fait-Accompli with local soritition
voting scheme (WFALS) using the separate WFA and LS components. This
includes the definition of both persistent and non-pesistent abstract
votes and abstract certificates.

NOTE: it is the job of the low-level vote and certificate implementation
to provide the plumbing needed to convert between abstract and concrete
values, possibly allowing the same concrete definitions to work with
multiple voting commitee implementations.

Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
This commit implements EveryoneVotes a simpler alternative to WFALS
where every voter with non-negative stake is entitled to vote. This
exists as a baseline to run benchmarks against later on.

Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Template Vote and Cert Cryptography Voting Committee selection logic Implement committee selection schemes

4 participants