From a42f3440c08e1839a6cfd66eb202d12bea520687 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 11 Nov 2024 19:55:44 +0100 Subject: [PATCH 1/2] feat!: enable unjail on pre-ccv chains --- x/ccv/consumer/keeper/validators.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index 4386bb7b86..859434a95b 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -179,7 +179,13 @@ func (k Keeper) Jail(context.Context, sdk.ConsAddress) error { return nil } // This method should be a no-op even during a standalone to consumer changeover. // Once the upgrade has happened as a part of the changeover, // the provider validator set will soon be in effect, and jailing is n/a. -func (k Keeper) Unjail(context.Context, sdk.ConsAddress) error { return nil } +func (k Keeper) Unjail(sdkCtx context.Context, addr sdk.ConsAddress) error { + ctx := sdk.UnwrapSDKContext(sdkCtx) + if k.IsPrevStandaloneChain(ctx) && k.ChangeoverIsComplete(ctx) && k.standaloneStakingKeeper != nil { + return k.standaloneStakingKeeper.Unjail(ctx, addr) + } + return nil +} // Delegation - unimplemented on CCV keeper func (k Keeper) Delegation(ctx context.Context, addr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.DelegationI, error) { From f7ceecc5ea8bc4c8afae3559bd969f5d2521eab0 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 11 Nov 2024 19:57:37 +0100 Subject: [PATCH 2/2] docs: update docstrings --- x/ccv/consumer/keeper/validators.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index 859434a95b..70b2d20a33 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -174,11 +174,9 @@ func (k Keeper) SlashWithInfractionReason(goCtx context.Context, addr sdk.ConsAd // the provider validator set will soon be in effect, and jailing is n/a. func (k Keeper) Jail(context.Context, sdk.ConsAddress) error { return nil } -// Unjail - unimplemented on CCV keeper +// Unjail is enabled for previously standalone chains after the changeover is complete. // -// This method should be a no-op even during a standalone to consumer changeover. -// Once the upgrade has happened as a part of the changeover, -// the provider validator set will soon be in effect, and jailing is n/a. +// This method should be a no-op for consumer chains that launched with the CCV module first. func (k Keeper) Unjail(sdkCtx context.Context, addr sdk.ConsAddress) error { ctx := sdk.UnwrapSDKContext(sdkCtx) if k.IsPrevStandaloneChain(ctx) && k.ChangeoverIsComplete(ctx) && k.standaloneStakingKeeper != nil {