From 0d2b9243cece316c5925c7accb31f9cc7565310e Mon Sep 17 00:00:00 2001 From: frog power 4000 Date: Mon, 7 Feb 2022 03:37:59 -0800 Subject: [PATCH] Added ChannelId to MsgChannelOpenInitResponse (#848) ## Description added ChannelId to MsgChannelOpenInitResponse this is needed for distribution within interchain security Also my go imports didn't like go metrics so I had to add the go-metrics alias Supersedes: https://github.com/cosmos/ibc-go/pull/839 Quote from @AdityaSripal Context for the other folks reviewing: This is a problem in general not just for CCV. But currently, in CCV we want to initiate a transfer channel and know what the channelID is. So if we want to do this as part of third-party module logic, it's currently impossible with the codebase. Since, if you try to use channelKeeper directly you will need portCapability; and a third party module will not have transfer's portCapability. So we have to use the MsgServer, but the response doesn't include the channelID which we need since then we want to send transfer packets over the established channel. So this is going to be an issue for any third-party module that wants to initialize a channel of a different IBC application and then use that channel to send packets over --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [x] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes (cherry picked from commit 7b7eb9fa2b94f97600c2f8f19b93503d40e72588) --- CHANGELOG.md | 1 + docs/ibc/proto-docs.md | 5 + modules/core/04-channel/types/tx.pb.go | 194 ++++++++++++++++--------- modules/core/keeper/msg_server.go | 7 +- proto/ibc/core/channel/v1/tx.proto | 4 +- 5 files changed, 137 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df182d73b6a..adb0e0243ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking +* (channel( [\#848](https://github.com/cosmos/ibc-go/pull/848) Added `ChannelId` to MsgChannelOpenInitResponse * (testing( [\#813](https://github.com/cosmos/ibc-go/pull/813) The `ack` argument to the testing function `RelayPacket` has been removed as it is no longer needed. * (testing) [\#774](https://github.com/cosmos/ibc-go/pull/774) Added `ChainID` arg to `SetupWithGenesisValSet` on the testing app. `Coordinator` generated ChainIDs now starts at index 1 * (transfer) [\#675](https://github.com/cosmos/ibc-go/pull/675) Transfer `NewKeeper` now takes in an ICS4Wrapper. The ICS4Wrapper may be the IBC Channel Keeper when ICS20 is not used in a middleware stack. The ICS4Wrapper is required for applications wishing to connect middleware to ICS20. diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index a497c928af1..79d56a6a541 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1888,6 +1888,11 @@ is called by a relayer on Chain A. MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `channel_id` | [string](#string) | | | + + diff --git a/modules/core/04-channel/types/tx.pb.go b/modules/core/04-channel/types/tx.pb.go index 2d3c75345ce..6fcc1a44276 100644 --- a/modules/core/04-channel/types/tx.pb.go +++ b/modules/core/04-channel/types/tx.pb.go @@ -72,6 +72,7 @@ var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. type MsgChannelOpenInitResponse struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` } func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } @@ -107,6 +108,13 @@ func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo +func (m *MsgChannelOpenInitResponse) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + // MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. The version field within the Channel field has been deprecated. Its // value will be ignored by core IBC. @@ -857,78 +865,79 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/tx.proto", fileDescriptor_bc4637e0ac3fc7b7) } var fileDescriptor_bc4637e0ac3fc7b7 = []byte{ - // 1127 bytes of a gzipped FileDescriptorProto + // 1138 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0xd6, 0x97, 0x65, 0x7b, 0xec, 0x37, 0xb6, 0x29, 0x7f, 0x28, 0x94, 0x2d, 0xfa, 0xe5, 0x21, - 0x11, 0x52, 0x44, 0x8c, 0x3f, 0x80, 0x22, 0x41, 0x2f, 0x92, 0x81, 0xa2, 0x41, 0xe1, 0xa6, 0xa0, - 0xdd, 0x1e, 0x8c, 0x02, 0x82, 0xb4, 0xda, 0x50, 0x84, 0x24, 0xae, 0x4a, 0x52, 0x4a, 0xf4, 0x0f, - 0x7a, 0xcc, 0xb9, 0xa7, 0xf4, 0xdc, 0x43, 0xfa, 0x33, 0x72, 0xcc, 0xa9, 0x2d, 0x7a, 0x20, 0x0a, - 0xfb, 0xd2, 0x33, 0x7f, 0x41, 0xc1, 0xe5, 0x92, 0xa2, 0x24, 0xb2, 0xa2, 0x92, 0xca, 0xcd, 0x6d, - 0x39, 0xf3, 0xec, 0xec, 0xec, 0xf3, 0x0c, 0x67, 0x97, 0x84, 0x7d, 0xb5, 0x81,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70, 0xd1, 0xb5, 0x17, 0xde, - 0x15, 0x9d, 0x97, 0x77, 0xb2, 0x23, 0x46, 0x66, 0x39, 0x01, 0x8c, 0x7e, 0x79, 0x23, 0x3a, 0x46, - 0xf5, 0xe2, 0xed, 0x75, 0x31, 0xf9, 0xee, 0xba, 0x98, 0xfc, 0xf3, 0xba, 0x98, 0x7c, 0x75, 0x53, - 0x4c, 0xbc, 0xbb, 0x29, 0x26, 0x7e, 0xbf, 0x29, 0x26, 0xae, 0x1e, 0x2b, 0xaa, 0xd9, 0xea, 0x37, - 0xca, 0x88, 0x74, 0x25, 0x44, 0x8c, 0x2e, 0x31, 0x24, 0xb5, 0x81, 0x1e, 0x2a, 0x44, 0x1a, 0x9c, - 0x48, 0x5d, 0xd2, 0xec, 0x77, 0xb0, 0xe1, 0xfe, 0x46, 0x7a, 0x74, 0xfa, 0xd0, 0xfb, 0x93, 0x64, - 0x0e, 0x7b, 0xd8, 0x68, 0x64, 0xe9, 0x5f, 0xa4, 0x93, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x9b, - 0xb1, 0x4b, 0xd5, 0xd4, 0x12, 0x00, 0x00, + 0x13, 0xd6, 0x87, 0x2d, 0xdb, 0x63, 0xbf, 0xb1, 0x4d, 0xf9, 0x43, 0xa1, 0x6c, 0xd1, 0x2f, 0x0f, + 0x89, 0x91, 0x22, 0x62, 0x6c, 0x07, 0x28, 0x12, 0xf4, 0x62, 0x09, 0x28, 0x6a, 0x14, 0x6e, 0x0a, + 0xda, 0xed, 0xc1, 0x28, 0x20, 0x48, 0xab, 0x0d, 0x45, 0x48, 0xe2, 0xaa, 0x24, 0xa5, 0x44, 0xff, + 0xa0, 0xc7, 0x9c, 0x7b, 0x4a, 0xcf, 0x3d, 0xa4, 0x3f, 0x23, 0xc7, 0x9c, 0xda, 0xa2, 0x07, 0xa2, + 0xb0, 0x2f, 0x3d, 0xf3, 0x17, 0x14, 0x5c, 0x2e, 0x3f, 0x24, 0x91, 0x15, 0x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 0xd1, + 0x2f, 0x60, 0xc9, 0xdb, 0x7f, 0x85, 0xb8, 0x61, 0x0c, 0xc0, 0xdf, 0x9f, 0x02, 0x08, 0xd7, 0xde, + 0xd8, 0x0e, 0x73, 0x6f, 0xca, 0x50, 0x86, 0x8b, 0xaf, 0xbd, 0xe8, 0xae, 0xe8, 0x7c, 0xbc, 0xe3, + 0x1d, 0x31, 0x36, 0xcb, 0x31, 0x60, 0xfc, 0xc7, 0x1b, 0xd3, 0x31, 0x2a, 0x17, 0x6f, 0xaf, 0x4b, + 0xe9, 0x77, 0xd7, 0xa5, 0xf4, 0x9f, 0xd7, 0xa5, 0xf4, 0xab, 0x9b, 0x52, 0xea, 0xdd, 0x4d, 0x29, + 0xf5, 0xfb, 0x4d, 0x29, 0x75, 0xf5, 0x44, 0x51, 0xcd, 0x56, 0xbf, 0x51, 0x46, 0xa4, 0x2b, 0x21, + 0x62, 0x74, 0x89, 0x21, 0xa9, 0x0d, 0xf4, 0x50, 0x21, 0xd2, 0xe0, 0x44, 0xea, 0x92, 0x66, 0xbf, + 0x83, 0x0d, 0xf7, 0xe7, 0xd3, 0xa3, 0xc7, 0x0f, 0xbd, 0xff, 0x4f, 0xe6, 0xb0, 0x87, 0x8d, 0x46, + 0x8e, 0xfe, 0x7b, 0x3a, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x64, 0xa7, 0xfd, 0x0a, 0x13, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1424,6 +1433,13 @@ func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -2241,6 +2257,10 @@ func (m *MsgChannelOpenInitResponse) Size() (n int) { } var l int _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2748,6 +2768,38 @@ func (m *MsgChannelOpenInitResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", 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.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index 2e6800c25f5..9342c0ff069 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -3,7 +3,8 @@ package keeper import ( "context" - "github.com/armon/go-metrics" + metrics "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -191,7 +192,9 @@ func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChan // Write channel into state k.ChannelKeeper.WriteOpenInitChannel(ctx, msg.PortId, channelID, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.Channel.Counterparty, msg.Channel.Version) - return &channeltypes.MsgChannelOpenInitResponse{}, nil + return &channeltypes.MsgChannelOpenInitResponse{ + ChannelId: channelID, + }, nil } // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto index 4f28418c9a2..7fc8f730e33 100644 --- a/proto/ibc/core/channel/v1/tx.proto +++ b/proto/ibc/core/channel/v1/tx.proto @@ -54,7 +54,9 @@ message MsgChannelOpenInit { } // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -message MsgChannelOpenInitResponse {} +message MsgChannelOpenInitResponse { + string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} // MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. The version field within the Channel field has been deprecated. Its