diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index b014b7a2029e..063e33c563d8 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -26,12 +26,13 @@ message MsgChannelOpenTry { string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - Channel channel = 3 [(gogoproto.nullable) = false]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 6 + string proved_channel_id = 3 [(gogoproto.moretags) = "yaml:\"proved_channel_id\""]; + Channel channel = 4 [(gogoproto.nullable) = false]; + string counterparty_version = 5 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_init = 6 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string signer = 8; } // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge @@ -40,13 +41,14 @@ message MsgChannelOpenAck { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_version = 3 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 4 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 5 + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 6; + string signer = 7; } // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to diff --git a/x/ibc/core/03-connection/keeper/handshake_test.go b/x/ibc/core/03-connection/keeper/handshake_test.go index b26ee28c8fc7..d575668b4be0 100644 --- a/x/ibc/core/03-connection/keeper/handshake_test.go +++ b/x/ibc/core/03-connection/keeper/handshake_test.go @@ -123,7 +123,7 @@ func (suite *KeeperTestSuite) TestConnOpenTry() { // retrieve client state of chainA to pass as counterpartyClient counterpartyClient = suite.chainA.GetClientState(clientA) }, true}, - {"success with empty provedID", func() { + {"invalid provedID", func() { clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) connA, _, err := suite.coordinator.ConnOpenInit(suite.chainA, suite.chainB, clientA, clientB) suite.Require().NoError(err) @@ -256,7 +256,6 @@ func (suite *KeeperTestSuite) TestConnOpenTry() { // retrieve client state of chainA to pass as counterpartyClient counterpartyClient = suite.chainA.GetClientState(clientA) - }, false}, {"invalid previous connection has invalid versions", func() { clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) @@ -364,7 +363,7 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { // retrieve client state of chainB to pass as counterpartyClient counterpartyClient = suite.chainB.GetClientState(clientB) }, true}, - {"success with empty counterparty connection ID", func() { + {"success with empty stored counterparty connection ID", func() { clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) connA, connB, err := suite.coordinator.ConnOpenInit(suite.chainA, suite.chainB, clientA, clientB) suite.Require().NoError(err) @@ -412,7 +411,7 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { // retrieve client state of chainB to pass as counterpartyClient counterpartyClient = suite.chainB.GetClientState(clientB) }, true}, - {"success from tryopen with empty string", func() { + {"success from tryopen with empty stored connection id", func() { // chainA is in TRYOPEN, chainB is in TRYOPEN clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) connB, connA, err := suite.coordinator.ConnOpenInit(suite.chainB, suite.chainA, clientB, clientA) diff --git a/x/ibc/core/04-channel/client/cli/tx.go b/x/ibc/core/04-channel/client/cli/tx.go index e769ef4c7a48..f4f417638331 100644 --- a/x/ibc/core/04-channel/client/cli/tx.go +++ b/x/ibc/core/04-channel/client/cli/tx.go @@ -64,9 +64,9 @@ func NewChannelOpenInitCmd() *cobra.Command { // NewChannelOpenTryCmd returns the command to create a MsgChannelOpenTry transaction func NewChannelOpenTryCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "open-try [port-id] [channel-id] [counterparty-port-id] [counterparty-channel-id] [connection-hops] [/path/to/proof_init.json] [proof-height]", + Use: "open-try [port-id] [channel-id] [proved-channel-id] [counterparty-port-id] [counterparty-channel-id] [connection-hops] [/path/to/proof_init.json] [proof-height]", Short: "Creates and sends a ChannelOpenTry message", - Args: cobra.ExactArgs(7), + Args: cobra.ExactArgs(8), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) @@ -76,26 +76,27 @@ func NewChannelOpenTryCmd() *cobra.Command { portID := args[0] channelID := args[1] - counterpartyPortID := args[2] - counterpartyChannelID := args[3] - hops := strings.Split(args[4], "/") + provedChannelID := args[2] + counterpartyPortID := args[3] + counterpartyChannelID := args[4] + hops := strings.Split(args[5], "/") order := channelOrder(cmd.Flags()) // TODO: Differentiate between channel and counterparty versions. version, _ := cmd.Flags().GetString(FlagIBCVersion) - proofInit, err := connectionutils.ParseProof(clientCtx.LegacyAmino, args[5]) + proofInit, err := connectionutils.ParseProof(clientCtx.LegacyAmino, args[6]) if err != nil { return err } - proofHeight, err := clienttypes.ParseHeight(args[6]) + proofHeight, err := clienttypes.ParseHeight(args[7]) if err != nil { return err } msg := types.NewMsgChannelOpenTry( - portID, channelID, version, order, hops, + portID, channelID, provedChannelID, version, order, hops, counterpartyPortID, counterpartyChannelID, version, proofInit, proofHeight, clientCtx.GetFromAddress(), ) @@ -117,9 +118,9 @@ func NewChannelOpenTryCmd() *cobra.Command { // NewChannelOpenAckCmd returns the command to create a MsgChannelOpenAck transaction func NewChannelOpenAckCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "open-ack [port-id] [channel-id] [/path/to/proof_try.json] [proof-height]", + Use: "open-ack [port-id] [channel-id] [counterparty-channel-id] [/path/to/proof_try.json] [proof-height]", Short: "Creates and sends a ChannelOpenAck message", - Args: cobra.ExactArgs(4), + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) @@ -129,22 +130,23 @@ func NewChannelOpenAckCmd() *cobra.Command { portID := args[0] channelID := args[1] + counterpartyChannelID := args[2] // TODO: Differentiate between channel and counterparty versions. version, _ := cmd.Flags().GetString(FlagIBCVersion) - proofTry, err := connectionutils.ParseProof(clientCtx.LegacyAmino, args[2]) + proofTry, err := connectionutils.ParseProof(clientCtx.LegacyAmino, args[3]) if err != nil { return err } - proofHeight, err := clienttypes.ParseHeight(args[3]) + proofHeight, err := clienttypes.ParseHeight(args[4]) if err != nil { return err } msg := types.NewMsgChannelOpenAck( - portID, channelID, version, proofTry, proofHeight, clientCtx.GetFromAddress(), + portID, channelID, counterpartyChannelID, version, proofTry, proofHeight, clientCtx.GetFromAddress(), ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/ibc/core/04-channel/handler.go b/x/ibc/core/04-channel/handler.go index 052b0cd03588..6cb51c298ed5 100644 --- a/x/ibc/core/04-channel/handler.go +++ b/x/ibc/core/04-channel/handler.go @@ -40,7 +40,7 @@ func HandleMsgChannelOpenInit(ctx sdk.Context, k keeper.Keeper, portCap *capabil // HandleMsgChannelOpenTry defines the sdk.Handler for MsgChannelOpenTry func HandleMsgChannelOpenTry(ctx sdk.Context, k keeper.Keeper, portCap *capabilitytypes.Capability, msg *types.MsgChannelOpenTry) (*sdk.Result, *capabilitytypes.Capability, error) { - capKey, err := k.ChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, + capKey, err := k.ChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, msg.ProvedChannelId, portCap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion, msg.ProofInit, msg.ProofHeight, ) if err != nil { @@ -70,7 +70,7 @@ func HandleMsgChannelOpenTry(ctx sdk.Context, k keeper.Keeper, portCap *capabili // HandleMsgChannelOpenAck defines the sdk.Handler for MsgChannelOpenAck func HandleMsgChannelOpenAck(ctx sdk.Context, k keeper.Keeper, channelCap *capabilitytypes.Capability, msg *types.MsgChannelOpenAck) (*sdk.Result, error) { err := k.ChanOpenAck( - ctx, msg.PortId, msg.ChannelId, channelCap, msg.CounterpartyVersion, msg.ProofTry, msg.ProofHeight, + ctx, msg.PortId, msg.ChannelId, channelCap, msg.CounterpartyVersion, msg.CounterpartyChannelId, msg.ProofTry, msg.ProofHeight, ) if err != nil { return nil, sdkerrors.Wrap(err, "channel handshake open ack failed") diff --git a/x/ibc/core/04-channel/keeper/handshake.go b/x/ibc/core/04-channel/keeper/handshake.go index dfa023713b2b..3ee760303a80 100644 --- a/x/ibc/core/04-channel/keeper/handshake.go +++ b/x/ibc/core/04-channel/keeper/handshake.go @@ -96,7 +96,8 @@ func (k Keeper) ChanOpenTry( order types.Order, connectionHops []string, portID, - channelID string, + channelID, + provedChannelID string, portCap *capabilitytypes.Capability, counterparty types.Counterparty, version, @@ -147,6 +148,15 @@ func (k Keeper) ChanOpenTry( ) } + // empty-string is a sentinel value for "allow any identifier" to be selected by + // the counterparty channel + if provedChannelID != channelID && provedChannelID != "" { + return nil, sdkerrors.Wrapf( + types.ErrInvalidChannelIdentifier, + "proved channel identifier (%s) must equal channel identifier (%s) or be empty", provedChannelID, channelID, + ) + } + // NOTE: this step has been switched with the one below to reverse the connection // hops channel := types.NewChannel(types.TRYOPEN, order, counterparty, connectionHops, version) @@ -159,7 +169,7 @@ func (k Keeper) ChanOpenTry( // expectedCounterpaty is the counterparty of the counterparty's channel end // (i.e self) - expectedCounterparty := types.NewCounterparty(portID, channelID) + expectedCounterparty := types.NewCounterparty(portID, provedChannelID) expectedChannel := types.NewChannel( types.INIT, channel.Ordering, expectedCounterparty, counterpartyHops, counterpartyVersion, @@ -194,7 +204,8 @@ func (k Keeper) ChanOpenAck( portID, channelID string, chanCap *capabilitytypes.Capability, - counterpartyVersion string, + counterpartyVersion, + counterpartyChannelID string, proofTry []byte, proofHeight exported.Height, ) error { @@ -214,6 +225,15 @@ func (k Keeper) ChanOpenAck( return sdkerrors.Wrapf(types.ErrChannelCapabilityNotFound, "caller does not own capability for channel, port ID (%s) channel ID (%s)", portID, channelID) } + // empty-string is a sentinel value for "allow any identifier" to be selected by + // the counterparty channel + if counterpartyChannelID != channel.Counterparty.ChannelId && channel.Counterparty.ChannelId != "" { + return sdkerrors.Wrapf( + types.ErrInvalidChannelIdentifier, + "counterparty channel identifier (%s) must be empty or equal to stored channel ID for counterparty (%s)", counterpartyChannelID, channel.Counterparty.ChannelId, + ) + } + connectionEnd, found := k.connectionKeeper.GetConnection(ctx, channel.ConnectionHops[0]) if !found { return sdkerrors.Wrap(connectiontypes.ErrConnectionNotFound, channel.ConnectionHops[0]) @@ -241,7 +261,7 @@ func (k Keeper) ChanOpenAck( if err := k.connectionKeeper.VerifyChannelState( ctx, connectionEnd, proofHeight, proofTry, - channel.Counterparty.PortId, channel.Counterparty.ChannelId, + channel.Counterparty.PortId, counterpartyChannelID, expectedChannel, ); err != nil { return err @@ -251,6 +271,7 @@ func (k Keeper) ChanOpenAck( channel.State = types.OPEN channel.Version = counterpartyVersion + channel.Counterparty.ChannelId = counterpartyChannelID k.SetChannel(ctx, portID, channelID, channel) return nil diff --git a/x/ibc/core/04-channel/keeper/handshake_test.go b/x/ibc/core/04-channel/keeper/handshake_test.go index a20b83de1534..00d47062fbf7 100644 --- a/x/ibc/core/04-channel/keeper/handshake_test.go +++ b/x/ibc/core/04-channel/keeper/handshake_test.go @@ -153,6 +153,26 @@ func (suite *KeeperTestSuite) TestChanOpenTry() { suite.chainB.CreatePortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) portCap = suite.chainB.GetPortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) }, true}, + {"success with empty proved channel id", func() { + var clientA, clientB string + clientA, clientB, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) + channelA, _, err := suite.coordinator.ChanOpenInit(suite.chainA, suite.chainB, connA, connB, ibctesting.MockPort, ibctesting.MockPort, types.ORDERED) + suite.Require().NoError(err) + + // set the channel's counterparty channel identifier to empty string + channel := suite.chainA.GetChannel(channelA) + channel.Counterparty.ChannelId = "" + suite.chainA.App.IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), channelA.PortID, channelA.ID, channel) + + err = suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + err = suite.coordinator.UpdateClient(suite.chainB, suite.chainA, clientB, ibctesting.Tendermint) + suite.Require().NoError(err) + + suite.chainB.CreatePortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) + portCap = suite.chainB.GetPortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) + }, true}, {"previous channel with invalid state", func() { _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) @@ -187,6 +207,19 @@ func (suite *KeeperTestSuite) TestChanOpenTry() { heightDiff = 3 // consensus state doesn't exist at this height }, false}, + {"invalid proved channel id", func() { + _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) + channelA, _, err := suite.coordinator.ChanOpenInit(suite.chainA, suite.chainB, connA, connB, ibctesting.MockPort, ibctesting.MockPort, types.ORDERED) + suite.Require().NoError(err) + + // set the channel's counterparty channel identifier to empty string + channel := suite.chainA.GetChannel(channelA) + channel.Counterparty.ChannelId = "otherchannel" + suite.chainA.App.IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), channelA.PortID, channelA.ID, channel) + + suite.chainB.CreatePortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) + portCap = suite.chainB.GetPortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) + }, false}, {"channel verification failed", func() { // not creating a channel on chainA will result in an invalid proof of existence _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) @@ -243,15 +276,23 @@ func (suite *KeeperTestSuite) TestChanOpenTry() { heightDiff = 0 // must be explicitly changed in malleate tc.malleate() - counterparty := types.NewCounterparty(connA.FirstOrNextTestChannel(ibctesting.MockPort).PortID, connA.FirstOrNextTestChannel(ibctesting.MockPort).ID) + channelA := connA.FirstOrNextTestChannel(ibctesting.MockPort) channelB := connB.FirstOrNextTestChannel(ibctesting.MockPort) + counterparty := types.NewCounterparty(channelA.PortID, channelA.ID) + + // get provedChannelID + var provedChannelID string + channel, found := suite.chainA.App.IBCKeeper.ChannelKeeper.GetChannel(suite.chainA.GetContext(), channelA.PortID, channelA.ID) + if found { + provedChannelID = channel.Counterparty.ChannelId + } channelKey := host.KeyChannel(counterparty.PortId, counterparty.ChannelId) proof, proofHeight := suite.chainA.QueryProof(channelKey) cap, err := suite.chainB.App.IBCKeeper.ChannelKeeper.ChanOpenTry( suite.chainB.GetContext(), types.ORDERED, []string{connB.ID}, - channelB.PortID, channelB.ID, portCap, counterparty, channelB.Version, connA.FirstOrNextTestChannel(ibctesting.MockPort).Version, + channelB.PortID, channelB.ID, provedChannelID, portCap, counterparty, channelB.Version, connA.FirstOrNextTestChannel(ibctesting.MockPort).Version, proof, malleateHeight(proofHeight, heightDiff), ) @@ -277,10 +318,11 @@ func (suite *KeeperTestSuite) TestChanOpenTry() { // call is occurring on chainA. func (suite *KeeperTestSuite) TestChanOpenAck() { var ( - connA *ibctesting.TestConnection - connB *ibctesting.TestConnection - channelCap *capabilitytypes.Capability - heightDiff uint64 + connA *ibctesting.TestConnection + connB *ibctesting.TestConnection + counterpartyChannelID string + channelCap *capabilitytypes.Capability + heightDiff uint64 ) testCases := []testCase{ @@ -294,6 +336,25 @@ func (suite *KeeperTestSuite) TestChanOpenAck() { channelCap = suite.chainA.GetChannelCapability(channelA.PortID, channelA.ID) }, true}, + {"success with empty stored counterparty channel ID", func() { + _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) + channelA, channelB, err := suite.coordinator.ChanOpenInit(suite.chainA, suite.chainB, connA, connB, ibctesting.MockPort, ibctesting.MockPort, types.ORDERED) + suite.Require().NoError(err) + + err = suite.coordinator.ChanOpenTry(suite.chainB, suite.chainA, channelB, channelA, connB, types.ORDERED) + suite.Require().NoError(err) + + // set the channel's counterparty channel identifier to empty string + channel := suite.chainA.GetChannel(channelA) + channel.Counterparty.ChannelId = "" + + // use a different channel identifier + counterpartyChannelID = channelB.ID + + suite.chainA.App.IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), channelA.PortID, channelA.ID, channel) + + channelCap = suite.chainA.GetChannelCapability(channelA.PortID, channelA.ID) + }, true}, {"channel doesn't exist", func() {}, false}, {"channel state is not INIT or TRYOPEN", func() { // create fully open channels on both chains @@ -342,6 +403,18 @@ func (suite *KeeperTestSuite) TestChanOpenAck() { heightDiff = 3 // consensus state doesn't exist at this height }, false}, + {"invalid counterparty channel identifier", func() { + _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) + channelA, channelB, err := suite.coordinator.ChanOpenInit(suite.chainA, suite.chainB, connA, connB, ibctesting.MockPort, ibctesting.MockPort, types.ORDERED) + suite.Require().NoError(err) + + err = suite.coordinator.ChanOpenTry(suite.chainB, suite.chainA, channelB, channelA, connB, types.ORDERED) + suite.Require().NoError(err) + + counterpartyChannelID = "otheridentifier" + + channelCap = suite.chainA.GetChannelCapability(channelA.PortID, channelA.ID) + }, false}, {"channel verification failed", func() { // chainB is INIT, chainA in TRYOPEN _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) @@ -367,19 +440,24 @@ func (suite *KeeperTestSuite) TestChanOpenAck() { for _, tc := range testCases { tc := tc suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset - heightDiff = 0 // must be explicitly changed + suite.SetupTest() // reset + counterpartyChannelID = "" // must be explicitly changed in malleate + heightDiff = 0 // must be explicitly changed tc.malleate() channelA := connA.FirstOrNextTestChannel(ibctesting.MockPort) channelB := connB.FirstOrNextTestChannel(ibctesting.MockPort) + if counterpartyChannelID == "" { + counterpartyChannelID = channelB.ID + } + channelKey := host.KeyChannel(channelB.PortID, channelB.ID) proof, proofHeight := suite.chainB.QueryProof(channelKey) err := suite.chainA.App.IBCKeeper.ChannelKeeper.ChanOpenAck( - suite.chainA.GetContext(), channelA.PortID, channelA.ID, channelCap, channelB.Version, + suite.chainA.GetContext(), channelA.PortID, channelA.ID, channelCap, channelB.Version, counterpartyChannelID, proof, malleateHeight(proofHeight, heightDiff), ) diff --git a/x/ibc/core/04-channel/types/channel.go b/x/ibc/core/04-channel/types/channel.go index 1eebcaef4381..9bddb84fa40c 100644 --- a/x/ibc/core/04-channel/types/channel.go +++ b/x/ibc/core/04-channel/types/channel.go @@ -96,8 +96,10 @@ func (c Counterparty) ValidateBasic() error { if err := host.PortIdentifierValidator(c.PortId); err != nil { return sdkerrors.Wrap(err, "invalid counterparty port ID") } - if err := host.ChannelIdentifierValidator(c.ChannelId); err != nil { - return sdkerrors.Wrap(err, "invalid counterparty channel ID") + if c.ChannelId != "" { + if err := host.ChannelIdentifierValidator(c.ChannelId); err != nil { + return sdkerrors.Wrap(err, "invalid counterparty channel ID") + } } return nil } diff --git a/x/ibc/core/04-channel/types/channel.pb.go b/x/ibc/core/04-channel/types/channel.pb.go index 82f32f70c500..8fb0a273762c 100644 --- a/x/ibc/core/04-channel/types/channel.pb.go +++ b/x/ibc/core/04-channel/types/channel.pb.go @@ -147,11 +147,12 @@ var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo type MsgChannelOpenTry struct { PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - Channel Channel `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel"` - CounterpartyVersion string `protobuf:"bytes,4,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` - ProofInit []byte `protobuf:"bytes,5,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` - ProofHeight types.Height `protobuf:"bytes,6,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,7,opt,name=signer,proto3" json:"signer,omitempty"` + ProvedChannelId string `protobuf:"bytes,3,opt,name=proved_channel_id,json=provedChannelId,proto3" json:"proved_channel_id,omitempty" yaml:"proved_channel_id"` + Channel Channel `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel"` + CounterpartyVersion string `protobuf:"bytes,5,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` + ProofInit []byte `protobuf:"bytes,6,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` + ProofHeight types.Height `protobuf:"bytes,7,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,8,opt,name=signer,proto3" json:"signer,omitempty"` } func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } @@ -190,12 +191,13 @@ var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. type MsgChannelOpenAck struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - CounterpartyVersion string `protobuf:"bytes,3,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` - ProofTry []byte `protobuf:"bytes,4,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` - ProofHeight types.Height `protobuf:"bytes,5,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyChannelId string `protobuf:"bytes,3,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + CounterpartyVersion string `protobuf:"bytes,4,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` + ProofTry []byte `protobuf:"bytes,5,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` + ProofHeight types.Height `protobuf:"bytes,6,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,7,opt,name=signer,proto3" json:"signer,omitempty"` } func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } @@ -889,94 +891,97 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1385 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6b, 0x1b, 0xc7, - 0x17, 0xd7, 0xea, 0xb7, 0x9f, 0x65, 0x5b, 0x1e, 0xdb, 0xca, 0x46, 0x4e, 0xb4, 0xca, 0xf2, 0x3d, - 0x98, 0x7c, 0x89, 0x14, 0xe7, 0x1b, 0xbe, 0x6d, 0x43, 0x0f, 0xb5, 0x64, 0x05, 0x8b, 0x24, 0x92, - 0x19, 0x2b, 0x85, 0xe6, 0xa2, 0xae, 0x57, 0x13, 0x69, 0x91, 0xb5, 0xa3, 0xee, 0xae, 0x9d, 0xf8, - 0x3f, 0x08, 0x86, 0x42, 0xcf, 0x05, 0x43, 0xa0, 0x14, 0x0a, 0x85, 0xf6, 0xd8, 0x4b, 0xff, 0x80, - 0x1c, 0x73, 0x6b, 0x4f, 0x4b, 0x49, 0x0e, 0xcd, 0x59, 0xd7, 0x1e, 0x5a, 0x76, 0x66, 0x56, 0x5a, - 0x29, 0x56, 0x5a, 0x9a, 0x5a, 0xb4, 0xd0, 0x93, 0xe6, 0xbd, 0xf7, 0x99, 0x99, 0xf7, 0x3e, 0xef, - 0xcd, 0x9b, 0xd1, 0xc2, 0x15, 0x63, 0x5f, 0x2f, 0xea, 0xd4, 0x22, 0x45, 0xbd, 0xa3, 0x99, 0x26, - 0x39, 0x28, 0x1e, 0x6d, 0xfa, 0xc3, 0x42, 0xdf, 0xa2, 0x0e, 0x45, 0x2b, 0xc6, 0xbe, 0x5e, 0xf0, - 0x20, 0x05, 0x5f, 0x7f, 0xb4, 0x99, 0x5d, 0x6d, 0xd3, 0x36, 0x65, 0xf6, 0xa2, 0x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- 0xb9, 0xd0, 0xd5, 0x47, 0x10, 0x63, 0x3d, 0x13, 0xfd, 0x07, 0x32, 0x75, 0xbc, 0x5d, 0xc1, 0xcd, - 0x5a, 0xbd, 0x56, 0x99, 0xf0, 0x97, 0x2d, 0xe9, 0xe9, 0x91, 0x0a, 0x4b, 0x1c, 0x75, 0xbf, 0xc6, - 0x7e, 0x2b, 0xdb, 0x69, 0x29, 0xbb, 0x70, 0x72, 0x9a, 0x9f, 0x1b, 0x2a, 0x3c, 0x87, 0x39, 0xc6, - 0x47, 0x08, 0x87, 0x85, 0xc8, 0x37, 0x2e, 0xe1, 0x67, 0x2f, 0x72, 0xd2, 0xf3, 0x17, 0x39, 0xe9, - 0xa7, 0x17, 0x39, 0xe9, 0xb3, 0x97, 0xb9, 0xd0, 0xf3, 0x97, 0xb9, 0xd0, 0x8f, 0x2f, 0x73, 0xa1, - 0x07, 0xef, 0xb6, 0x0d, 0xa7, 0x73, 0xb8, 0x5f, 0xd0, 0x69, 0xaf, 0xa8, 0x53, 0xbb, 0x47, 0x6d, - 0xf1, 0x73, 0xcd, 0x6e, 0x75, 0x8b, 0x8f, 0x8b, 0xc3, 0xcf, 0x66, 0xd7, 0x6f, 0x5e, 0xf3, 0xbf, - 0xc3, 0x39, 0xc7, 0x7d, 0x62, 0xef, 0xc7, 0xd9, 0x77, 0xb3, 0xff, 0xfd, 0x16, 0x00, 0x00, 0xff, - 0xff, 0xcb, 0x1c, 0xab, 0x37, 0xa8, 0x13, 0x00, 0x00, + // 1432 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6f, 0x1a, 0xc7, + 0x17, 0x67, 0x61, 0xc1, 0xf8, 0x19, 0xdb, 0x78, 0x6c, 0x13, 0x82, 0x13, 0x96, 0xac, 0xbe, 0x07, + 0x2b, 0x5f, 0x05, 0xe2, 0x34, 0xea, 0x8f, 0xa8, 0x87, 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5, 0x48, 0x85, 0x65, 0x8e, 0x7a, 0x58, 0x66, 0xbf, + 0xc5, 0x9d, 0xb8, 0x94, 0x5a, 0x3c, 0x3d, 0xcb, 0xcc, 0x0f, 0x14, 0xae, 0xc3, 0x1c, 0xe3, 0x21, + 0x84, 0xc3, 0x42, 0xe4, 0x1b, 0xe7, 0xf1, 0xf3, 0x57, 0x69, 0xe9, 0xc5, 0xab, 0xb4, 0xf4, 0xeb, + 0xab, 0xb4, 0xf4, 0xf5, 0xeb, 0x74, 0xe0, 0xc5, 0xeb, 0x74, 0xe0, 0x97, 0xd7, 0xe9, 0xc0, 0xc1, + 0x87, 0x4d, 0xdd, 0x6e, 0x1d, 0x1f, 0x66, 0x35, 0xda, 0xc9, 0x69, 0xd4, 0xea, 0x50, 0x4b, 0xfc, + 0xdc, 0xb0, 0x1a, 0xed, 0xdc, 0x93, 0xdc, 0xe0, 0xcf, 0xbd, 0x9b, 0xb7, 0x6f, 0x78, 0xff, 0x16, + 0xda, 0x27, 0x5d, 0x62, 0x1d, 0x46, 0xd8, 0xbf, 0x7b, 0xef, 0xfd, 0x11, 0x00, 0x00, 0xff, 0xff, + 0x12, 0x29, 0x8f, 0x28, 0x4e, 0x14, 0x00, 0x00, } func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { @@ -1058,7 +1063,7 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } { size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) @@ -1069,20 +1074,20 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintChannel(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a if len(m.ProofInit) > 0 { i -= len(m.ProofInit) copy(dAtA[i:], m.ProofInit) i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofInit))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } if len(m.CounterpartyVersion) > 0 { i -= len(m.CounterpartyVersion) copy(dAtA[i:], m.CounterpartyVersion) i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyVersion))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } { size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) @@ -1093,7 +1098,14 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintChannel(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + if len(m.ProvedChannelId) > 0 { + i -= len(m.ProvedChannelId) + copy(dAtA[i:], m.ProvedChannelId) + i = encodeVarintChannel(dAtA, i, uint64(len(m.ProvedChannelId))) + i-- + dAtA[i] = 0x1a + } if len(m.ChannelId) > 0 { i -= len(m.ChannelId) copy(dAtA[i:], m.ChannelId) @@ -1136,7 +1148,7 @@ func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } { size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) @@ -1147,19 +1159,26 @@ func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintChannel(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 if len(m.ProofTry) > 0 { i -= len(m.ProofTry) copy(dAtA[i:], m.ProofTry) i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofTry))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(m.CounterpartyVersion) > 0 { i -= len(m.CounterpartyVersion) copy(dAtA[i:], m.CounterpartyVersion) i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyVersion))) i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- dAtA[i] = 0x1a } if len(m.ChannelId) > 0 { @@ -2007,6 +2026,10 @@ func (m *MsgChannelOpenTry) Size() (n int) { if l > 0 { n += 1 + l + sovChannel(uint64(l)) } + l = len(m.ProvedChannelId) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } l = m.Channel.Size() n += 1 + l + sovChannel(uint64(l)) l = len(m.CounterpartyVersion) @@ -2040,6 +2063,10 @@ func (m *MsgChannelOpenAck) Size() (n int) { if l > 0 { n += 1 + l + sovChannel(uint64(l)) } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } l = len(m.CounterpartyVersion) if l > 0 { n += 1 + l + sovChannel(uint64(l)) @@ -2687,6 +2714,38 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProvedChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + 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 ErrInvalidLengthChannel + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProvedChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) } @@ -2719,7 +2778,7 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) } @@ -2751,7 +2810,7 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { } m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) } @@ -2785,7 +2844,7 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { m.ProofInit = []byte{} } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) } @@ -2818,7 +2877,7 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2968,6 +3027,38 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + 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 ErrInvalidLengthChannel + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) } @@ -2999,7 +3090,7 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { } m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProofTry", wireType) } @@ -3033,7 +3124,7 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { m.ProofTry = []byte{} } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) } @@ -3066,7 +3157,7 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } diff --git a/x/ibc/core/04-channel/types/errors.go b/x/ibc/core/04-channel/types/errors.go index 075adad6858c..82cf773057d7 100644 --- a/x/ibc/core/04-channel/types/errors.go +++ b/x/ibc/core/04-channel/types/errors.go @@ -24,4 +24,5 @@ var ( ErrPacketCommitmentNotFound = sdkerrors.Register(SubModuleName, 17, "packet commitment not found") ErrPacketReceived = sdkerrors.Register(SubModuleName, 18, "packet already received") ErrAcknowledgementExists = sdkerrors.Register(SubModuleName, 19, "acknowledgement for packet already exists") + ErrInvalidChannelIdentifier = sdkerrors.Register(SubModuleName, 20, "invalid channel identifier") ) diff --git a/x/ibc/core/04-channel/types/msgs.go b/x/ibc/core/04-channel/types/msgs.go index 1cfc318206d8..d1b36ac675d4 100644 --- a/x/ibc/core/04-channel/types/msgs.go +++ b/x/ibc/core/04-channel/types/msgs.go @@ -69,7 +69,7 @@ var _ sdk.Msg = &MsgChannelOpenTry{} // NewMsgChannelOpenTry creates a new MsgChannelOpenTry instance //nolint:interfacer func NewMsgChannelOpenTry( - portID, channelID, version string, channelOrder Order, connectionHops []string, + portID, channelID, provedChannelID, version string, channelOrder Order, connectionHops []string, counterpartyPortID, counterpartyChannelID, counterpartyVersion string, proofInit []byte, proofHeight clienttypes.Height, signer sdk.AccAddress, ) *MsgChannelOpenTry { @@ -78,6 +78,7 @@ func NewMsgChannelOpenTry( return &MsgChannelOpenTry{ PortId: portID, ChannelId: channelID, + ProvedChannelId: provedChannelID, Channel: channel, CounterpartyVersion: counterpartyVersion, ProofInit: proofInit, @@ -104,6 +105,9 @@ func (msg MsgChannelOpenTry) ValidateBasic() error { if err := host.ChannelIdentifierValidator(msg.ChannelId); err != nil { return sdkerrors.Wrap(err, "invalid channel ID") } + if msg.ProvedChannelId != "" && msg.ProvedChannelId != msg.ChannelId { + return sdkerrors.Wrap(ErrInvalidChannelIdentifier, "proved channel identifier must be empty or equal to channel identifier") + } if len(msg.ProofInit) == 0 { return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof init") } @@ -133,16 +137,17 @@ var _ sdk.Msg = &MsgChannelOpenAck{} // NewMsgChannelOpenAck creates a new MsgChannelOpenAck instance //nolint:interfacer func NewMsgChannelOpenAck( - portID, channelID string, cpv string, proofTry []byte, proofHeight clienttypes.Height, + portID, channelID, counterpartyChannelID string, cpv string, proofTry []byte, proofHeight clienttypes.Height, signer sdk.AccAddress, ) *MsgChannelOpenAck { return &MsgChannelOpenAck{ - PortId: portID, - ChannelId: channelID, - CounterpartyVersion: cpv, - ProofTry: proofTry, - ProofHeight: proofHeight, - Signer: signer.String(), + PortId: portID, + ChannelId: channelID, + CounterpartyChannelId: counterpartyChannelID, + CounterpartyVersion: cpv, + ProofTry: proofTry, + ProofHeight: proofHeight, + Signer: signer.String(), } } @@ -164,6 +169,9 @@ func (msg MsgChannelOpenAck) ValidateBasic() error { if err := host.ChannelIdentifierValidator(msg.ChannelId); err != nil { return sdkerrors.Wrap(err, "invalid channel ID") } + if err := host.ChannelIdentifierValidator(msg.CounterpartyChannelId); err != nil { + return sdkerrors.Wrap(err, "invalid counterparty channel ID") + } if len(msg.ProofTry) == 0 { return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof try") } diff --git a/x/ibc/core/04-channel/types/msgs_test.go b/x/ibc/core/04-channel/types/msgs_test.go index 39f0499ab377..be7c71353c56 100644 --- a/x/ibc/core/04-channel/types/msgs_test.go +++ b/x/ibc/core/04-channel/types/msgs_test.go @@ -158,24 +158,26 @@ func (suite *TypesTestSuite) TestMsgChannelOpenInit() { // TestMsgChannelOpenTry tests ValidateBasic for MsgChannelOpenTry func (suite *TypesTestSuite) TestMsgChannelOpenTry() { testMsgs := []*types.MsgChannelOpenTry{ - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // valid msg - types.NewMsgChannelOpenTry(invalidShortPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short port id - types.NewMsgChannelOpenTry(invalidLongPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long port id - types.NewMsgChannelOpenTry(invalidPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelOpenTry("testportid", invalidShortChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short channel id - types.NewMsgChannelOpenTry("testportid", invalidLongChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long channel id - types.NewMsgChannelOpenTry("testportid", invalidChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "", suite.proof, height, addr), // empty counterparty version - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // suite.proof height is zero - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.Order(4), connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // invalid channel order - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, invalidConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection hops more than 1 - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, invalidShortConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short connection id - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, invalidLongConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long connection id - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, []string{invalidConnection}, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection id contains non-alpha - types.NewMsgChannelOpenTry("testportid", "testchannel", "", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // empty channel version - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, connHops, invalidPort, "testcpchannel", "1.0", suite.proof, height, addr), // invalid counterparty port id - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, connHops, "testcpport", invalidChannel, "1.0", suite.proof, height, addr), // invalid counterparty channel id - types.NewMsgChannelOpenTry("testportid", "testchannel", "1.0", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", emptyProof, height, addr), // empty proof + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // valid msg + types.NewMsgChannelOpenTry(invalidShortPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short port id + types.NewMsgChannelOpenTry(invalidLongPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long port id + types.NewMsgChannelOpenTry(invalidPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // port id contains non-alpha + types.NewMsgChannelOpenTry("testportid", invalidShortChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short channel id + types.NewMsgChannelOpenTry("testportid", invalidLongChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long channel id + types.NewMsgChannelOpenTry("testportid", invalidChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // channel id contains non-alpha + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "", suite.proof, height, addr), // empty counterparty version + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // suite.proof height is zero + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.Order(4), connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // invalid channel order + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection hops more than 1 + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidShortConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short connection id + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidLongConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long connection id + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, []string{invalidConnection}, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection id contains non-alpha + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // empty channel version + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, invalidPort, "testcpchannel", "1.0", suite.proof, height, addr), // invalid counterparty port id + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, "testcpport", invalidChannel, "1.0", suite.proof, height, addr), // invalid counterparty channel id + types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", emptyProof, height, addr), // empty proof + types.NewMsgChannelOpenTry("testportid", "testchannel", "", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // valid proved channel id + types.NewMsgChannelOpenTry("testportid", "testchannel", "differentchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // different channel id } testCases := []struct { @@ -201,6 +203,8 @@ func (suite *TypesTestSuite) TestMsgChannelOpenTry() { {testMsgs[15], false, "invalid counterparty port id"}, {testMsgs[16], false, "invalid counterparty channel id"}, {testMsgs[17], false, "empty proof"}, + {testMsgs[18], true, "valid empty proved channel id"}, + {testMsgs[19], false, "invalid proved channel id, doesn't match channel id"}, } for i, tc := range testCases { @@ -216,16 +220,17 @@ func (suite *TypesTestSuite) TestMsgChannelOpenTry() { // TestMsgChannelOpenAck tests ValidateBasic for MsgChannelOpenAck func (suite *TypesTestSuite) TestMsgChannelOpenAck() { testMsgs := []*types.MsgChannelOpenAck{ - types.NewMsgChannelOpenAck("testportid", "testchannel", "1.0", suite.proof, height, addr), // valid msg - types.NewMsgChannelOpenAck(invalidShortPort, "testchannel", "1.0", suite.proof, height, addr), // too short port id - types.NewMsgChannelOpenAck(invalidLongPort, "testchannel", "1.0", suite.proof, height, addr), // too long port id - types.NewMsgChannelOpenAck(invalidPort, "testchannel", "1.0", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelOpenAck("testportid", invalidShortChannel, "1.0", suite.proof, height, addr), // too short channel id - types.NewMsgChannelOpenAck("testportid", invalidLongChannel, "1.0", suite.proof, height, addr), // too long channel id - types.NewMsgChannelOpenAck("testportid", invalidChannel, "1.0", suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelOpenAck("testportid", "testchannel", "", suite.proof, height, addr), // empty counterparty version - types.NewMsgChannelOpenAck("testportid", "testchannel", "1.0", emptyProof, height, addr), // empty proof - types.NewMsgChannelOpenAck("testportid", "testchannel", "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // proof height is zero + types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", suite.proof, height, addr), // valid msg + types.NewMsgChannelOpenAck(invalidShortPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // too short port id + types.NewMsgChannelOpenAck(invalidLongPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // too long port id + types.NewMsgChannelOpenAck(invalidPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // port id contains non-alpha + types.NewMsgChannelOpenAck("testportid", invalidShortChannel, chanid, "1.0", suite.proof, height, addr), // too short channel id + types.NewMsgChannelOpenAck("testportid", invalidLongChannel, chanid, "1.0", suite.proof, height, addr), // too long channel id + types.NewMsgChannelOpenAck("testportid", invalidChannel, chanid, "1.0", suite.proof, height, addr), // channel id contains non-alpha + types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "", suite.proof, height, addr), // empty counterparty version + types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", emptyProof, height, addr), // empty proof + types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // proof height is zero + types.NewMsgChannelOpenAck("testportid", "testchannel", invalidShortChannel, "1.0", suite.proof, height, addr), // invalid counterparty channel id } testCases := []struct { @@ -243,6 +248,7 @@ func (suite *TypesTestSuite) TestMsgChannelOpenAck() { {testMsgs[7], true, ""}, {testMsgs[8], false, "empty proof"}, {testMsgs[9], false, "proof height is zero"}, + {testMsgs[10], false, "invalid counterparty channel id"}, } for i, tc := range testCases { diff --git a/x/ibc/core/spec/01_concepts.md b/x/ibc/core/spec/01_concepts.md index 8ced5fb0de3f..7b565d410998 100644 --- a/x/ibc/core/spec/01_concepts.md +++ b/x/ibc/core/spec/01_concepts.md @@ -94,7 +94,9 @@ to support within their connection state. It is expected that this set of versions is from most preferred to least preferred. This is not a strict requirement for the SDK implementation of IBC because the party calling `ConnOpenTry` will greedily select the latest version it supports that the -counterparty supports as well. +counterparty supports as well. A specific version can optionally be passed +as `Version` to ensure that the handshake will either complete with that +version or fail. During `ConnOpenTry`, party B will select a version from the counterparty's supported versions. Priority will be placed on the latest supported version. diff --git a/x/ibc/core/spec/04_messages.md b/x/ibc/core/spec/04_messages.md index 6e68a11fac0c..65d055d0d685 100644 --- a/x/ibc/core/spec/04_messages.md +++ b/x/ibc/core/spec/04_messages.md @@ -91,6 +91,7 @@ type MsgConnectionOpenInit struct { ClientId string ConnectionId string Counterparty Counterparty + Version string Signer sdk.AccAddress } ``` @@ -99,6 +100,7 @@ This message is expected to fail if: - `ClientId` is invalid (see naming requirements) - `ConnectionId` is invalid (see naming requirements) - `Counterparty` is empty +- 'Version' is not empty and invalid - `Signer` is empty - A Client hasn't been created for the given ID - A Connection for the given ID already exists @@ -114,6 +116,7 @@ using the `MsgConnectionOpenTry`. type MsgConnectionOpenTry struct { ClientId string ConnectionId string + ProvedId string ClientState *types.Any // proto-packed counterparty client Counterparty Counterparty CounterpartyVersions []string @@ -130,6 +133,7 @@ This message is expected to fail if: - `ClientId` is invalid (see naming requirements) - `ConnectionId` is invalid (see naming requirements) +- `ProvedId` is not empty and doesn't match `ConnectionId` - `ClientState` is not a valid client of the executing chain - `Counterparty` is empty - `CounterpartyVersions` is empty @@ -145,7 +149,10 @@ This message is expected to fail if: - `ProofClient` does not prove that the counterparty has stored the `ClientState` provided in message - `ProofConsensus` does not prove that the counterparty has the correct consensus state for this chain -The message creates a connection for the given ID with an TRYOPEN State. +The message creates a connection for the given ID with an TRYOPEN State. The `ProvedID` +represents the connection ID the counterparty set under `connection.Counterparty.ConnectionId` +to represent the connection ID this chain should use. An empty string indicates the connection +identifier is flexible and gives this chain an opportunity to choose its own identifier. ### MsgConnectionOpenAck @@ -154,21 +161,23 @@ using the `MsgConnectionOpenAck`. ```go type MsgConnectionOpenAck struct { - ConnectionId string - Version string - ClientState *types.Any // proto-packed counterparty client - ProofHeight Height - ProofTry []byte - ProofClient []byte - ProofConsensus []byte - ConsensusHeight Height - Signer sdk.AccAddress + ConnectionId string + CounterpartyConnectionId string + Version string + ClientState *types.Any // proto-packed counterparty client + ProofHeight Height + ProofTry []byte + ProofClient []byte + ProofConsensus []byte + ConsensusHeight Height + Signer sdk.AccAddress } ``` This message is expected to fail if: - `ConnectionId` is invalid (see naming requirements) +- `CounterpartyConnectionId` is invalid (see naming requirements) - `Version` is empty - `ClientState` is not a valid client of the executing chain - `ProofHeight` is zero @@ -181,7 +190,8 @@ This message is expected to fail if: - `ProofClient` does not prove that the counterparty has stored the `ClientState` provided by message - `ProofConsensus` does not prove that the counterparty has the correct consensus state for this chain -The message sets the connection state for the given ID to OPEN. +The message sets the connection state for the given ID to OPEN. `CounterpartyConnectionId` +should be the `ConnectionId` used by the counterparty connection. ### MsgConnectionOpenConfirm @@ -244,6 +254,7 @@ the `MsgChannelOpenTry` message. type MsgChannelOpenTry struct { PortId string ChannelId string + ProvedChannelId string Channel Channel CounterpartyVersion string ProofInit []byte @@ -256,6 +267,7 @@ This message is expected to fail if: - `PortId` is invalid (see naming requirements) - `ChannelId` is invalid (see naming requirements) +- `ProvedId` is not empty and not equal to `ChannelId` - `Channel` is empty - `CounterpartyVersion` is empty - `ProofInit` is empty @@ -265,7 +277,11 @@ This message is expected to fail if: - `ProofInit` does not prove that the counterparty's Channel state is in INIT The message creates a channel on chain B with an TRYOPEN state for the given Channel ID -and Port ID. +and Port ID. The `ProvedChannelId` represents the channel ID the counterparty set under +`connection.Counterparty.ChannelId` to represent the channel ID this chain should use. +An empty string indicates the channel identifier is flexible and gives this chain an +opportunity to choose its own identifier. + ### MsgChannelOpenAck @@ -273,12 +289,13 @@ A channel handshake is opened by a chain A using the `MsgChannelOpenAck` message ```go type MsgChannelOpenAck struct { - PortId string - ChannelId string - CounterpartyVersion string - ProofTry []byte - ProofHeight Height - Signer sdk.AccAddress + PortId string + ChannelId string + CounterpartyChannelId string + CounterpartyVersion string + ProofTry []byte + ProofHeight Height + Signer sdk.AccAddress } ``` @@ -286,6 +303,7 @@ This message is expected to fail if: - `PortId` is invalid (see naming requirements) - `ChannelId` is invalid (see naming requirements) +- `CounterpartyChannelId` is invalid (see naming requirements) - `CounterpartyVersion` is empty - `ProofTry` is empty - `ProofHeight` is zero @@ -293,6 +311,7 @@ This message is expected to fail if: - `ProofTry` does not prove that the counterparty's Channel state is in TRYOPEN The message sets a channel on chain A to state OPEN for the given Channel ID and Port ID. +`CounterpartyChannelId` should be the `ChannelId` used by the counterparty channel. ### MsgChannelOpenConfirm diff --git a/x/ibc/testing/chain.go b/x/ibc/testing/chain.go index 4e3f31a06c4c..654fe473316e 100644 --- a/x/ibc/testing/chain.go +++ b/x/ibc/testing/chain.go @@ -592,7 +592,7 @@ func (chain *TestChain) ConnectionOpenTry( proofConsensus, consensusHeight := counterparty.QueryConsensusStateProof(counterpartyConnection.ClientID) msg := connectiontypes.NewMsgConnectionOpenTry( - connection.ID, connection.ID, connection.ClientID, + connection.ID, connection.ID, connection.ClientID, // testing doesn't use flexible selection counterpartyConnection.ID, counterpartyConnection.ClientID, counterpartyClient, counterparty.GetPrefix(), []string{ConnectionVersion}, proofInit, proofClient, proofConsensus, @@ -615,7 +615,7 @@ func (chain *TestChain) ConnectionOpenAck( proofConsensus, consensusHeight := counterparty.QueryConsensusStateProof(counterpartyConnection.ClientID) msg := connectiontypes.NewMsgConnectionOpenAck( - connection.ID, counterpartyConnection.ID, counterpartyClient, + connection.ID, counterpartyConnection.ID, counterpartyClient, // testing doesn't use flexible selection proofTry, proofClient, proofConsensus, proofHeight, consensusHeight, ConnectionVersion, @@ -732,7 +732,7 @@ func (chain *TestChain) ChanOpenTry( proof, height := counterparty.QueryProof(host.KeyChannel(counterpartyCh.PortID, counterpartyCh.ID)) msg := channeltypes.NewMsgChannelOpenTry( - ch.PortID, ch.ID, + ch.PortID, ch.ID, ch.ID, // testing doesn't use flexible selection ch.Version, order, []string{connectionID}, counterpartyCh.PortID, counterpartyCh.ID, counterpartyCh.Version, @@ -751,7 +751,7 @@ func (chain *TestChain) ChanOpenAck( msg := channeltypes.NewMsgChannelOpenAck( ch.PortID, ch.ID, - counterpartyCh.Version, + counterpartyCh.ID, counterpartyCh.Version, // testing doesn't use flexible selection proof, height, chain.SenderAccount.GetAddress(), )