Skip to content

Commit 5cef50c

Browse files
tweak uniformVoteWeight to match the logic in stakedVoteWeight by using GT to check Quorum
1 parent 390ae76 commit 5cef50c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

consensus/quorum/one-node-one-vote.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type uniformVoteWeight struct {
2323

2424
lastPowerSignersCountCache map[Phase]int64
2525
lastParticipantsCount int64
26+
27+
useGTforQuorumChecking bool
2628
}
2729

2830
// Policy ..
@@ -60,7 +62,11 @@ func (v *uniformVoteWeight) IsQuorumAchievedByMask(mask *bls_cosi.Mask) bool {
6062
}
6163
threshold := v.TwoThirdsSignersCount()
6264
currentTotalPower := utils.CountOneBits(mask.Bitmap)
63-
if currentTotalPower < threshold {
65+
enoughVotingPower := currentTotalPower >= threshold
66+
if v.useGTforQuorumChecking {
67+
enoughVotingPower = currentTotalPower > threshold
68+
}
69+
if !enoughVotingPower {
6470
const msg = "[IsQuorumAchievedByMask] Not enough voting power: need %+v, have %+v"
6571
utils.Logger().Warn().Msgf(msg, threshold, currentTotalPower)
6672
return false

0 commit comments

Comments
 (0)