Skip to content

Commit a97ac93

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 f5e1366 commit a97ac93

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
@@ -208,6 +208,7 @@ library
208208
Ouroboros.Consensus.NodeId
209209
Ouroboros.Consensus.Peras.Params
210210
Ouroboros.Consensus.Peras.SelectView
211+
Ouroboros.Consensus.Peras.Voting
211212
Ouroboros.Consensus.Peras.Weight
212213
Ouroboros.Consensus.Protocol.Abstract
213214
Ouroboros.Consensus.Protocol.BFT
@@ -614,6 +615,7 @@ test-suite consensus-test
614615
Test.Consensus.MiniProtocol.LocalStateQuery.Server
615616
Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke
616617
Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke
618+
Test.Consensus.Peras.Voting
617619
Test.Consensus.Peras.WeightSnapshot
618620
Test.Consensus.Util.MonadSTM.NormalForm
619621
Test.Consensus.Util.Pred

0 commit comments

Comments
 (0)