Skip to content

Commit fd9444c

Browse files
committed
optimize liveness handling
1 parent e3e0d14 commit fd9444c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

x/dlc/keeper/tss.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func (k Keeper) DKGCompletedHandler(ctx sdk.Context, id uint64, ty string, inten
4646
func (k Keeper) DKGTimeoutHandler(ctx sdk.Context, id uint64, ty string, intent int32, absentParticipants []string) error {
4747
switch ty {
4848
case types.DKG_TYPE_NONCE:
49+
if len(absentParticipants) == len(k.tssKeeper.GetDKGRequest(ctx, id).Participants) {
50+
// remain current liveness if all participants are absent
51+
return nil
52+
}
53+
4954
for _, participant := range absentParticipants {
5055
liveness := k.GetOracleParticipantLiveness(ctx, participant)
5156
if liveness.LastDkgId > id {

x/dlc/types/expected_keepers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type StakingKeeper interface {
2626
// TSSKeeper defines the expected TSS keeper interface
2727
type TSSKeeper interface {
2828
AllowedDKGParticipants(ctx sdk.Context) []string
29+
GetDKGRequest(ctx sdk.Context, id uint64) *tsstypes.DKGRequest
2930

3031
InitiateDKG(ctx sdk.Context, module string, ty string, intent int32, participants []string, threshold uint32, batchSize uint32) *tsstypes.DKGRequest
3132
InitiateSigningRequest(ctx sdk.Context, module string, scopedId string, ty tsstypes.SigningType, intent int32, pubKey string, sigHashes []string, options *tsstypes.SigningOptions) *tsstypes.SigningRequest

0 commit comments

Comments
 (0)