diff --git a/docs/migrations/v7-to-v8.md b/docs/migrations/v7-to-v8.md index f6b15ff4eed7..8059c6cc7eb4 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/modules/core/03-connection/genesis.go b/modules/core/03-connection/genesis.go index df8fb28945e5..3a8cdf5d154d 100644 --- a/modules/core/03-connection/genesis.go +++ b/modules/core/03-connection/genesis.go @@ -1,6 +1,8 @@ package connection import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ibc-go/v7/modules/core/03-connection/keeper" @@ -18,6 +20,9 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, gs types.GenesisState) { k.SetClientConnectionPaths(ctx, connPaths.ClientId, connPaths.Paths) } k.SetNextConnectionSequence(ctx, gs.NextConnectionSequence) + if err := gs.Params.Validate(); err != nil { + panic(fmt.Sprintf("invalid ibc connection genesis state parameters: %v", err)) + } k.SetParams(ctx, gs.Params) k.CreateSentinelLocalhostConnection(ctx) diff --git a/modules/core/03-connection/keeper/keeper.go b/modules/core/03-connection/keeper/keeper.go index 4e763c3302b1..7469a7b26c2f 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 len(bz) == 0 { + return types.Params{} + } + + 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 dbae331d6903..2961c2ad4745 100644 --- a/modules/core/03-connection/keeper/keeper_test.go +++ b/modules/core/03-connection/keeper/keeper_test.go @@ -176,3 +176,53 @@ 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) TestParams() { + 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().Equal(suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.GetParams(ctx), types.Params{}) +} diff --git a/modules/core/03-connection/keeper/migrations.go b/modules/core/03-connection/keeper/migrations.go index 9965eab28ca0..49eb5ff41a65 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 000000000000..d3d87361668e --- /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 8723d5d7246c..000000000000 --- 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 30450beb5282..000000000000 --- 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 735347e80a5c..c1316fb9ea28 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 8f6ad752fbf0..70b326ab1f8b 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{}, + &MsgUpdateConnectionParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/modules/core/03-connection/types/keys.go b/modules/core/03-connection/types/keys.go index 1b0b5132d904..cad76caf4ad2 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 0ea08c2a5658..2fea697f6ee7 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 = (*MsgUpdateConnectionParams)(nil) _ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenTry)(nil) _ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenAck)(nil) @@ -289,3 +290,28 @@ func (msg MsgConnectionOpenConfirm) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{accAddr} } + +// NewMsgUpdateConnectionParams creates a new MsgUpdateConnectionParams instance +func NewMsgUpdateConnectionParams(authority string, params Params) *MsgUpdateConnectionParams { + return &MsgUpdateConnectionParams{ + Authority: authority, + Params: params, + } +} + +// GetSigners returns the expected signers for a MsgUpdateConnectionParams message. +func (msg *MsgUpdateConnectionParams) GetSigners() []sdk.AccAddress { + accAddr, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic(err) + } + return []sdk.AccAddress{accAddr} +} + +// ValidateBasic performs basic checks on a MsgUpdateConnectionParams. +func (msg *MsgUpdateConnectionParams) 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 61041342bd43..e1f2f85204ad 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() { } } } + +// TestMsgUpdateConnectionParams_ValidateBasic tests ValidateBasic for MsgUpdateConnectionParams +func (suite *MsgTestSuite) TestMsgUpdateConnectionParams_ValidateBasic() { + authority := suite.chainA.App.GetIBCKeeper().GetAuthority() + testCases := []struct { + name string + msg *types.MsgUpdateConnectionParams + expPass bool + }{ + { + "success: valid authority and params", + types.NewMsgUpdateConnectionParams(authority, types.DefaultParams()), + true, + }, + { + "failure: invalid authority address", + types.NewMsgUpdateConnectionParams("invalid", types.DefaultParams()), + false, + }, + { + "failure: invalid time per block", + types.NewMsgUpdateConnectionParams(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 35677062fdbd..bca180757d9c 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 000000000000..c57c3e359e56 --- /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 6d3d80ca3b6c..e7f141e1b7eb 100644 --- a/modules/core/03-connection/types/tx.pb.go +++ b/modules/core/03-connection/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -377,6 +378,100 @@ func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo +// MsgUpdateConnectionParams defines the sdk.Msg type to update the connection parameters. +type MsgUpdateConnectionParams struct { + // authority is the address of the governance account. + 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 *MsgUpdateConnectionParams) Reset() { *m = MsgUpdateConnectionParams{} } +func (m *MsgUpdateConnectionParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConnectionParams) ProtoMessage() {} +func (*MsgUpdateConnectionParams) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{8} +} +func (m *MsgUpdateConnectionParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateConnectionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateConnectionParams.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 *MsgUpdateConnectionParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConnectionParams.Merge(m, src) +} +func (m *MsgUpdateConnectionParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateConnectionParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConnectionParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateConnectionParams proto.InternalMessageInfo + +func (m *MsgUpdateConnectionParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateConnectionParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateConnectionParamsResponse defines the MsgUpdateConnectionParams response type. +type MsgUpdateConnectionParamsResponse struct { +} + +func (m *MsgUpdateConnectionParamsResponse) Reset() { *m = MsgUpdateConnectionParamsResponse{} } +func (m *MsgUpdateConnectionParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConnectionParamsResponse) ProtoMessage() {} +func (*MsgUpdateConnectionParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{9} +} +func (m *MsgUpdateConnectionParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateConnectionParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateConnectionParamsResponse.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 *MsgUpdateConnectionParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConnectionParamsResponse.Merge(m, src) +} +func (m *MsgUpdateConnectionParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateConnectionParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConnectionParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateConnectionParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") @@ -386,65 +481,73 @@ 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((*MsgUpdateConnectionParams)(nil), "ibc.core.connection.v1.MsgUpdateConnectionParams") + proto.RegisterType((*MsgUpdateConnectionParamsResponse)(nil), "ibc.core.connection.v1.MsgUpdateConnectionParamsResponse") } func init() { proto.RegisterFile("ibc/core/connection/v1/tx.proto", fileDescriptor_5d00fde5fc97399e) } var fileDescriptor_5d00fde5fc97399e = []byte{ - // 833 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4d, 0x6f, 0xda, 0x48, - 0x18, 0xc7, 0x71, 0x78, 0x09, 0x0c, 0x64, 0xb3, 0x3b, 0x22, 0x59, 0xaf, 0xb3, 0x01, 0xc2, 0xae, - 0x14, 0x0e, 0x1b, 0x3b, 0x2f, 0xbb, 0x4a, 0x76, 0x37, 0x17, 0xc2, 0xa5, 0x51, 0x95, 0x36, 0x72, - 0xa3, 0x1c, 0x7a, 0x41, 0x60, 0x26, 0x66, 0x04, 0x78, 0x2c, 0x8f, 0xa1, 0x75, 0xaf, 0xed, 0xa1, - 0xc7, 0x7e, 0x84, 0x7c, 0x97, 0x1e, 0x1a, 0xa9, 0x97, 0x1c, 0x7b, 0xaa, 0xaa, 0xe4, 0xd2, 0xaf, - 0xd0, 0x5b, 0xe5, 0x19, 0x1b, 0x0c, 0x98, 0xca, 0x84, 0x9b, 0xfd, 0xf8, 0xff, 0xbc, 0xff, 0xec, - 0x31, 0x28, 0xe2, 0xa6, 0xa6, 0x68, 0xc4, 0x42, 0x8a, 0x46, 0x0c, 0x03, 0x69, 0x36, 0x26, 0x86, - 0x32, 0xd8, 0x53, 0xec, 0x97, 0xb2, 0x69, 0x11, 0x9b, 0xc0, 0x75, 0xdc, 0xd4, 0x64, 0x57, 0x20, - 0x8f, 0x04, 0xf2, 0x60, 0x4f, 0xca, 0xeb, 0x44, 0x27, 0x4c, 0xa2, 0xb8, 0x57, 0x5c, 0x2d, 0xfd, - 0xa6, 0x13, 0xa2, 0x77, 0x91, 0xc2, 0xee, 0x9a, 0xfd, 0x2b, 0xa5, 0x61, 0x38, 0xde, 0xa3, 0x40, - 0xa6, 0x2e, 0x46, 0x86, 0xed, 0x66, 0xe1, 0x57, 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0xe7, 0x51, 0xcf, 0x4e, 0xec, - 0x2e, 0x27, 0x7a, 0xe2, 0xaa, 0xd6, 0x99, 0x23, 0x71, 0x80, 0x2f, 0xf8, 0x5a, 0x00, 0x6b, 0xe1, - 0x70, 0xed, 0x46, 0x8e, 0xe7, 0x79, 0x48, 0x47, 0xf3, 0x7a, 0xf8, 0x55, 0x9c, 0x5c, 0xde, 0xdc, - 0x15, 0x84, 0xdb, 0xbb, 0x82, 0xf0, 0xe5, 0xae, 0x20, 0xbc, 0xbb, 0x2f, 0xc4, 0x6e, 0xef, 0x0b, - 0xb1, 0x4f, 0xf7, 0x85, 0xd8, 0xf3, 0x63, 0x1d, 0xdb, 0xed, 0x7e, 0x53, 0xd6, 0x48, 0x4f, 0xd1, - 0x08, 0xed, 0x11, 0xaa, 0xe0, 0xa6, 0xb6, 0xa3, 0x13, 0x65, 0x70, 0xa8, 0xf4, 0x48, 0xab, 0xdf, - 0x45, 0x94, 0xff, 0xc8, 0xed, 0x1e, 0xec, 0x04, 0xfe, 0xe5, 0x6c, 0xc7, 0x44, 0xb4, 0x99, 0x62, - 0x9f, 0xb4, 0x83, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xc7, 0x72, 0x20, 0x7a, 0x0a, 0x00, - 0x00, + // 934 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xc7, 0x45, 0x5b, 0x92, 0xa5, 0x91, 0x92, 0xb4, 0x0b, 0xd9, 0x61, 0x98, 0x44, 0x92, 0x95, + 0x02, 0x31, 0x8a, 0x9a, 0x8c, 0x93, 0x16, 0xf9, 0xa8, 0x2f, 0xb6, 0x2e, 0x35, 0x0a, 0xb7, 0x06, + 0xeb, 0xe6, 0xd0, 0x8b, 0x40, 0x51, 0x6b, 0x8a, 0xb0, 0xc5, 0x25, 0xb8, 0x2b,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 0xe1, 0x5a, 0xc7, 0x9e, 0xaf, 0x7c, 0xbc, 0x8c, + 0x3a, 0xff, 0xc5, 0x01, 0x4b, 0xc5, 0x5f, 0xbc, 0x67, 0x9e, 0x2e, 0xf1, 0xe2, 0xd4, 0x76, 0x40, + 0x3f, 0x48, 0xb0, 0x9e, 0xbd, 0x17, 0x1e, 0x15, 0xae, 0x17, 0x66, 0x28, 0xcf, 0x96, 0xcd, 0x88, + 0x5d, 0xfc, 0x24, 0xc1, 0x46, 0x0e, 0xa7, 0x3b, 0xef, 0x28, 0x9a, 0x9d, 0xa2, 0x3c, 0x5f, 0x3a, + 0x25, 0x32, 0xb2, 0xff, 0xf2, 0xcd, 0x79, 0x5b, 0x7a, 0x7b, 0xde, 0x96, 0xfe, 0x39, 0x6f, 0x4b, + 0xbf, 0x5e, 0xb4, 0x4b, 0x6f, 0x2f, 0xda, 0xa5, 0xbf, 0x2e, 0xda, 0xa5, 0x6f, 0x76, 0x2d, 0x9b, + 0x8d, 0xa7, 0x43, 0xd5, 0x24, 0x13, 0x2d, 0xbc, 0x56, 0xdb, 0x43, 0x73, 0xdb, 0x22, 0xda, 0xec, + 0xa9, 0x36, 0x21, 0xa3, 0xe9, 0x19, 0xa6, 0xe2, 0x02, 0xfc, 0xe8, 0xc9, 0x76, 0xea, 0x0e, 0xcc, + 0x7c, 0x17, 0xd3, 0x61, 0x95, 0x1f, 0x05, 0x4f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xe7, + 0xeb, 0x71, 0xcb, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -468,6 +571,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 + // MsgUpdateConnectionParams. + UpdateConnectionParams(ctx context.Context, in *MsgUpdateConnectionParams, opts ...grpc.CallOption) (*MsgUpdateConnectionParamsResponse, error) } type msgClient struct { @@ -514,6 +620,15 @@ func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnection return out, nil } +func (c *msgClient) UpdateConnectionParams(ctx context.Context, in *MsgUpdateConnectionParams, opts ...grpc.CallOption) (*MsgUpdateConnectionParamsResponse, error) { + out := new(MsgUpdateConnectionParamsResponse) + 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. @@ -525,6 +640,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 + // MsgUpdateConnectionParams. + UpdateConnectionParams(context.Context, *MsgUpdateConnectionParams) (*MsgUpdateConnectionParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -543,6 +661,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 *MsgUpdateConnectionParams) (*MsgUpdateConnectionParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConnectionParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -620,6 +741,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(MsgUpdateConnectionParams) + 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.(*MsgUpdateConnectionParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.connection.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -640,6 +779,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", @@ -1104,6 +1247,69 @@ func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } +func (m *MsgUpdateConnectionParams) 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 *MsgUpdateConnectionParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateConnectionParams) 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 *MsgUpdateConnectionParamsResponse) 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 *MsgUpdateConnectionParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateConnectionParamsResponse) 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 @@ -1305,6 +1511,30 @@ func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { return n } +func (m *MsgUpdateConnectionParams) 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 *MsgUpdateConnectionParamsResponse) 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 } @@ -2784,6 +3014,171 @@ func (m *MsgConnectionOpenConfirmResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateConnectionParams) 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: MsgUpdateConnectionParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateConnectionParams: 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 *MsgUpdateConnectionParamsResponse) 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: MsgUpdateConnectionParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateConnectionParamsResponse: 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 1eefcdc2b3d0..8f6590380167 100644 --- a/modules/core/keeper/keeper.go +++ b/modules/core/keeper/keeper.go @@ -95,11 +95,6 @@ func (k *Keeper) SetRouter(rtr *porttypes.Router) { k.Router.Seal() } -// GetAuthority returns the client submodule's authority. -func (k Keeper) GetAuthority() string { - return k.authority -} - // isEmpty checks if the interface is an empty struct or a pointer pointing // to an empty struct func isEmpty(keeper interface{}) bool { @@ -115,3 +110,8 @@ func isEmpty(keeper interface{}) bool { } return false } + +// 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 b205462d70a9..cf881a03b92e 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.MsgUpdateClientParamsResponse{}, nil } + +// UpdateConnectionParams defines a rpc handler method for MsgUpdateConnectionParams. +func (k Keeper) UpdateConnectionParams(goCtx context.Context, msg *connectiontypes.MsgUpdateConnectionParams) (*connectiontypes.MsgUpdateConnectionParamsResponse, 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.MsgUpdateConnectionParamsResponse{}, nil +} diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index ab10dee7d80e..48dc0d18cc5b 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.MsgUpdateConnectionParams + expPass bool + }{ + { + "success: valid authority and default params", + connectiontypes.NewMsgUpdateConnectionParams(validAuthority, connectiontypes.DefaultParams()), + true, + }, + { + "failure: malformed authority address", + connectiontypes.NewMsgUpdateConnectionParams(ibctesting.InvalidID, connectiontypes.DefaultParams()), + false, + }, + { + "failure: empty authority address", + connectiontypes.NewMsgUpdateConnectionParams("", connectiontypes.DefaultParams()), + false, + }, + { + "failure: whitespace authority address", + connectiontypes.NewMsgUpdateConnectionParams(" ", connectiontypes.DefaultParams()), + false, + }, + { + "failure: unauthorized authority address", + connectiontypes.NewMsgUpdateConnectionParams(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 1abee13facd1..08bec4991fb6 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 28ab6264a6cc..6137f8d82bf8 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -4,6 +4,7 @@ package ibc.core.connection.v1; option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; +import "cosmos/msg/v1/msg.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "ibc/core/client/v1/client.proto"; @@ -23,6 +24,10 @@ service Msg { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateConnectionParams. + rpc UpdateConnectionParams(MsgUpdateConnectionParams) returns (MsgUpdateConnectionParamsResponse); } // MsgConnectionOpenInit defines the msg sent by an account on Chain A to @@ -115,3 +120,19 @@ message MsgConnectionOpenConfirm { // MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm // response type. message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateConnectionParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateConnectionParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateConnectionParamsResponse defines the MsgUpdateConnectionParams response type. +message MsgUpdateConnectionParamsResponse {} \ No newline at end of file