diff --git a/CHANGELOG.md b/CHANGELOG.md index 20224d12e97..049748d3d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (linting) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) Fix linting errors, resulting compatiblity with go1.18 linting style, golangci-lint 1.46.2 and the revivie linter. This caused breaking changes in core/04-channel, core/ante, and the testing library. * (apps/27-interchain-accounts) [\#2157](https://github.com/cosmos/ibc-go/pull/2157) Adding `IsMiddlewareEnabled` functionality to enforce calls to ICS27 msg server to *not* route to the underlying application. * (apps/27-interchain-accounts) [\#2146](https://github.com/cosmos/ibc-go/pull/2146) ICS27 controller now claims the channel capability passed via ibc core, and passes `nil` to the underlying app callback. The channel capability arg in `SendTx` is now ignored and looked up internally. +* (apps/27-interchain-accounts) [\#2177](https://github.com/cosmos/ibc-go/pull/2177) Adding `IsMiddlewareEnabled` flag to interchain accounts `ActiveChannel` genesis type. * (apps/27-interchain-accounts) [\#2140](https://github.com/cosmos/ibc-go/pull/2140) Adding migration handler to ICS27 `controller` submodule to assert ownership of channel capabilities and set middleware enabled flag for existing channels. The ICS27 module consensus version has been bumped from 1 to 2. ### Features diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 4d5b5789a45..34a3746c955 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1743,7 +1743,8 @@ The following parameters may be used to disable the host submodule. ### ActiveChannel -ActiveChannel contains a connection ID, port ID and associated active channel ID +ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as boolean flag to indicate +if the channel is middleware enabled | Field | Type | Label | Description | @@ -1751,6 +1752,7 @@ ActiveChannel contains a connection ID, port ID and associated active channel ID | `connection_id` | [string](#string) | | | | `port_id` | [string](#string) | | | | `channel_id` | [string](#string) | | | +| `is_middleware_enabled` | [bool](#bool) | | | diff --git a/modules/apps/27-interchain-accounts/controller/keeper/genesis.go b/modules/apps/27-interchain-accounts/controller/keeper/genesis.go index ebf63a7ca3f..7bd991b0ae8 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/genesis.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/genesis.go @@ -22,6 +22,10 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, state genesistypes.ControllerGe for _, ch := range state.ActiveChannels { keeper.SetActiveChannelID(ctx, ch.ConnectionId, ch.PortId, ch.ChannelId) + + if ch.IsMiddlewareEnabled { + keeper.SetMiddlewareEnabled(ctx, ch.PortId, ch.ChannelId) + } } for _, acc := range state.InterchainAccounts { diff --git a/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go b/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go index a787c52c03b..d3cac3f510d 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go @@ -13,9 +13,10 @@ func (suite *KeeperTestSuite) TestInitGenesis() { genesisState := genesistypes.ControllerGenesisState{ ActiveChannels: []genesistypes.ActiveChannel{ { - ConnectionId: ibctesting.FirstConnectionID, - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, + ConnectionId: ibctesting.FirstConnectionID, + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + IsMiddlewareEnabled: true, }, }, InterchainAccounts: []genesistypes.RegisteredInterchainAccount{ @@ -34,6 +35,9 @@ func (suite *KeeperTestSuite) TestInitGenesis() { suite.Require().True(found) suite.Require().Equal(ibctesting.FirstChannelID, channelID) + isMiddlewareEnabled := suite.chainA.GetSimApp().ICAControllerKeeper.IsMiddlewareEnabled(suite.chainA.GetContext(), TestPortID, ibctesting.FirstChannelID) + suite.Require().True(isMiddlewareEnabled) + accountAdrr, found := suite.chainA.GetSimApp().ICAControllerKeeper.GetInterchainAccountAddress(suite.chainA.GetContext(), ibctesting.FirstConnectionID, TestPortID) suite.Require().True(found) suite.Require().Equal(TestAccAddress.String(), accountAdrr) @@ -56,6 +60,7 @@ func (suite *KeeperTestSuite) TestExportGenesis() { suite.Require().Equal(path.EndpointA.ChannelID, genesisState.ActiveChannels[0].ChannelId) suite.Require().Equal(path.EndpointA.ChannelConfig.PortID, genesisState.ActiveChannels[0].PortId) + suite.Require().True(genesisState.ActiveChannels[0].IsMiddlewareEnabled) suite.Require().Equal(TestAccAddress.String(), genesisState.InterchainAccounts[0].AccountAddress) suite.Require().Equal(path.EndpointA.ChannelConfig.PortID, genesisState.InterchainAccounts[0].PortId) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index b78899881a9..ce282badc3f 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -146,9 +146,10 @@ func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []genesistypes.ActiveChann keySplit := strings.Split(string(iterator.Key()), "/") ch := genesistypes.ActiveChannel{ - ConnectionId: keySplit[2], - PortId: keySplit[1], - ChannelId: string(iterator.Value()), + ConnectionId: keySplit[2], + PortId: keySplit[1], + ChannelId: string(iterator.Value()), + IsMiddlewareEnabled: k.IsMiddlewareEnabled(ctx, keySplit[1], string(iterator.Value())), } activeChannels = append(activeChannels, ch) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index 18d9860e66a..0c889dfd5ae 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -182,14 +182,16 @@ func (suite *KeeperTestSuite) TestGetAllActiveChannels() { expectedChannels := []genesistypes.ActiveChannel{ { - ConnectionId: ibctesting.FirstConnectionID, - PortId: TestPortID, - ChannelId: path.EndpointA.ChannelID, + ConnectionId: ibctesting.FirstConnectionID, + PortId: TestPortID, + ChannelId: path.EndpointA.ChannelID, + IsMiddlewareEnabled: true, }, { - ConnectionId: ibctesting.FirstConnectionID, - PortId: expectedPortID, - ChannelId: expectedChannelID, + ConnectionId: ibctesting.FirstConnectionID, + PortId: expectedPortID, + ChannelId: expectedChannelID, + IsMiddlewareEnabled: false, }, } diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go b/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go index fb0a9bd7b5e..8f2625cd749 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go @@ -216,11 +216,13 @@ func (m *HostGenesisState) GetParams() types1.Params { return types1.Params{} } -// ActiveChannel contains a connection ID, port ID and associated active channel ID +// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as boolean flag to indicate +// if the channel is middleware enabled type ActiveChannel struct { - ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + IsMiddlewareEnabled bool `protobuf:"varint,4,opt,name=is_middleware_enabled,json=isMiddlewareEnabled,proto3" json:"is_middleware_enabled,omitempty" yaml:"is_middleware_enabled"` } func (m *ActiveChannel) Reset() { *m = ActiveChannel{} } @@ -277,6 +279,13 @@ func (m *ActiveChannel) GetChannelId() string { return "" } +func (m *ActiveChannel) GetIsMiddlewareEnabled() bool { + if m != nil { + return m.IsMiddlewareEnabled + } + return false +} + // RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address type RegisteredInterchainAccount struct { ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` @@ -351,48 +360,51 @@ func init() { } var fileDescriptor_d4aa48c8e29a1947 = []byte{ - // 648 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x4d, 0x6b, 0x13, 0x41, - 0x18, 0xc7, 0x33, 0x49, 0xad, 0x64, 0xfa, 0x62, 0x1d, 0x6b, 0x59, 0x23, 0x6c, 0xe2, 0x5c, 0x0c, - 0x48, 0x77, 0x69, 0xad, 0x14, 0x0a, 0x15, 0xb2, 0x39, 0xd4, 0x80, 0x82, 0x8c, 0x17, 0xf1, 0x12, - 0x26, 0xb3, 0xc3, 0x66, 0x20, 0xd9, 0x09, 0x3b, 0xd3, 0x40, 0x3f, 0x81, 0x57, 0xf1, 0x1b, 0x78, - 0x13, 0x6f, 0x5e, 0xfc, 0x0c, 0x3d, 0x49, 0x8f, 0x9e, 0x82, 0xb4, 0xdf, 0x20, 0x9f, 0x40, 0x66, - 0x76, 0x9b, 0xb7, 0xa6, 0x92, 0x5c, 0x3c, 0x79, 0xca, 0xcc, 0xce, 0xf3, 0xff, 0x3f, 0xbf, 0x67, - 0x9e, 0xc9, 0x0c, 0x3c, 0x16, 0x2d, 0xe6, 0xd3, 0x5e, 0xaf, 0x23, 0x18, 0xd5, 0x42, 0xc6, 0xca, - 0x17, 0xb1, 0xe6, 0x09, 0x6b, 0x53, 0x11, 0x37, 0x29, 0x63, 0xf2, 0x34, 0xd6, 0xca, 0x8f, 0x78, - 0xcc, 0x95, 0x50, 0x7e, 0x7f, 0xef, 0x7a, 0xe8, 0xf5, 0x12, 0xa9, 0x25, 0xf2, 0x45, 0x8b, 0x79, - 0x93, 0x72, 0x6f, 0x8e, 0xdc, 0xbb, 0xd6, 0xf4, 0xf7, 0x4a, 0xdb, 0x91, 0x8c, 0xa4, 0xd5, 0xfa, - 0x66, 0x94, 0xda, 0x94, 0xea, 0x0b, 0x51, 0x30, 0x19, 0xeb, 0x44, 0x76, 0x3a, 0x3c, 0x31, 0x20, - 0xe3, 0x59, 0x66, 0x72, 0xb8, 0x90, 0x49, 0x5b, 0x2a, 0x6d, 0xe4, 0xe6, 0x37, 0x15, 0xe2, 0x8b, - 0x3c, 0x5c, 0x3f, 0x49, 0x11, 0xdf, 0x69, 0xaa, 0x39, 0xfa, 0x06, 0xa0, 0x33, 0xb6, 0x6f, 0x66, - 0xf8, 0x4d, 0x65, 0x16, 0x1d, 0x50, 0x01, 0xd5, 0xb5, 0xfd, 0x13, 0x6f, 0xc9, 0xca, 0xbd, 0xfa, - 0xc8, 0x70, 0x32, 0x57, 0xf0, 0xf4, 0x7c, 0x50, 0xce, 0x0d, 0x07, 0xe5, 0xf2, 0x19, 0xed, 0x76, - 0x8e, 0xf0, 0x6d, 0x69, 0x31, 0xd9, 0x61, 0x73, 0x0d, 0xd0, 0x67, 0x00, 0x91, 0x29, 0x66, 0x06, - 0x33, 0x6f, 0x31, 0x6b, 0x4b, 0x63, 0xbe, 0x92, 0x4a, 0x4f, 0x01, 0x3e, 0xc9, 0x00, 0x1f, 0xa5, - 0x80, 0x37, 0x53, 0x61, 0xb2, 0xd5, 0x9e, 0x11, 0xe1, 0x1f, 0x05, 0xb8, 0x33, 0xbf, 0x60, 0xf4, - 0x11, 0xc0, 0x7b, 0x94, 0x69, 0xd1, 0xe7, 0x4d, 0xd6, 0xa6, 0x71, 0xcc, 0x3b, 0xca, 0x01, 0x95, - 0x42, 0x75, 0x6d, 0xff, 0xe5, 0xd2, 0xb0, 0x35, 0xeb, 0x53, 0x4f, 0x6d, 0x02, 0x37, 0x23, 0xdd, - 0x49, 0x49, 0x67, 0x92, 0x60, 0xb2, 0x49, 0x27, 0xc3, 0x15, 0xfa, 0x02, 0xe0, 0x83, 0x39, 0x09, - 0x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0x8d, 0xd6, 0x30, 0x29, 0x66, 0x93, 0x46, 0x88, 0x7f, - 0x02, 0xf8, 0xf8, 0x2f, 0x7b, 0xfe, 0x4f, 0x2b, 0xa8, 0x9b, 0x43, 0x6d, 0xd3, 0x36, 0x69, 0x18, - 0x26, 0x5c, 0xa9, 0xac, 0x8c, 0xd2, 0xe4, 0x81, 0x9c, 0x0a, 0xb0, 0x07, 0xd2, 0x7e, 0xa9, 0xa5, - 0x1f, 0x82, 0xe8, 0xfc, 0xd2, 0x05, 0x17, 0x97, 0x2e, 0xf8, 0x7d, 0xe9, 0x82, 0x4f, 0x57, 0x6e, - 0xee, 0xe2, 0xca, 0xcd, 0xfd, 0xba, 0x72, 0x73, 0x1f, 0xde, 0x44, 0x42, 0xb7, 0x4f, 0x5b, 0x1e, - 0x93, 0x5d, 0x9f, 0x49, 0xd5, 0x95, 0xca, 0x3c, 0x96, 0xbb, 0x91, 0xf4, 0xfb, 0x2f, 0xfc, 0xae, - 0x0c, 0x4f, 0x3b, 0x5c, 0x99, 0xe7, 0x4a, 0xf9, 0xfb, 0x87, 0xbb, 0xe3, 0xe6, 0xef, 0xde, 0x78, - 0x74, 0xf5, 0x59, 0x8f, 0xab, 0xd6, 0xaa, 0x7d, 0xab, 0x9e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, - 0x1d, 0xb1, 0x33, 0x63, 0xb1, 0x07, 0x00, 0x00, + // 693 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0xdd, 0x6a, 0xdb, 0x3c, + 0x18, 0xc7, 0xe3, 0xa4, 0x6f, 0xdf, 0x37, 0xea, 0xc7, 0xdb, 0xa9, 0x1f, 0x78, 0xd9, 0xb0, 0x33, + 0x9f, 0x2c, 0x30, 0x6a, 0xd3, 0xae, 0xa3, 0x50, 0xe8, 0x20, 0x0e, 0xa3, 0x0b, 0xac, 0x30, 0xbc, + 0x1d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, + 0x12, 0x58, 0x9b, 0x3c, 0x02, 0x7f, 0x4b, 0x36, 0x57, 0xc9, 0x20, 0x58, 0x90, 0x55, 0x32, 0x4b, + 0x55, 0xa3, 0x56, 0x0e, 0x54, 0x1b, 0x06, 0x13, 0x05, 0xdb, 0x9b, 0x8d, 0x54, 0x5d, 0x52, 0x77, + 0x95, 0xea, 0xac, 0x08, 0x56, 0x6e, 0xec, 0x26, 0x3c, 0x04, 0x2b, 0x98, 0xa5, 0x29, 0xc1, 0xd2, + 0x31, 0xa4, 0x91, 0xba, 0xab, 0xca, 0xbe, 0x39, 0xe8, 0xdb, 0x1b, 0xc3, 0xeb, 0x65, 0x34, 0xed, + 0x04, 0xcb, 0xa3, 0x7e, 0x33, 0x82, 0x4f, 0xc0, 0xbf, 0x12, 0x56, 0x0a, 0x8b, 0x4a, 0x08, 0x07, + 0x7d, 0x7b, 0x35, 0x17, 0xea, 0x09, 0x27, 0x58, 0x94, 0xad, 0x66, 0x04, 0xf7, 0x00, 0xd0, 0x65, + 0x92, 0xf1, 0x6a, 0xad, 0xfe, 0xe6, 0xa0, 0x6f, 0xdf, 0xd3, 0x89, 0x86, 0x73, 0x4e, 0x50, 0xd6, + 0x9d, 0x66, 0x04, 0xdf, 0x82, 0x4d, 0xca, 0xc3, 0x0e, 0x8d, 0xa2, 0x84, 0x7c, 0x40, 0x19, 0x09, + 0x49, 0x8a, 0x5a, 0x09, 0x89, 0xd4, 0xb6, 0xfc, 0xe7, 0x57, 0x07, 0x7d, 0xfb, 0xa1, 0xde, 0xee, + 0x69, 0x61, 0x4e, 0xb0, 0x4e, 0xf9, 0xf1, 0x70, 0xf8, 0x85, 0x1e, 0xfd, 0x6e, 0x80, 0x07, 0xbf, + 0xa9, 0xe4, 0x1f, 0xdd, 0x97, 0x86, 0xfc, 0x55, 0x54, 0xda, 0x10, 0x45, 0x51, 0x46, 0x38, 0xd7, + 0x9b, 0x53, 0x19, 0x3f, 0xe6, 0x37, 0x02, 0xd4, 0x31, 0x57, 0x23, 0xf5, 0x7c, 0xc0, 0x8f, 0xcf, + 0x2f, 0x2d, 0xe3, 0xe2, 0xd2, 0x32, 0x7e, 0x5e, 0x5a, 0xc6, 0xc7, 0x2b, 0xab, 0x70, 0x71, 0x65, + 0x15, 0x7e, 0x5c, 0x59, 0x85, 0xf7, 0xc7, 0x31, 0x15, 0xed, 0x93, 0x96, 0x8b, 0x59, 0xc7, 0xc3, + 0x8c, 0x77, 0x18, 0x97, 0x4f, 0xf0, 0x76, 0xcc, 0xbc, 0xde, 0x33, 0xaf, 0xc3, 0xa2, 0x93, 0x84, + 0x70, 0xf9, 0x08, 0x72, 0x6f, 0x77, 0x7f, 0x7b, 0x74, 0xa4, 0xb6, 0x6f, 0x3d, 0xe5, 0xe2, 0xb4, + 0x4b, 0x78, 0x6b, 0x51, 0xbd, 0x80, 0x4f, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x74, 0x7a, + 0x12, 0x07, 0x08, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -596,6 +608,16 @@ func (m *ActiveChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IsMiddlewareEnabled { + i-- + if m.IsMiddlewareEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(m.ChannelId) > 0 { i -= len(m.ChannelId) copy(dAtA[i:], m.ChannelId) @@ -762,6 +784,9 @@ func (m *ActiveChannel) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } + if m.IsMiddlewareEnabled { + n += 2 + } return n } @@ -1399,6 +1424,26 @@ func (m *ActiveChannel) Unmarshal(dAtA []byte) error { } m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsMiddlewareEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsMiddlewareEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto index 58870b8cd7c..092a2081d5d 100644 --- a/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto +++ b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto @@ -36,11 +36,13 @@ message HostGenesisState { ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; } -// ActiveChannel contains a connection ID, port ID and associated active channel ID +// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to indicate +// if the channel is middleware enabled message ActiveChannel { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + bool is_middleware_enabled = 4 [(gogoproto.moretags) = "yaml:\"is_middleware_enabled\""]; } // RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address