diff --git a/modules/core/04-channel/keeper/keeper.go b/modules/core/04-channel/keeper/keeper.go index ca6decba3d7..57b8d237314 100644 --- a/modules/core/04-channel/keeper/keeper.go +++ b/modules/core/04-channel/keeper/keeper.go @@ -535,10 +535,6 @@ func (k Keeper) ValidateUpgradeFields(ctx sdk.Context, proposedUpgrade types.Upg return errorsmod.Wrap(types.ErrChannelExists, "existing channel end is identical to proposed upgrade channel end") } - if !proposedUpgrade.Ordering.SubsetOf(currentFields.Ordering) { - return errorsmod.Wrap(types.ErrInvalidChannelOrdering, "channel ordering must be a subset of the new ordering") - } - connectionID := proposedUpgrade.ConnectionHops[0] connection, err := k.GetConnection(ctx, connectionID) if err != nil { diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index 8f0c6e9b6cf..3e19ce93928 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -513,13 +513,6 @@ func (suite *KeeperTestSuite) TestValidateProposedUpgradeFields() { }, expPass: true, }, - { - name: "fails with stricter ordering", - malleate: func() { - proposedUpgrade.Ordering = types.ORDERED - }, - expPass: false, - }, { name: "fails with unmodified fields", malleate: func() {}, diff --git a/modules/core/04-channel/keeper/upgrade_test.go b/modules/core/04-channel/keeper/upgrade_test.go index d01319cd61f..d7d1b602f8c 100644 --- a/modules/core/04-channel/keeper/upgrade_test.go +++ b/modules/core/04-channel/keeper/upgrade_test.go @@ -86,13 +86,6 @@ func (suite *KeeperTestSuite) TestChanUpgradeInit() { }, false, }, - { - "stricter proposed channel upgrade ordering", - func() { - upgrade.Fields.Ordering = types.ORDERED - }, - false, - }, } for _, tc := range testCases { diff --git a/modules/core/04-channel/types/channel.go b/modules/core/04-channel/types/channel.go index e6cbd6fa38c..630272de01c 100644 --- a/modules/core/04-channel/types/channel.go +++ b/modules/core/04-channel/types/channel.go @@ -5,7 +5,6 @@ import ( errorsmod "cosmossdk.io/errors" - "github.com/cosmos/ibc-go/v7/internal/collections" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" "github.com/cosmos/ibc-go/v7/modules/core/exported" ) @@ -138,21 +137,6 @@ func (ic IdentifiedChannel) ValidateBasic() error { return channel.ValidateBasic() } -// orderSubsets defines a map of supported ordering subsets -var orderSubsets = map[Order][]Order{ - ORDERED: {UNORDERED, ORDERED}, - UNORDERED: {UNORDERED}, -} - -// SubsetOf returns true if Order is a valid subset of the provided parent Order. -func (o Order) SubsetOf(parentOrder Order) bool { - if supported, ok := orderSubsets[parentOrder]; ok { - return collections.Contains(o, supported) - } - - return false -} - // NewErrorReceipt returns an error receipt with the code from the provided error type stripped // out to ensure changes of the error message don't cause state machine breaking changes. func NewErrorReceipt(upgradeSequence uint64, err error) ErrorReceipt { diff --git a/modules/core/04-channel/types/channel_test.go b/modules/core/04-channel/types/channel_test.go index 9b9a89d3068..0817af7fc81 100644 --- a/modules/core/04-channel/types/channel_test.go +++ b/modules/core/04-channel/types/channel_test.go @@ -57,70 +57,3 @@ func TestCounterpartyValidateBasic(t *testing.T) { } } } - -func TestSubsetOf(t *testing.T) { - testCases := []struct { - name string - order types.Order - parentOrder types.Order - expPass bool - }{ - { - "ordered -> ordered", - types.ORDERED, - types.ORDERED, - true, - }, - { - "ordered -> unordered", - types.UNORDERED, - types.ORDERED, - true, - }, - { - "unordered -> unordered", - types.UNORDERED, - types.UNORDERED, - true, - }, - { - "unordered -> ordered", - types.ORDERED, - types.UNORDERED, - false, - }, - { - "none -> ordered", - types.ORDERED, - types.NONE, - false, - }, - { - "none -> unordered", - types.UNORDERED, - types.NONE, - false, - }, - { - "ordered -> none", - types.NONE, - types.ORDERED, - false, - }, - { - "unordered -> none", - types.NONE, - types.UNORDERED, - false, - }, - } - - for _, tc := range testCases { - ok := tc.order.SubsetOf(tc.parentOrder) - if tc.expPass { - require.True(t, ok, tc.name) - } else { - require.False(t, ok, tc.name) - } - } -}