From 85f47b73fe8653e06f05d426bb667a361c8c5786 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Tue, 5 Sep 2023 12:52:58 -0400 Subject: [PATCH] fix!: ignore key shares for deactivated chains for unbonding checks (#1994) --- x/ante/ante.go | 4 ++++ x/ante/types/expected_keepers.go | 1 + 2 files changed, 5 insertions(+) diff --git a/x/ante/ante.go b/x/ante/ante.go index 484c2b510..80f842805 100644 --- a/x/ante/ante.go +++ b/x/ante/ante.go @@ -107,6 +107,10 @@ func (d UndelegateDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate boo chains := d.nexus.GetChains(ctx) for _, chain := range chains { + if !d.nexus.IsChainActivated(ctx, chain) { + continue + } + nextKeyID, idFound := d.multiSig.GetNextKeyID(ctx, chain.Name) key, keyFound := d.multiSig.GetKey(ctx, nextKeyID) if idFound && keyFound && !key.GetWeight(valAddress).IsZero() { diff --git a/x/ante/types/expected_keepers.go b/x/ante/types/expected_keepers.go index d834f5279..2b2c78739 100644 --- a/x/ante/types/expected_keepers.go +++ b/x/ante/types/expected_keepers.go @@ -22,6 +22,7 @@ type MultiSig interface { // Nexus provides access to the nexus functionality type Nexus interface { GetChains(ctx sdk.Context) []nexus.Chain + IsChainActivated(ctx sdk.Context, chain nexus.Chain) bool } // Snapshotter provides access to the snapshot functionality