Skip to content

[WIP] Integrate Peras voting committee into BlockSupportsPeras#2045

Draft
agustinmista wants to merge 4 commits into
peras/degenerate-peras-instancesfrom
peras/voting-committee-in-ledger-state
Draft

[WIP] Integrate Peras voting committee into BlockSupportsPeras#2045
agustinmista wants to merge 4 commits into
peras/degenerate-peras-instancesfrom
peras/voting-committee-in-ledger-state

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 agustinmista self-assigned this May 19, 2026
@agustinmista agustinmista marked this pull request as draft May 19, 2026 13:48
@agustinmista agustinmista changed the base branch from main to peras/degenerate-peras-instances May 19, 2026 13:49
@agustinmista agustinmista force-pushed the peras/voting-committee-in-ledger-state branch from 5c58bb3 to bd79f29 Compare May 20, 2026 10:11
@agustinmista agustinmista force-pushed the peras/voting-committee-in-ledger-state branch from bd79f29 to 22a8618 Compare May 21, 2026 14:12
@agustinmista agustinmista changed the title [WIP] Peras voting committee in ShelleyLedgerState [WIP] Peras voting committee adapter May 21, 2026
@agustinmista agustinmista force-pushed the peras/voting-committee-in-ledger-state branch from 83c605d to 187c468 Compare May 22, 2026 08:39
@agustinmista agustinmista changed the title [WIP] Peras voting committee adapter [WIP] Integrating Peras voting committee into BlockSupportsPeras May 22, 2026
@agustinmista agustinmista changed the title [WIP] Integrating Peras voting committee into BlockSupportsPeras [WIP] Integrate Peras voting committee into BlockSupportsPeras May 22, 2026
@tbagrel1
Copy link
Copy Markdown
Contributor

tbagrel1 commented May 22, 2026

Next steps:

  • Merge PerasVoteStake and VoteWeight (and eliminate the current coerce in implForgePerasVoteIfElligible
  • Make sure eligiblePartyVoteWeight returns a normalized VoteWeight and add corresponding docstring
  • Merge (Peras)SeatIndex and PerasVoterId
  • Unify VotesReachingQuorum and UniqueVotesWithSameTarget
  • Write blk-generic instances for implForgePerasCert, implVerifyPerasVote, implVerifyPerasCert as we did for implForgePerasVoteIfElligible
  • Modify the interface for forgePerasCert, verifyPerasVote, verifyPerasCert and adapt calling code (this should make PerasVoteStakeDistr useless, and we should be able to remove)
  • Make forgePerasVoteIfElligible part of BlockSupportsPeras
  • Include the new type families and corresponding superclass constraints as part of BlockSupportsPeras
  • Remove instance of BlockSupportPeras for RealBlock from Praos/Peras.hs and instead use the code to provide concrete instances for ShelleyBlock proto DijkstraEra and HardForkBlock xs
  • Move getStakeDistrWithBLSPublicKeys and perasBLSPublicKeysFromEnv out of Praos/Peras.hs
  • Introduce IsPerasError class to gather the injectXXXError :: XXX -> PerasError blk functions and instance it
  • Add committee target size as part of PerasParams and use it in praosStatePerasVotingCommitteeInput. Also (re)-export the dedicated type from PerasParams

@tbagrel1
Copy link
Copy Markdown
Contributor

Future steps for another PR:

  • Have some machinery getCommitteeForRound :: PerasRoundNo -> Maybe (PerasVotingCommittee blk), which involves running Qry/Summary and doing epoch dispatch for the committee (so far it can be simple: just check the supplied PerasRoundNo corresponds to the current epoch, and return the current committee from Praos state)
  • Decide if we want components to interact with getCommitteeForRound and feed the obtained committee into BlockSupportsPeras method, or if we want another layer of abstraction laying near PraosState that would do the resolution for them (exposing methods similar to BlockSupportsPeras, but where the Committee argument is no longer there, and either replaced with PraosState, or capturing a handle to PraosState so dispatch can happen transparently)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store Peras voting committee composition in the Ledger state

2 participants