diff --git a/docs/migrations/v7-to-v8.md b/docs/migrations/v7-to-v8.md index f6b15ff4eed..8059c6cc7eb 100644 --- a/docs/migrations/v7-to-v8.md +++ b/docs/migrations/v7-to-v8.md @@ -47,13 +47,12 @@ TODO: https://github.com/cosmos/ibc-go/pull/3505 (extra parameter added to trans ) ``` -- You should pass the `authority` to the IBC keeper. ([#3640](https://github.com/cosmos/ibc-go/pull/3640)) See [diff](https://github.com/cosmos/ibc-go/pull/3640/files#diff-d18972debee5e64f16e40807b2ae112ddbe609504a93ea5e1c80a5d489c3a08a). +- You should pass the `authority` to the IBC keeper. ([#3640](https://github.com/cosmos/ibc-go/pull/3640) and [#3650](https://github.com/cosmos/ibc-go/pull/3650)) See [diff](https://github.com/cosmos/ibc-go/pull/3640/files#diff-d18972debee5e64f16e40807b2ae112ddbe609504a93ea5e1c80a5d489c3a08a). ```diff // app.go // IBC Keepers - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), diff --git a/e2e/tests/core/03-connection/connection_test.go b/e2e/tests/core/03-connection/connection_test.go index 0898f99a8af..991b44d6d1d 100644 --- a/e2e/tests/core/03-connection/connection_test.go +++ b/e2e/tests/core/03-connection/connection_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsproposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/strangelove-ventures/interchaintest/v7/ibc" test "github.com/strangelove-ventures/interchaintest/v7/testutil" @@ -30,6 +31,13 @@ type ConnectionTestSuite struct { // QueryMaxExpectedTimePerBlockParam queries the on-chain max expected time per block param for 03-connection func (s *ConnectionTestSuite) QueryMaxExpectedTimePerBlockParam(ctx context.Context, chain ibc.Chain) uint64 { + if testvalues.SelfParamsFeatureReleases.IsSupported(chain.Config().Images[0].Version) { + queryClient := s.GetChainGRCPClients(chain).ConnectionQueryClient + res, err := queryClient.ConnectionParams(ctx, &connectiontypes.QueryConnectionParamsRequest{}) + s.Require().NoError(err) + + return res.Params.MaxExpectedTimePerBlock + } queryClient := s.GetChainGRCPClients(chain).ParamsQueryClient res, err := queryClient.Params(ctx, ¶msproposaltypes.QueryParamsRequest{ Subspace: ibcexported.ModuleName, @@ -52,6 +60,7 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() { relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) chainA, chainB := s.GetChains() + chainAVersion := chainA.Config().Images[0].Version chainBDenom := chainB.Config().Denom chainAIBCToken := testsuite.GetIBCToken(chainBDenom, channelA.PortID, channelA.ChannelID) @@ -65,19 +74,27 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("ensure delay is set to the default of 30 seconds", func(t *testing.T) { - expectedDelay := uint64(30 * time.Second) delay := s.QueryMaxExpectedTimePerBlockParam(ctx, chainA) - s.Require().Equal(expectedDelay, delay) + s.Require().Equal(uint64(connectiontypes.DefaultTimePerBlock), delay) }) t.Run("change the delay to 60 seconds", func(t *testing.T) { - delay := fmt.Sprintf(`"%d"`, 1*time.Minute) - changes := []paramsproposaltypes.ParamChange{ - paramsproposaltypes.NewParamChange(ibcexported.ModuleName, string(connectiontypes.KeyMaxExpectedTimePerBlock), delay), - } + delay := uint64(1 * time.Minute) + if testvalues.SelfParamsFeatureReleases.IsSupported(chainAVersion) { + authority, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) + s.Require().NoError(err) + s.Require().NotNil(authority) + + msg := connectiontypes.NewMsgUpdateParams(authority.String(), connectiontypes.NewParams(delay)) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet, 1) + } else { + changes := []paramsproposaltypes.ParamChange{ + paramsproposaltypes.NewParamChange(ibcexported.ModuleName, string(connectiontypes.KeyMaxExpectedTimePerBlock), fmt.Sprintf(`"%d"`, delay)), + } - proposal := paramsproposaltypes.NewParameterChangeProposal(ibctesting.Title, ibctesting.Description, changes) - s.ExecuteGovProposal(ctx, chainA, chainAWallet, proposal) + proposal := paramsproposaltypes.NewParameterChangeProposal(ibctesting.Title, ibctesting.Description, changes) + s.ExecuteGovProposal(ctx, chainA, chainAWallet, proposal) + } }) t.Run("validate the param was successfully changed", func(t *testing.T) { diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 901c5e9b1a8..a8d4b2215c2 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -245,7 +245,7 @@ func (s *TransferTestSuite) TestSendEnabledParam() { chainBAddress := chainBWallet.FormattedAddress() chainAVersion := chainA.Config().Images[0].Version - isSelfManagingParams := testvalues.TransferSelfParamsFeatureReleases.IsSupported(chainAVersion) + isSelfManagingParams := testvalues.SelfParamsFeatureReleases.IsSupported(chainAVersion) govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) s.Require().NoError(err) @@ -308,7 +308,7 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { ) chainAVersion := chainA.Config().Images[0].Version - isSelfManagingParams := testvalues.TransferSelfParamsFeatureReleases.IsSupported(chainAVersion) + isSelfManagingParams := testvalues.SelfParamsFeatureReleases.IsSupported(chainAVersion) govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) s.Require().NoError(err) diff --git a/e2e/testvalues/values.go b/e2e/testvalues/values.go index fa033787ce5..9c0695746e3 100644 --- a/e2e/testvalues/values.go +++ b/e2e/testvalues/values.go @@ -67,7 +67,7 @@ var IcadNewGenesisCommandsFeatureReleases = semverutil.FeatureReleases{ } // TransferSelfParamsFeatureReleases represents the releases the transfer module started managing its own params. -var TransferSelfParamsFeatureReleases = semverutil.FeatureReleases{ +var SelfParamsFeatureReleases = semverutil.FeatureReleases{ MajorVersion: "v8", } diff --git a/modules/core/03-connection/keeper/keeper.go b/modules/core/03-connection/keeper/keeper.go index 4e763c3302b..ee37f913ef0 100644 --- a/modules/core/03-connection/keeper/keeper.go +++ b/modules/core/03-connection/keeper/keeper.go @@ -20,24 +20,24 @@ type Keeper struct { // implements gRPC QueryServer interface types.QueryServer - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace - cdc codec.BinaryCodec - clientKeeper types.ClientKeeper + storeKey storetypes.StoreKey + legacySubspace paramtypes.Subspace + cdc codec.BinaryCodec + clientKeeper types.ClientKeeper } // NewKeeper creates a new IBC connection Keeper instance -func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, ck types.ClientKeeper) Keeper { +func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace paramtypes.Subspace, ck types.ClientKeeper) Keeper { // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + if !legacySubspace.HasKeyTable() { + legacySubspace = legacySubspace.WithKeyTable(types.ParamKeyTable()) } return Keeper{ - storeKey: key, - cdc: cdc, - paramSpace: paramSpace, - clientKeeper: ck, + storeKey: key, + cdc: cdc, + legacySubspace: legacySubspace, + clientKeeper: ck, } } @@ -221,3 +221,23 @@ func (k Keeper) addConnectionToClient(ctx sdk.Context, clientID, connectionID st k.SetClientConnectionPaths(ctx, clientID, conns) return nil } + +// GetParams returns the total set of ibc-connection parameters. +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + store := ctx.KVStore(k.storeKey) + bz := store.Get([]byte(types.ParamsKey)) + if bz == nil { // only panic on unset params and not on empty params + panic("connection params are not set in store") + } + + var params types.Params + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the total set of ibc-connection parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(¶ms) + store.Set([]byte(types.ParamsKey), bz) +} diff --git a/modules/core/03-connection/keeper/keeper_test.go b/modules/core/03-connection/keeper/keeper_test.go index dbae331d690..5f4e5b3f244 100644 --- a/modules/core/03-connection/keeper/keeper_test.go +++ b/modules/core/03-connection/keeper/keeper_test.go @@ -176,3 +176,55 @@ func (suite *KeeperTestSuite) TestLocalhostConnectionEndCreation() { expectedCounterParty := types.NewCounterparty(exported.LocalhostClientID, exported.LocalhostConnectionID, commitmenttypes.NewMerklePrefix(connectionKeeper.GetCommitmentPrefix().Bytes())) suite.Require().Equal(expectedCounterParty, connectionEnd.Counterparty) } + +// TestDefaultSetParams tests the default params set are what is expected +func (suite *KeeperTestSuite) TestDefaultSetParams() { + expParams := types.DefaultParams() + + params := suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) + suite.Require().Equal(expParams, params) +} + +// TestParams tests that param setting and retrieval works properly +func (suite *KeeperTestSuite) TestSetAndGetParams() { + testCases := []struct { + name string + input types.Params + expPass bool + }{ + {"success: set default params", types.DefaultParams(), true}, + {"success: valid value for MaxExpectedTimePerBlock", types.NewParams(10), true}, + {"failure: invalid value for MaxExpectedTimePerBlock", types.NewParams(0), false}, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + ctx := suite.chainA.GetContext() + err := tc.input.Validate() + suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.SetParams(ctx, tc.input) + if tc.expPass { + suite.Require().NoError(err) + expected := tc.input + p := suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.GetParams(ctx) + suite.Require().Equal(expected, p) + } else { + suite.Require().Error(err) + } + }) + } +} + +// TestUnsetParams tests that trying to get params that are not set panics. +func (suite *KeeperTestSuite) TestUnsetParams() { + suite.SetupTest() + ctx := suite.chainA.GetContext() + store := ctx.KVStore(suite.chainA.GetSimApp().GetKey(exported.StoreKey)) + store.Delete([]byte(types.ParamsKey)) + + suite.Require().Panics(func() { + suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.GetParams(ctx) + }) +} diff --git a/modules/core/03-connection/keeper/migrations.go b/modules/core/03-connection/keeper/migrations.go index 9965eab28ca..49eb5ff41a6 100644 --- a/modules/core/03-connection/keeper/migrations.go +++ b/modules/core/03-connection/keeper/migrations.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" connectionv7 "github.com/cosmos/ibc-go/v7/modules/core/03-connection/migrations/v7" + "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" ) // Migrator is a struct for handling in-place store migrations. @@ -22,3 +23,17 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { connectionv7.MigrateLocalhostConnection(ctx, m.keeper) return nil } + +// MigrateParams migrates from consensus version 4 to 5. +// This migration takes the parameters that are currently stored and managed by x/params +// and stores them directly in the ibc module's state. +func (m Migrator) MigrateParams(ctx sdk.Context) error { + var params types.Params + m.keeper.legacySubspace.GetParamSet(ctx, ¶ms) + + if err := params.Validate(); err != nil { + return err + } + m.keeper.SetParams(ctx, params) + return nil +} diff --git a/modules/core/03-connection/keeper/migrations_test.go b/modules/core/03-connection/keeper/migrations_test.go new file mode 100644 index 00000000000..d3d87361668 --- /dev/null +++ b/modules/core/03-connection/keeper/migrations_test.go @@ -0,0 +1,43 @@ +package keeper_test + +import ( + "github.com/cosmos/ibc-go/v7/modules/core/03-connection/keeper" + "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" +) + +// TestMigrateParams tests that the params for the connection are properly migrated +func (suite *KeeperTestSuite) TestMigrateParams() { + testCases := []struct { + name string + malleate func() + expectedParams types.Params + }{ + { + "success: default params", + func() { + params := types.DefaultParams() + subspace := suite.chainA.GetSimApp().GetSubspace(ibcexported.ModuleName) + subspace.SetParamSet(suite.chainA.GetContext(), ¶ms) // set params + }, + types.DefaultParams(), + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + tc.malleate() + + ctx := suite.chainA.GetContext() + migrator := keeper.NewMigrator(suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper) + err := migrator.MigrateParams(ctx) + suite.Require().NoError(err) + + params := suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.GetParams(ctx) + suite.Require().Equal(tc.expectedParams, params) + }) + } +} diff --git a/modules/core/03-connection/keeper/params.go b/modules/core/03-connection/keeper/params.go deleted file mode 100644 index 8723d5d7246..00000000000 --- a/modules/core/03-connection/keeper/params.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" -) - -// GetMaxExpectedTimePerBlock retrieves the maximum expected time per block from the paramstore -func (k Keeper) GetMaxExpectedTimePerBlock(ctx sdk.Context) uint64 { - var res uint64 - k.paramSpace.Get(ctx, types.KeyMaxExpectedTimePerBlock, &res) - return res -} - -// GetParams returns the total set of ibc-connection parameters. -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams(k.GetMaxExpectedTimePerBlock(ctx)) -} - -// SetParams sets the total set of ibc-connection parameters. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} diff --git a/modules/core/03-connection/keeper/params_test.go b/modules/core/03-connection/keeper/params_test.go deleted file mode 100644 index 30450beb528..00000000000 --- a/modules/core/03-connection/keeper/params_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper_test - -import ( - "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" -) - -func (suite *KeeperTestSuite) TestParams() { - expParams := types.DefaultParams() - - params := suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) - suite.Require().Equal(expParams, params) - - expParams.MaxExpectedTimePerBlock = 10 - suite.chainA.App.GetIBCKeeper().ConnectionKeeper.SetParams(suite.chainA.GetContext(), expParams) - _ = suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) - suite.Require().Equal(uint64(10), expParams.MaxExpectedTimePerBlock) -} diff --git a/modules/core/03-connection/keeper/verify.go b/modules/core/03-connection/keeper/verify.go index 735347e80a5..c1316fb9ea2 100644 --- a/modules/core/03-connection/keeper/verify.go +++ b/modules/core/03-connection/keeper/verify.go @@ -369,7 +369,7 @@ func (k Keeper) VerifyNextSequenceRecv( func (k Keeper) getBlockDelay(ctx sdk.Context, connection exported.ConnectionI) uint64 { // expectedTimePerBlock should never be zero, however if it is then return a 0 blcok delay for safety // as the expectedTimePerBlock parameter was not set. - expectedTimePerBlock := k.GetMaxExpectedTimePerBlock(ctx) + expectedTimePerBlock := k.GetParams(ctx).MaxExpectedTimePerBlock if expectedTimePerBlock == 0 { return 0 } diff --git a/modules/core/03-connection/types/codec.go b/modules/core/03-connection/types/codec.go index 8f6ad752fbf..d6c1c1b2693 100644 --- a/modules/core/03-connection/types/codec.go +++ b/modules/core/03-connection/types/codec.go @@ -33,6 +33,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgConnectionOpenTry{}, &MsgConnectionOpenAck{}, &MsgConnectionOpenConfirm{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/modules/core/03-connection/types/keys.go b/modules/core/03-connection/types/keys.go index 1b0b5132d90..cad76caf4ad 100644 --- a/modules/core/03-connection/types/keys.go +++ b/modules/core/03-connection/types/keys.go @@ -28,6 +28,9 @@ const ( // ConnectionPrefix is the prefix used when creating a connection identifier ConnectionPrefix = "connection-" + + // ParamsKey is the store key for the IBC connection parameters + ParamsKey = "connectionParams" ) // FormatConnectionIdentifier returns the connection identifier with the sequence appended. diff --git a/modules/core/03-connection/types/msgs.go b/modules/core/03-connection/types/msgs.go index 0ea08c2a565..bacfe83c9e9 100644 --- a/modules/core/03-connection/types/msgs.go +++ b/modules/core/03-connection/types/msgs.go @@ -17,6 +17,7 @@ var ( _ sdk.Msg = (*MsgConnectionOpenConfirm)(nil) _ sdk.Msg = (*MsgConnectionOpenAck)(nil) _ sdk.Msg = (*MsgConnectionOpenTry)(nil) + _ sdk.Msg = (*MsgUpdateParams)(nil) _ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenTry)(nil) _ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenAck)(nil) @@ -289,3 +290,28 @@ func (msg MsgConnectionOpenConfirm) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{accAddr} } + +// NewMsgUpdateParams creates a new MsgUpdateParams instance +func NewMsgUpdateParams(authority string, params Params) *MsgUpdateParams { + return &MsgUpdateParams{ + Authority: authority, + Params: params, + } +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + accAddr, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic(err) + } + return []sdk.AccAddress{accAddr} +} + +// ValidateBasic performs basic checks on a MsgUpdateParams. +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrapf(ibcerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) + } + return msg.Params.Validate() +} diff --git a/modules/core/03-connection/types/msgs_test.go b/modules/core/03-connection/types/msgs_test.go index 61041342bd4..df19129a6c9 100644 --- a/modules/core/03-connection/types/msgs_test.go +++ b/modules/core/03-connection/types/msgs_test.go @@ -231,3 +231,38 @@ func (suite *MsgTestSuite) TestNewMsgConnectionOpenConfirm() { } } } + +// TestMsgUpdateParams_ValidateBasic tests ValidateBasic for MsgUpdateParams +func (suite *MsgTestSuite) TestMsgUpdateParams_ValidateBasic() { + authority := suite.chainA.App.GetIBCKeeper().GetAuthority() + testCases := []struct { + name string + msg *types.MsgUpdateParams + expPass bool + }{ + { + "success: valid authority and params", + types.NewMsgUpdateParams(authority, types.DefaultParams()), + true, + }, + { + "failure: invalid authority address", + types.NewMsgUpdateParams("invalid", types.DefaultParams()), + false, + }, + { + "failure: invalid time per block", + types.NewMsgUpdateParams(authority, types.NewParams(0)), + false, + }, + } + + for _, tc := range testCases { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.Require().NoError(err, "valid case %s failed", tc.name) + } else { + suite.Require().Error(err, "invalid case %s passed", tc.name) + } + } +} diff --git a/modules/core/03-connection/types/params.go b/modules/core/03-connection/types/params.go index 35677062fdb..bca180757d9 100644 --- a/modules/core/03-connection/types/params.go +++ b/modules/core/03-connection/types/params.go @@ -3,21 +3,11 @@ package types import ( "fmt" "time" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // DefaultTimePerBlock is the default value for maximum expected time per block (in nanoseconds). const DefaultTimePerBlock = 30 * time.Second -// KeyMaxExpectedTimePerBlock is store's key for MaxExpectedTimePerBlock parameter -var KeyMaxExpectedTimePerBlock = []byte("MaxExpectedTimePerBlock") - -// ParamKeyTable type declaration for parameters -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - // NewParams creates a new parameter configuration for the ibc connection module func NewParams(timePerBlock uint64) Params { return Params{ @@ -37,18 +27,3 @@ func (p Params) Validate() error { } return nil } - -// ParamSetPairs implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyMaxExpectedTimePerBlock, p.MaxExpectedTimePerBlock, validateParams), - } -} - -func validateParams(i interface{}) error { - _, ok := i.(uint64) - if !ok { - return fmt.Errorf("invalid parameter. expected %T, got type: %T", uint64(1), i) - } - return nil -} diff --git a/modules/core/03-connection/types/params_legacy.go b/modules/core/03-connection/types/params_legacy.go new file mode 100644 index 00000000000..c57c3e359e5 --- /dev/null +++ b/modules/core/03-connection/types/params_legacy.go @@ -0,0 +1,36 @@ +/* +NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov +controlled execution of MsgUpdateParams messages. These types remains solely +for migration purposes and will be removed in a future release. +[#3621](https://github.com/cosmos/ibc-go/issues/3621) +*/ +package types + +import ( + fmt "fmt" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// KeyMaxExpectedTimePerBlock is store's key for MaxExpectedTimePerBlock parameter +var KeyMaxExpectedTimePerBlock = []byte("MaxExpectedTimePerBlock") + +// ParamKeyTable type declaration for parameters +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// ParamSetPairs implements params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyMaxExpectedTimePerBlock, &p.MaxExpectedTimePerBlock, validateParams), + } +} + +func validateParams(i interface{}) error { + _, ok := i.(uint64) + if !ok { + return fmt.Errorf("invalid parameter. expected %T, got type: %T", uint64(1), i) + } + return nil +} diff --git a/modules/core/03-connection/types/tx.pb.go b/modules/core/03-connection/types/tx.pb.go index e1cbf6903b7..be7cf0c1e24 100644 --- a/modules/core/03-connection/types/tx.pb.go +++ b/modules/core/03-connection/types/tx.pb.go @@ -378,6 +378,100 @@ func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{8} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{9} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") @@ -387,66 +481,74 @@ func init() { proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "ibc.core.connection.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "ibc.core.connection.v1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("ibc/core/connection/v1/tx.proto", fileDescriptor_5d00fde5fc97399e) } var fileDescriptor_5d00fde5fc97399e = []byte{ - // 864 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x6e, 0xeb, 0x44, - 0x14, 0xc6, 0xe3, 0xc6, 0x49, 0x93, 0x49, 0x2e, 0x17, 0x86, 0xb4, 0x35,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, 0xc1, 0x9f, 0x04, 0xb0, 0x12, 0xcd, 0xd9, 0x6e, 0xec, 0x7a, 0x7e, - 0x86, 0x7c, 0xb4, 0x68, 0x46, 0xe0, 0x42, 0x4e, 0x5d, 0x3f, 0xdd, 0x6e, 0x0b, 0x27, 0x97, 0x77, - 0x0f, 0x45, 0xe1, 0xfe, 0xa1, 0x28, 0xfc, 0xfd, 0x50, 0x14, 0x7e, 0x7d, 0x2c, 0x26, 0xee, 0x1f, - 0x8b, 0x89, 0x3f, 0x1f, 0x8b, 0x89, 0x6f, 0x8f, 0x0d, 0xec, 0x74, 0x06, 0x2d, 0x45, 0x27, 0x7d, - 0xd5, 0xff, 0x76, 0xc4, 0x2d, 0x7d, 0xc7, 0x20, 0xea, 0xf0, 0x50, 0xed, 0x93, 0xf6, 0xa0, 0x87, - 0x28, 0xff, 0xf6, 0xdb, 0x3d, 0xd8, 0x09, 0x7d, 0xfe, 0x39, 0xae, 0x85, 0x68, 0x2b, 0xcd, 0xde, - 0x77, 0x07, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xad, 0x10, 0xac, 0xa8, 0xc6, 0x0a, 0x00, 0x00, + // 948 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xc7, 0xbd, 0x89, 0xed, 0xc4, 0x8f, 0xdd, 0x06, 0x06, 0x27, 0xd9, 0x6e, 0x5b, 0xdb, 0x35, + 0x48, 0x89, 0x2a, 0xb2, 0xdb, 0xb4, 0xa0, 0x96, 0x92, 0x4b, 0xe2, 0x0b, 0x11, 0x0a, 0x54, 0x4b, + 0xe8, 0x81, 0x8b, 0x65, 0xaf, 0x37, 0xeb, 0x51, 0xe2, 0x9d, 0xd5, 0xce, 0xd8, 0xb0, 0x48, 0x48, + 0x08, 0x2e, 0xdc, 0xe0, 0x23, 0xf4, 0x23, 0xf4, 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7e, 0xee, 0x58, + 0xc7, 0x7e, 0xa0, 0x7d, 0xb0, 0x88, 0x7a, 0xfe, 0xc2, 0x21, 0x41, 0xf9, 0x17, 0xde, 0xb7, 0x4e, + 0x17, 0x58, 0x38, 0xb5, 0x09, 0xd0, 0x8f, 0x0a, 0xac, 0x67, 0xef, 0x80, 0x7b, 0xb9, 0xe3, 0x49, + 0x0f, 0xed, 0xd1, 0xa2, 0x1e, 0x71, 0x16, 0x3e, 0x6c, 0x08, 0x26, 0x12, 0x99, 0x84, 0x73, 0xeb, + 0x35, 0x31, 0xd3, 0x18, 0x69, 0x46, 0x4e, 0x61, 0xb4, 0xa6, 0x56, 0xfa, 0xfe, 0xd5, 0xf3, 0xbb, + 0xca, 0xc1, 0xd3, 0x17, 0xe7, 0x0d, 0xe5, 0xe5, 0x79, 0x43, 0xf9, 0xeb, 0xbc, 0xa1, 0xfc, 0x72, + 0xd1, 0x28, 0xbc, 0xbc, 0x68, 0x14, 0xfe, 0xb8, 0x68, 0x14, 0xbe, 0xda, 0x73, 0x30, 0x1b, 0x8e, + 0xfb, 0xba, 0x45, 0x46, 0x86, 0xbc, 0x49, 0xe3, 0xbe, 0xb5, 0xe3, 0x10, 0x63, 0xf2, 0xd0, 0x18, + 0x91, 0xc1, 0xf8, 0xcc, 0xa6, 0xe2, 0x26, 0x7c, 0xef, 0xc1, 0x4e, 0xea, 0x32, 0xcc, 0x02, 0xcf, + 0xa6, 0xfd, 0x32, 0xff, 0xfb, 0x3f, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x09, 0xa7, 0xf6, + 0xd4, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -470,6 +572,9 @@ type MsgClient interface { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + UpdateConnectionParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -516,6 +621,15 @@ func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnection return out, nil } +func (c *msgClient) UpdateConnectionParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/UpdateConnectionParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. @@ -527,6 +641,9 @@ type MsgServer interface { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + UpdateConnectionParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -545,6 +662,9 @@ func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgCo func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") } +func (*UnimplementedMsgServer) UpdateConnectionParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConnectionParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -622,6 +742,24 @@ func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Msg_UpdateConnectionParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateConnectionParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/UpdateConnectionParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateConnectionParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.connection.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -642,6 +780,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ConnectionOpenConfirm", Handler: _Msg_ConnectionOpenConfirm_Handler, }, + { + MethodName: "UpdateConnectionParams", + Handler: _Msg_UpdateConnectionParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ibc/core/connection/v1/tx.proto", @@ -1106,6 +1248,69 @@ func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1307,6 +1512,30 @@ func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2786,6 +3015,171 @@ func (m *MsgConnectionOpenConfirmResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/keeper/keeper.go b/modules/core/keeper/keeper.go index 1eefcdc2b3d..fb2583a72c4 100644 --- a/modules/core/keeper/keeper.go +++ b/modules/core/keeper/keeper.go @@ -95,7 +95,7 @@ func (k *Keeper) SetRouter(rtr *porttypes.Router) { k.Router.Seal() } -// GetAuthority returns the client submodule's authority. +// GetAuthority returns the ibc module's authority. func (k Keeper) GetAuthority() string { return k.authority } diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index c6544fd0cd7..c75f11b8d87 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -706,3 +706,15 @@ func (k Keeper) UpdateClientParams(goCtx context.Context, msg *clienttypes.MsgUp return &clienttypes.MsgUpdateParamsResponse{}, nil } + +// UpdateConnectionParams defines a rpc handler method for MsgUpdateParams for the 03-connection submodule. +func (k Keeper) UpdateConnectionParams(goCtx context.Context, msg *connectiontypes.MsgUpdateParams) (*connectiontypes.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != msg.Authority { + return nil, errorsmod.Wrapf(ibcerrors.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.ConnectionKeeper.SetParams(ctx, msg.Params) + + return &connectiontypes.MsgUpdateParamsResponse{}, nil +} diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index 2dde4db00fb..e1acbe74f1f 100644 --- a/modules/core/keeper/msg_server_test.go +++ b/modules/core/keeper/msg_server_test.go @@ -5,6 +5,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" @@ -825,3 +826,54 @@ func (suite *KeeperTestSuite) TestUpdateClientParams() { }) } } + +// TestUpdateConnectionParams tests the UpdateConnectionParams rpc handler +func (suite *KeeperTestSuite) TestUpdateConnectionParams() { + validAuthority := suite.chainA.App.GetIBCKeeper().GetAuthority() + testCases := []struct { + name string + msg *connectiontypes.MsgUpdateParams + expPass bool + }{ + { + "success: valid authority and default params", + connectiontypes.NewMsgUpdateParams(validAuthority, connectiontypes.DefaultParams()), + true, + }, + { + "failure: malformed authority address", + connectiontypes.NewMsgUpdateParams(ibctesting.InvalidID, connectiontypes.DefaultParams()), + false, + }, + { + "failure: empty authority address", + connectiontypes.NewMsgUpdateParams("", connectiontypes.DefaultParams()), + false, + }, + { + "failure: whitespace authority address", + connectiontypes.NewMsgUpdateParams(" ", connectiontypes.DefaultParams()), + false, + }, + { + "failure: unauthorized authority address", + connectiontypes.NewMsgUpdateParams(ibctesting.TestAccAddress, connectiontypes.DefaultParams()), + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + _, err := keeper.Keeper.UpdateConnectionParams(*suite.chainA.App.GetIBCKeeper(), suite.chainA.GetContext(), tc.msg) + if tc.expPass { + suite.Require().NoError(err) + p := suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) + suite.Require().Equal(tc.msg.Params, p) + } else { + suite.Require().Error(err) + } + }) + } +} diff --git a/modules/core/module.go b/modules/core/module.go index 1abee13facd..08bec4991fb 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -138,7 +138,13 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { panic(err) } - if err := cfg.RegisterMigration(exported.ModuleName, 4, clientMigrator.MigrateParams); err != nil { + if err := cfg.RegisterMigration(exported.ModuleName, 4, func(ctx sdk.Context) error { + if err := clientMigrator.MigrateParams(ctx); err != nil { + return err + } + + return connectionMigrator.MigrateParams(ctx) + }); err != nil { panic(err) } } diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto index 5125da1ef99..f1aaeea7b67 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -26,6 +26,10 @@ service Msg { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + rpc UpdateConnectionParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgConnectionOpenInit defines the msg sent by an account on Chain A to @@ -126,3 +130,19 @@ message MsgConnectionOpenConfirm { // MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm // response type. message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file