Skip to content

[Peras 28] WIP implementing stateful voting committee handles#2002

Draft
agustinmista wants to merge 19 commits intoperas/concrete-certs-and-votesfrom
peras/voting-committee-handles
Draft

[Peras 28] WIP implementing stateful voting committee handles#2002
agustinmista wants to merge 19 commits intoperas/concrete-certs-and-votesfrom
peras/voting-committee-handles

Conversation

@agustinmista
Copy link
Copy Markdown
Contributor

Description

Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.

Also note that:

  • New code should be properly tested (even if it does not add new features).
  • The fix for a regression should include a test that reproduces said regression.

WARNING

To update your feature branch if it's stale, please rebase it manually on top of main. Don't update your feature branch by merging main into it. Your pull request will not pass CI if you do.

agustinmista and others added 19 commits April 21, 2026 11:48
This commit uses the previously defined BLS-based crypto helpers to
implement a TestCrypto scheme to be used by the upcoming property
tests for WFALS and EveryoneVotes.

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>
This commit defines some common test helpers used by the upcoming
property and conformance tests for both WFALS and EveryoneVotes.

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 reorganizes the existing model and conformance test
infrastructure for WFALS in anticipation to the the tests for the real
implementation implemented in the next commit.

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 adds conformance tests for the real WFALS implementation. In
particular, we chech that the real implementation matches both the
precomputed output of the rust prototype as well as the WFALS model
against random stake distributions and target committee sizes.

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 property tests for the real WFALS
implementation asserting that:

* votes cast by eligible voters are successfully verifiable under the
  same voting committee, and
* fake (illegal) votes are successfully rejected

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 property tests for the EveryoneVotes
implementation asserting that:

* votes cast by eligible voters are successfully verifiable under the
  same voting committee, and
* fake (illegal) votes are successfully rejected

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 adds property tests to validate the implementation of
ensureSameTarget, provided by the generic voting committee API.

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 adds property tests for the verification helpers for
provided to use along with trivial aggregate vote signatuures and
aggregate VRF outputs, which verify a collection of items by verifying
each on individually in a loop.

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 a compact bitmaps via ByteStrings, adapted from
the Leios voting committee demo package (leios-wfa-ls-demo):

https://github.com/cardano-scaling/leios-wfa-ls-demo/blob/main/leios-wfa-ls-demo/lib/Cardano/Leios/BitMapPV.hs

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit defines concrete data structures for Peras votes and certificates
using BLS signatures to represent vote/cert signatures as well as
non-persistent eligibility proofs.

In addition it defines serialization routines for both types, using a
compact bitmap representation in the case of certificates.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit defines a concrete PerasCrypto scheme using BLS signatures
to instantiate all the voting committee superclasses needed by the WFALS
and EveryoneVotes voting committee implementations.

Note that these instances are heavily inspired by the ones defined for
TestCrypto in the generic voting committee test-suite, albeit with
slightly different types and more documentation.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit implements conversion routines between the brand-new
(concrete) Peras votes and certificates and their corresponding
(abstract) voting committee counterparts.

This is done by introducing a `VotingCommitteeSupportsPeras` type class
to allow us to easily change the underlying voting committee
implementation via a proxy type.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit adds test helpers to aid with the definition of the upcoming
roundtrip properties for concrete Peras votes and certificates.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit adds property tests for the newly added bitmap library
asserting that both conversion from and/to indices as well as
serialization roundtrip correctly.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
This commit adds serialization roundtrip tests for the concrete Peras
votes and certificate types.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
…ommittee types

This commit adds conversion rountrip tests between concrete Peras votes
and certificates and their corresponding (abstract) counterparts in the
WFALS and EveryoneVotes voting committee implementations.

Notably, the roundtrip properties allow testing both total (WFALS) and partial
(EveryoneVotes) conversions, generating both good and bad cases and
contrasting them against their expected rountrip outcome.

Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
Co-authored-by: Agustin Mista <agustin.mista@moduscreate.com>
Co-authored-by: Thomas BAGREL <thomas.bagrel@tweag.io>
Co-authored-by: Nicolas BACQUEY <nicolas.bacquey@tweag.io>
@agustinmista agustinmista changed the title WIP implementing stateful voting committee handles [Peras 28] WIP implementing stateful voting committee handles Apr 22, 2026
@agustinmista agustinmista force-pushed the peras/concrete-certs-and-votes branch 3 times, most recently from b2af5bb to 25cb149 Compare April 24, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant