Skip to content

Commit 3130a1d

Browse files
committed
Add pure Peras Voting rules
With the currently selected generation sizes, we hit the different voting rules in a somewhat decent proportion, even against randomly generated functions as part of the PerasVotingView interface. ouroboros-consensus Peras Peras voting rules isPerasVotingAllowed: OK (1.55s) +++ OK, passed 10000 tests. Actual result (10000 in total): 60.29% NoVoteReason(VR-1A or VR-2A) 20.90% NoVoteReason(VR-1A or VR-2B) 9.60% VoteReason(VR-2A and VR-2B) 4.93% VoteReason(VR-1A and VR-1B) 2.67% NoVoteReason(VR-1B or VR-2A) 1.61% NoVoteReason(VR-1B or VR-2B) Should vote according to model (10000 in total): 85.47% False 14.53% True VR-(1A|1B|2A|2B) (10000 in total): 21.30% (False,True,False,False) 21.24% (False,False,False,False) 10.63% (False,False,True,False) 10.27% (False,True,True,False) 8.99% (False,False,False,True) 8.76% (False,True,False,True) 4.67% (False,True,True,True) 4.26% (False,False,True,True) 1.93% (True,False,False,False) 1.77% (True,True,False,False) 1.71% (True,True,True,False) 1.61% (True,False,True,False) 0.75% (True,True,True,True) 0.74% (True,False,False,True) 0.70% (True,True,False,True) 0.67% (True,False,True,True) VR-1A (10000 in total): 90.12% False 9.88% True VR-1B (10000 in total): 50.07% False 49.93% True VR-2A (10000 in total): 65.43% False 34.57% True VR-2B (10000 in total): 70.46% False 29.54% True
1 parent 3a76d32 commit 3130a1d

File tree

4 files changed

+724
-1
lines changed

4 files changed

+724
-1
lines changed

ouroboros-consensus/ouroboros-consensus.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ library
204204
Ouroboros.Consensus.Node.Serialisation
205205
Ouroboros.Consensus.NodeId
206206
Ouroboros.Consensus.Peras.SelectView
207+
Ouroboros.Consensus.Peras.Voting
207208
Ouroboros.Consensus.Peras.Weight
208209
Ouroboros.Consensus.Protocol.Abstract
209210
Ouroboros.Consensus.Protocol.BFT
@@ -672,6 +673,7 @@ test-suite consensus-test
672673
Test.Consensus.MiniProtocol.LocalStateQuery.Server
673674
Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke
674675
Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke
676+
Test.Consensus.Peras.Voting
675677
Test.Consensus.Peras.WeightSnapshot
676678
Test.Consensus.Util.MonadSTM.NormalForm
677679
Test.Consensus.Util.Pred

0 commit comments

Comments
 (0)