Skip to content

Commit 1ec1ea8

Browse files
committed
Do not submit DKG result if it has no minimum number of signatures
It does not make sense to submit result with less signatures than the on-chain contract expects. And the on-chain contract expects 25% safety margin.
1 parent f292b9c commit 1ec1ea8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/beacon/relay/dkg/result/submission.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,15 @@ func (sm *SubmittingMember) SubmitDKGResult(
6161
)
6262
}
6363

64-
if len(signatures) < config.HonestThreshold {
64+
// Chain rejects the result if it has less than 25% safety margin.
65+
// If there are not enough signatures to preserve the margin, it does not
66+
// make sense to submit the result.
67+
signatureThreshold := config.HonestThreshold + (config.GroupSize-config.HonestThreshold)/2
68+
if len(signatures) < signatureThreshold {
6569
return fmt.Errorf(
66-
"could not submit result with [%v] signatures for honest threshold [%v]",
70+
"could not submit result with [%v] signatures for signature threshold [%v]",
6771
len(signatures),
68-
config.HonestThreshold,
72+
signatureThreshold,
6973
)
7074
}
7175

0 commit comments

Comments
 (0)