-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: disable ibc upgrade proposal handler (#2574)
The proposal handler to upgrade IBC also invokes the standard `ScheduleUpgrade` within the upgrading module. See https://github.com/cosmos/ibc-go/blob/e2201aaf1b016356bbd40fcdc17988437adce5ae/modules/core/02-client/keeper/proposal.go#L82. This effectively means that one can create a governance proposal to upgrade the chain which is something we didn't want to support. As there is no need to handle updating the IBC client yet, this temporarily disables the proposal type. (cherry picked from commit 03b83f8)
- Loading branch information
1 parent
0b76b2c
commit 926c4f3
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package app | ||
|
||
import ( | ||
"cosmossdk.io/errors" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" | ||
|
||
"github.com/cosmos/ibc-go/v6/modules/core/02-client/keeper" | ||
"github.com/cosmos/ibc-go/v6/modules/core/02-client/types" | ||
) | ||
|
||
// NewClientProposalHandler defines the 02-client proposal handler. It disables the | ||
// UpgradeProposalType. Handling of updating the IBC Client will be done in v2 of the | ||
// app. | ||
func NewClientProposalHandler(k keeper.Keeper) govtypes.Handler { | ||
return func(ctx sdk.Context, content govtypes.Content) error { | ||
switch c := content.(type) { | ||
case *types.ClientUpdateProposal: | ||
return k.ClientUpdateProposal(ctx, c) | ||
case *types.UpgradeProposal: | ||
return errors.Wrap(sdkerrors.ErrInvalidRequest, "ibc upgrade proposal not supported") | ||
|
||
default: | ||
return errors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ibc proposal content type: %T", c) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters