Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
Match computation of qual size with C++ (#90)
Browse files Browse the repository at this point in the history
* Add test for missing validator case

* Fix test

* Add test for dkg thresholds

* Match computation of qual size match c++
  • Loading branch information
jinmannwong authored Jun 19, 2020
1 parent a18abcb commit 892a1ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (dkg *DistributedKeyGeneration) receivedAllDryRuns() bool {

func (dkg *DistributedKeyGeneration) checkDryRuns() bool {
encodedOutput := ""
requiredPassSize := uint((2 * dkg.validators.Size()) / 3)
requiredPassSize := uint(dkg.validators.Size() - dkg.validators.Size()/3)
if requiredPassSize < dkg.threshold {
requiredPassSize = dkg.threshold
}
Expand All @@ -601,7 +601,7 @@ func (dkg *DistributedKeyGeneration) checkDryRuns() bool {
}

if len(encodedOutput) == 0 {
dkg.Logger.Error("checkDryRuns: not enought dry run signatures")
dkg.Logger.Error("checkDryRuns: not enought dry run signatures. Needed %v", requiredPassSize)
return false
}

Expand Down

0 comments on commit 892a1ff

Please sign in to comment.