IntersectMBO / IntersectMBO/cardano-ledger
Inconsistent behavior wrt registration of hot credentials and voting for possible future CC members in PV >= 11
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
The current implementation allows a hot credential to be registered for a possible future CC member. The relevant code is in [Cardano.Ledger.Conway.Rules.GovCert](https://github.com/IntersectMBO/cardano-ledger/blob/7903c0074df4ecc2d96b780ca4e5299d2b866553/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/GovCert.hs#L203):
```haskell
let
committeeUpdateContainsColdCred GovActionState {gasProposalProcedure} =
case pProcGovAction gasProposalProcedure of
UpdateCommittee _ _ newMembers _ -> Map.member coldCred newMembers
_ -> False
isPotentialFutureMember =
any committeeUpdateContainsColdCred cgceCommitteeProposals
isCurrentMember || isPotentialFutureMember ?! (injectFailure . ConwayCommitteeIsUnknown) coldCred
```
however, at the same time it does not allow the hot credential to be used for voting. Only elected committee members are permitted to vote. The relevant code is in [Cardano.Ledger.Conway.Rules.Gov](https://github.com/IntersectMBO/cardano-ledger/blob/7903c0074df4ecc2d96b780ca4e5299d2b866553/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs#L478):
```haskell
failOnNonEmpty
(unelectedCommitteeVoters committee committeeState gsVotingProcedures)
(injectFailure . UnelectedCommitteeVoters)
```
[and](https://github.com/IntersectMBO/cardano-ledger/blob/7903c0074df4ecc2d96b780ca4e5299d2b866553/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs#L652):
```haskell
unelectedCommitteeVoters ::
StrictMaybe (Committee era) ->
CommitteeState era ->
VotingProcedures era ->
Set (Credential HotCommitteeRole)
unelectedCommitteeVoters committee committeeState =
let authorizedElectedCommittee = authorizedElectedHotCommitteeCredentials committee committeeState
collectUnelectedCommitteeVotes !unelectedHotCreds voter _ =
case voter of
CommitteeVoter hotCred
| hotCred `Set.notMember` authorizedElectedCommittee ->
Set.insert hotCred unelectedHotCreds
_ -> unelectedHotCreds
in Map.foldlWithKey' collectUnelectedCommitteeVotes Set.empty . unVotingProcedures
```
The tests introduced in #5883 attest to this behavior.
Contributor guide
Research direction
Start with Cardano.Ledger.Conway.Rules.GovCert.hs around the hot-credential registration check and Cardano.Ledger.Conway.Rules.Gov.hs around unelectedCommitteeVoters. Review the tests introduced in #5883 and the surrounding governance rules to determine the intended treatment of possible future committee members. Done means registration and voting behavior are consistent and the relevant tests capture that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100