From a4f4d9c41257b515452aaf2217d4df8a44baf62a Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Fri, 3 May 2024 14:08:31 +0200 Subject: [PATCH] Modified the required number of signatures during inactivity claim --- pkg/protocol/inactivity/member.go | 5 ++--- pkg/protocol/inactivity/states.go | 21 ++++++++------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/pkg/protocol/inactivity/member.go b/pkg/protocol/inactivity/member.go index e993a7a7c3..7720fc7112 100644 --- a/pkg/protocol/inactivity/member.go +++ b/pkg/protocol/inactivity/member.go @@ -37,9 +37,8 @@ func newSigningMember( sessionID string, ) *signingMember { return &signingMember{ - logger: logger, - memberIndex: memberIndex, - // TODO: Check is this is a correct way to create the group. + logger: logger, + memberIndex: memberIndex, group: group.NewGroup(dishonestThreshold, groupSize), membershipValidator: membershipValidator, sessionID: sessionID, diff --git a/pkg/protocol/inactivity/states.go b/pkg/protocol/inactivity/states.go index 6574cf79f9..ef97e482bb 100644 --- a/pkg/protocol/inactivity/states.go +++ b/pkg/protocol/inactivity/states.go @@ -80,19 +80,14 @@ func (css *claimSigningState) Receive(netMessage net.Message) error { } func (css *claimSigningState) CanTransition() bool { - // Although there is no hard requirement to expect signature messages - // from all participants, it makes sense to do so because this is an - // additional participant availability check that allows to maximize - // the final count of active participants. Moreover, this check does not - // bound the signing state to a fixed duration and one can move to the - // next state as soon as possible. - messagingDone := len(receivedMessages[*claimSignatureMessage](css.BaseAsyncState)) == - len(css.member.group.OperatingMemberIndexes())-1 - - // TODO: Modify the above code so that only 51 members are needed. Since it - // is executed after a failed heartbeat, we cannot expect all the - // members to sign the claim. In the future consider taking the number - // of active signers from the heartbeat procedure. + // Require the number of received signatures to be at least the honest + // threshold. Unlike in the case of DKG, we cannot expect all the members to + // participate in signing as we know we are dealing with some problem + // arising from operator inactivity. + // TODO: Consider passing the number of required signatures from the code + // that launched the inactivity operator execution. + messagingDone := len(receivedMessages[*claimSignatureMessage](css.BaseAsyncState)) >= + css.member.group.HonestThreshold() return messagingDone }