From 35d19c0cd6535a3d8d1e5860fd7c321cf1c42788 Mon Sep 17 00:00:00 2001 From: p0p3yee Date: Thu, 24 Oct 2024 12:38:49 -0400 Subject: [PATCH] Add comments --- x/keyshare/keeper/msg_override_pubkey.go | 1 + x/keyshare/module/module.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/x/keyshare/keeper/msg_override_pubkey.go b/x/keyshare/keeper/msg_override_pubkey.go index c9cff44f..11c25e63 100644 --- a/x/keyshare/keeper/msg_override_pubkey.go +++ b/x/keyshare/keeper/msg_override_pubkey.go @@ -51,6 +51,7 @@ func (k msgServer) OverrideLatestPubkey( encSharesExistsValidators[encShare.Validator] = true } + // Remove all validators in the set that not in the current epoch for _, v := range allValidatorSet { if _, exists := encSharesExistsValidators[v.Validator]; !exists { k.RemoveValidatorSet(ctx, v.Validator) diff --git a/x/keyshare/module/module.go b/x/keyshare/module/module.go index 121019d8..0e45d07f 100644 --- a/x/keyshare/module/module.go +++ b/x/keyshare/module/module.go @@ -244,6 +244,9 @@ func (am AppModule) BeginBlock(cctx context.Context) error { for _, v := range qk.EncryptedKeyshares { am.keeper.SetLastSubmittedHeight(ctx, v.Validator, strconv.FormatInt(ctx.BlockHeight(), 10)) } + + // We don't need to remove the validators that not in the new round from the set + // They won't be slashed because of the new slashing idle validators logic } am.keeper.DeleteQueuedPubkey(ctx) am.pepKeeper.DeleteQueuedPubkey(ctx)