IntersectMBO / IntersectMBO/cardano-ledger
SPO ratification takes less epochs than expected
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
The last part of test `StakePool/Rewards contribute to active voting stake even in the absence of StakeDistr` reads as follows:
```
-- The same vote should now successfully ratify the proposal
-- NOTE: It takes 2 epochs for SPO votes as opposed to 1 epoch
-- for DRep votes to ratify a proposal.
passNEpochs 2
getLastEnactedCommittee `shouldReturn` SJust (GovPurposeId addCCGaid)
```
Transforming the note into testable conditions:
```
diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs
index 40de5fb30..9dd7c5981 100644
--- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs
+++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs
@@ -1069,7 +1069,11 @@ votingSpec =
-- The same vote should now successfully ratify the proposal
-- NOTE: It takes 2 epochs for SPO votes as opposed to 1 epoch
-- for DRep votes to ratify a proposal.
- passNEpochs 2
+ passNEpochs 1
+ isSpoAccepted addCCGaid `shouldReturn` False
+ getLastEnactedCommittee `shouldReturn` SNothing
+ passNEpochs 1
+ isSpoAccepted addCCGaid `shouldReturn` True
getLastEnactedCommittee `shouldReturn` SJust (GovPurposeId addCCGaid)
describe "Proposal deposits contribute to active voting stake" $ do
it "Directly" $ whenPostBootstrap $ do
```
makes the test fail for protocol versions `10` and `11`.
Contributor guide
Research direction
Start with the votingSpec test in eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs and run the focused test for StakePool/Rewards. Compare the ratification and enactment results after each epoch for protocol versions 10 and 11. Done means the SPO vote timing matches the intended two-epoch behavior and the test passes for those versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- blockchain, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100