IntersectMBO / IntersectMBO/cardano-ledger

Add Peras related protocol parameters

Open
#5,966 3 comments 0 reactions 0 assignees Claimed by @agustinmista View on GitHub
DijkstraEra Peras
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

Here is a [list of protocol parameters](https://cips.cardano.org/cip/CIP-0140#protocol-parameters) that we will need to add for Peras. Note that all of their names are very different from the CIP, since they were named by mathematicians and are not suitable for an actual implementation.

Other important notes:

* Some of the parameters depend on a type that is yet to be added: https://github.com/IntersectMBO/cardano-base/issues/692
* For governance purposes all of the protocol parameters being added fall under `NetworkGroup :: DRepGroup` and `SecurityGroup :: DRepGroup`
* TODO: figure out the actual type for `PerasRounds`?, for now `Word32` is the safest bet.

Below is the actual list of protocol parameters to be added:

* [ ] - The `U` parameter is the duration of each voting round.
`ppPerasVotingPeriodLength :: Lens' (PParams era) SlotInterval`
* [ ] - The `L` parameter is the minimum age of a candidate block for being voted upon.
`ppPerasMinCandidateBlockAge :: Lens' (PParams era) SlotInterval`
* [ ] - The `A` parameter is the maximum age for a certificate to be included in a block, measured in rounds.
`ppPerasMaxCertAge :: Lens' (PParams era) PerasRounds`
* [ ] - The `R` parameter is the number of rounds for which to ignore certificates after entering a cool-down period.
`ppPerasCertMinIgnorePeriod :: Lens' (PParams era) PerasRounds`
* [ ] - The `K` parameter is the minimum number of rounds to wait before voting again after a cool-down period starts.
`ppPerasMinWaitPeriod` :: Lens' (PParams era) PerasRounds`
* [ ] - The `B` parameter is the extra chain weight that a certificate (a quorum of votes) imparts to a block.
`ppPerasExtraChainWeight` :: Lens' (PParams era) ?`
**TODO: Clarify the type.**
* [ ] - The `τ` parameter is the number of votes (the quorum) required to create a certificate.
`ppPerasQuorumStakeThreshold` :: Lens' (PParams era) ?`.
**TODO: I suspect this will not be a number, but instead a `UnitInterval` as a proportion of Stake, but this needs to be clarified. In either case it cannot be a Natural as CIP alluded, since it is being compared to a fractional number and without specified rounding strategy this is ambiguous.**

Contributor guide

Open the contributing guide

Research direction

Start with the PParams era lenses and the related type work in cardano-base issue 692, then compare the seven listed names and meanings with CIP-0140. Confirm the types for PerasRounds, extra chain weight, and quorum stake threshold before implementing the parameters under NetworkGroup :: DRepGroup and SecurityGroup :: DRepGroup; done means all seven parameters are represented with agreed types.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.