diff --git a/CHANGELOG.md b/CHANGELOG.md index 15bf83ab959..315c60c7e79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v7.8.0]() + +### State Machine Breaking + +* (core/03-connection)[\#7128](https://github.com/cosmos/ibc-go/pull/7128) Remove verification of self client and consensus state from connection handshake. + ## [v7.7.0](https://github.com/cosmos/ibc-go/releases/tag/v7.7.0) - 2024-07-29 ### Dependencies diff --git a/modules/core/03-connection/keeper/handshake.go b/modules/core/03-connection/keeper/handshake.go index 53417a2aa9e..48d224ecd3a 100644 --- a/modules/core/03-connection/keeper/handshake.go +++ b/modules/core/03-connection/keeper/handshake.go @@ -72,37 +72,17 @@ func (k Keeper) ConnOpenTry( counterparty types.Counterparty, // counterpartyConnectionIdentifier, counterpartyPrefix and counterpartyClientIdentifier delayPeriod uint64, clientID string, // clientID of chainA - clientState exported.ClientState, // clientState that chainA has for chainB + _ exported.ClientState, // clientState that chainA has for chainB counterpartyVersions []exported.Version, // supported versions of chain A proofInit []byte, // proof that chainA stored connectionEnd in state (on ConnOpenInit) - proofClient []byte, // proof that chainA stored a light client of chainB - proofConsensus []byte, // proof that chainA stored chainB's consensus state at consensus height + _ []byte, // proof that chainA stored a light client of chainB + _ []byte, // proof that chainA stored chainB's consensus state at consensus height proofHeight exported.Height, // height at which relayer constructs proof of A storing connectionEnd in state - consensusHeight exported.Height, // latest height of chain B which chain A has stored in its chain B client + _ exported.Height, // latest height of chain B which chain A has stored in its chain B client ) (string, error) { // generate a new connection connectionID := k.GenerateConnectionIdentifier(ctx) - // check that the consensus height the counterparty chain is using to store a representation - // of this chain's consensus state is at a height in the past - selfHeight := clienttypes.GetSelfHeight(ctx) - if consensusHeight.GTE(selfHeight) { - return "", sdkerrors.Wrapf( - sdkerrors.ErrInvalidHeight, - "consensus height is greater than or equal to the current block height (%s >= %s)", consensusHeight, selfHeight, - ) - } - - // validate client parameters of a chainB client stored on chainA - if err := k.clientKeeper.ValidateSelfClient(ctx, clientState); err != nil { - return "", err - } - - expectedConsensusState, err := k.clientKeeper.GetSelfConsensusState(ctx, consensusHeight) - if err != nil { - return "", sdkerrors.Wrapf(err, "self consensus state not found for height %s", consensusHeight.String()) - } - // expectedConnection defines Chain A's ConnectionEnd // NOTE: chain A's counterparty is chain B (i.e where this code is executed) // NOTE: chainA and chainB must have the same delay period @@ -129,18 +109,6 @@ func (k Keeper) ConnOpenTry( return "", err } - // Check that ChainA stored the clientState provided in the msg - if err := k.VerifyClientState(ctx, connection, proofHeight, proofClient, clientState); err != nil { - return "", err - } - - // Check that ChainA stored the correct ConsensusState of chainB at the given consensusHeight - if err := k.VerifyClientConsensusState( - ctx, connection, proofHeight, consensusHeight, proofConsensus, expectedConsensusState, - ); err != nil { - return "", err - } - // store connection in chainB state if err := k.addConnectionToClient(ctx, clientID, connectionID); err != nil { return "", sdkerrors.Wrapf(err, "failed to add connection with ID %s to client with ID %s", connectionID, clientID) @@ -165,25 +133,15 @@ func (k Keeper) ConnOpenTry( func (k Keeper) ConnOpenAck( ctx sdk.Context, connectionID string, - clientState exported.ClientState, // client state for chainA on chainB + _ exported.ClientState, // client state for chainA on chainB version *types.Version, // version that ChainB chose in ConnOpenTry counterpartyConnectionID string, proofTry []byte, // proof that connectionEnd was added to ChainB state in ConnOpenTry - proofClient []byte, // proof of client state on chainB for chainA - proofConsensus []byte, // proof that chainB has stored ConsensusState of chainA on its client + _ []byte, // proof of client state on chainB for chainA + _ []byte, // proof that chainB has stored ConsensusState of chainA on its client proofHeight exported.Height, // height that relayer constructed proofTry - consensusHeight exported.Height, // latest height of chainA that chainB has stored on its chainA client + _ exported.Height, // latest height of chainA that chainB has stored on its chainA client ) error { - // check that the consensus height the counterparty chain is using to store a representation - // of this chain's consensus state is at a height in the past - selfHeight := clienttypes.GetSelfHeight(ctx) - if consensusHeight.GTE(selfHeight) { - return sdkerrors.Wrapf( - sdkerrors.ErrInvalidHeight, - "consensus height is greater than or equal to the current block height (%s >= %s)", consensusHeight, selfHeight, - ) - } - // Retrieve connection connection, found := k.GetConnection(ctx, connectionID) if !found { @@ -206,17 +164,6 @@ func (k Keeper) ConnOpenAck( ) } - // validate client parameters of a chainA client stored on chainB - if err := k.clientKeeper.ValidateSelfClient(ctx, clientState); err != nil { - return err - } - - // Retrieve chainA's consensus state at consensusheight - expectedConsensusState, err := k.clientKeeper.GetSelfConsensusState(ctx, consensusHeight) - if err != nil { - return sdkerrors.Wrapf(err, "self consensus state not found for height %s", consensusHeight.String()) - } - prefix := k.GetCommitmentPrefix() expectedCounterparty := types.NewCounterparty(connection.ClientId, connectionID, commitmenttypes.NewMerklePrefix(prefix.Bytes())) expectedConnection := types.NewConnectionEnd(types.TRYOPEN, connection.Counterparty.ClientId, expectedCounterparty, []*types.Version{version}, connection.DelayPeriod) @@ -229,18 +176,6 @@ func (k Keeper) ConnOpenAck( return err } - // Check that ChainB stored the clientState provided in the msg - if err := k.VerifyClientState(ctx, connection, proofHeight, proofClient, clientState); err != nil { - return err - } - - // Ensure that ChainB has stored the correct ConsensusState for chainA at the consensusHeight - if err := k.VerifyClientConsensusState( - ctx, connection, proofHeight, consensusHeight, proofConsensus, expectedConsensusState, - ); err != nil { - return err - } - k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", "INIT", "new-state", "OPEN") defer func() { diff --git a/modules/core/03-connection/keeper/handshake_test.go b/modules/core/03-connection/keeper/handshake_test.go index 5751c9e531a..09f1b897363 100644 --- a/modules/core/03-connection/keeper/handshake_test.go +++ b/modules/core/03-connection/keeper/handshake_test.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ibctesting "github.com/cosmos/ibc-go/v7/testing" ) @@ -132,38 +131,6 @@ func (suite *KeeperTestSuite) TestConnOpenTry() { // retrieve client state of chainA to pass as counterpartyClient counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) }, true}, - {"invalid counterparty client", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) - - // Set an invalid client of chainA on chainB - tmClient, ok := counterpartyClient.(*ibctm.ClientState) - suite.Require().True(ok) - tmClient.ChainId = "wrongchainid" - - suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmClient) - }, false}, - {"consensus height >= latest height", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainA to pass as counterpartyClient - counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) - - consensusHeight = clienttypes.GetSelfHeight(suite.chainB.GetContext()) - }, false}, - {"self consensus state not found", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainA to pass as counterpartyClient - counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) - - consensusHeight = clienttypes.NewHeight(0, 1) - }, false}, {"counterparty versions is empty", func() { err := path.EndpointA.ConnOpenInit() suite.Require().NoError(err) @@ -189,35 +156,6 @@ func (suite *KeeperTestSuite) TestConnOpenTry() { // retrieve client state of chainA to pass as counterpartyClient counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) }, false}, - {"client state verification failed", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainA to pass as counterpartyClient - counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) - - // modify counterparty client without setting in store so it still passes validate but fails proof verification - tmClient, ok := counterpartyClient.(*ibctm.ClientState) - suite.Require().True(ok) - tmClient.LatestHeight = tmClient.LatestHeight.Increment().(clienttypes.Height) - }, false}, - {"consensus state verification failed", func() { - // retrieve client state of chainA to pass as counterpartyClient - counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID) - - // give chainA wrong consensus state for chainB - consState, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetLatestClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID) - suite.Require().True(found) - - tmConsState, ok := consState.(*ibctm.ConsensusState) - suite.Require().True(ok) - - tmConsState.Timestamp = time.Now() - suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, counterpartyClient.GetLatestHeight(), tmConsState) - - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - }, false}, } for _, tc := range testCases { @@ -295,35 +233,6 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { // retrieve client state of chainB to pass as counterpartyClient counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) }, true}, - {"invalid counterparty client", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - err = path.EndpointB.ConnOpenTry() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - - // Set an invalid client of chainA on chainB - tmClient, ok := counterpartyClient.(*ibctm.ClientState) - suite.Require().True(ok) - tmClient.ChainId = "wrongchainid" - - suite.chainB.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainB.GetContext(), path.EndpointB.ClientID, tmClient) - }, false}, - {"consensus height >= latest height", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - - err = path.EndpointB.ConnOpenTry() - suite.Require().NoError(err) - - consensusHeight = clienttypes.GetSelfHeight(suite.chainA.GetContext()) - }, false}, {"connection not found", func() { // connections are never created @@ -334,9 +243,6 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { err := path.EndpointA.ConnOpenInit() suite.Require().NoError(err) - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - err = path.EndpointB.ConnOpenTry() suite.Require().NoError(err) @@ -345,6 +251,7 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { suite.Require().True(found) connection.Counterparty.ConnectionId = "badconnectionid" + path.EndpointB.ConnectionID = "badconnectionid" suite.chainA.App.GetIBCKeeper().ConnectionKeeper.SetConnection(suite.chainA.GetContext(), path.EndpointA.ConnectionID, connection) @@ -418,18 +325,6 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { version = types.NewVersion(types.DefaultIBCVersionIdentifier, []string{"ORDER_ORDERED", "ORDER_UNORDERED", "ORDER_DAG"}) }, false}, - {"self consensus state not found", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - - err = path.EndpointB.ConnOpenTry() - suite.Require().NoError(err) - - consensusHeight = clienttypes.NewHeight(0, 1) - }, false}, {"connection state verification failed", func() { // chainB connection is not in INIT err := path.EndpointA.ConnOpenInit() @@ -438,41 +333,6 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { // retrieve client state of chainB to pass as counterpartyClient counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) }, false}, - {"client state verification failed", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - - // modify counterparty client without setting in store so it still passes validate but fails proof verification - tmClient, ok := counterpartyClient.(*ibctm.ClientState) - suite.Require().True(ok) - tmClient.LatestHeight = tmClient.LatestHeight.Increment().(clienttypes.Height) - - err = path.EndpointB.ConnOpenTry() - suite.Require().NoError(err) - }, false}, - {"consensus state verification failed", func() { - err := path.EndpointA.ConnOpenInit() - suite.Require().NoError(err) - - // retrieve client state of chainB to pass as counterpartyClient - counterpartyClient = suite.chainB.GetClientState(path.EndpointB.ClientID) - - // give chainB wrong consensus state for chainA - consState, found := suite.chainB.App.GetIBCKeeper().ClientKeeper.GetLatestClientConsensusState(suite.chainB.GetContext(), path.EndpointB.ClientID) - suite.Require().True(found) - - tmConsState, ok := consState.(*ibctm.ConsensusState) - suite.Require().True(ok) - - tmConsState.Timestamp = tmConsState.Timestamp.Add(time.Second) - suite.chainB.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainB.GetContext(), path.EndpointB.ClientID, counterpartyClient.GetLatestHeight(), tmConsState) - - err = path.EndpointB.ConnOpenTry() - suite.Require().NoError(err) - }, false}, } for _, tc := range testCases { diff --git a/modules/core/03-connection/types/msgs.go b/modules/core/03-connection/types/msgs.go index 96a9f84a743..eae15495252 100644 --- a/modules/core/03-connection/types/msgs.go +++ b/modules/core/03-connection/types/msgs.go @@ -120,16 +120,6 @@ func (msg MsgConnectionOpenTry) ValidateBasic() error { if err := host.ConnectionIdentifierValidator(msg.Counterparty.ConnectionId); err != nil { return sdkerrors.Wrap(err, "invalid counterparty connection ID") } - if msg.ClientState == nil { - return sdkerrors.Wrap(clienttypes.ErrInvalidClient, "counterparty client is nil") - } - clientState, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return sdkerrors.Wrapf(clienttypes.ErrInvalidClient, "unpack err: %v", err) - } - if err := clientState.Validate(); err != nil { - return sdkerrors.Wrap(err, "counterparty client is invalid") - } if len(msg.CounterpartyVersions) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidVersion, "empty counterparty versions") } @@ -141,16 +131,7 @@ func (msg MsgConnectionOpenTry) ValidateBasic() error { if len(msg.ProofInit) == 0 { return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof init") } - if len(msg.ProofClient) == 0 { - return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit empty proof client") - } - if len(msg.ProofConsensus) == 0 { - return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof of consensus state") - } - if msg.ConsensusHeight.IsZero() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "consensus height must be non-zero") - } - _, err = sdk.AccAddressFromBech32(msg.Signer) + _, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) } @@ -212,29 +193,10 @@ func (msg MsgConnectionOpenAck) ValidateBasic() error { if err := ValidateVersion(msg.Version); err != nil { return err } - if msg.ClientState == nil { - return sdkerrors.Wrap(clienttypes.ErrInvalidClient, "counterparty client is nil") - } - clientState, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return sdkerrors.Wrapf(clienttypes.ErrInvalidClient, "unpack err: %v", err) - } - if err := clientState.Validate(); err != nil { - return sdkerrors.Wrap(err, "counterparty client is invalid") - } if len(msg.ProofTry) == 0 { return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof try") } - if len(msg.ProofClient) == 0 { - return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit empty proof client") - } - if len(msg.ProofConsensus) == 0 { - return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof of consensus state") - } - if msg.ConsensusHeight.IsZero() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "consensus height must be non-zero") - } - _, err = sdk.AccAddressFromBech32(msg.Signer) + _, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) } diff --git a/modules/core/03-connection/types/msgs_test.go b/modules/core/03-connection/types/msgs_test.go index bc75adf6116..fd11b31b253 100644 --- a/modules/core/03-connection/types/msgs_test.go +++ b/modules/core/03-connection/types/msgs_test.go @@ -3,7 +3,6 @@ package types_test import ( "fmt" "testing" - "time" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" @@ -119,17 +118,8 @@ func (suite *MsgTestSuite) TestNewMsgConnectionOpenTry() { suite.Require().NoError(err) // Pack consensus state into any to test unpacking error - consState := ibctm.NewConsensusState( - time.Now(), commitmenttypes.NewMerkleRoot([]byte("root")), []byte("nextValsHash"), - ) - invalidAny := clienttypes.MustPackConsensusState(consState) counterparty := types.NewCounterparty("connectiontotest", "clienttotest", prefix) - // invalidClientState fails validateBasic - invalidClient := ibctm.NewClientState( - chainID, ibctm.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clienttypes.ZeroHeight(), commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, - ) - testCases := []struct { name string msg *types.MsgConnectionOpenTry @@ -140,15 +130,9 @@ func (suite *MsgTestSuite) TestNewMsgConnectionOpenTry() { {"invalid client ID", types.NewMsgConnectionOpenTry("test/iris", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, {"invalid counterparty connection ID", types.NewMsgConnectionOpenTry("clienttotesta", "ibc/test", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, {"invalid counterparty client ID", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "test/conn1", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, - {"invalid nil counterparty client", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", nil, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, - {"invalid client unpacking", &types.MsgConnectionOpenTry{"", "clienttotesta", invalidAny, counterparty, 500, []*types.Version{ibctesting.ConnectionVersion}, clientHeight, suite.proof, suite.proof, suite.proof, clientHeight, signer, nil}, false}, - {"counterparty failed validate", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", invalidClient, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, {"empty counterparty prefix", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, emptyPrefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, {"empty counterpartyVersions", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, {"empty proofInit", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, emptyProof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, - {"empty proofClient", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, emptyProof, suite.proof, clientHeight, clientHeight, signer), false}, - {"empty proofConsensus", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, emptyProof, clientHeight, clientHeight, signer), false}, - {"invalid consensusHeight", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clienttypes.ZeroHeight(), signer), false}, {"empty singer", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ""), false}, {"success", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{ibctesting.ConnectionVersion}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), true}, {"invalid version", types.NewMsgConnectionOpenTry("clienttotesta", "connectiontotest", "clienttotest", clientState, prefix, []*types.Version{{}}, 500, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, signer), false}, @@ -169,16 +153,6 @@ func (suite *MsgTestSuite) TestNewMsgConnectionOpenAck() { chainID, ibctm.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, ) - // Pack consensus state into any to test unpacking error - consState := ibctm.NewConsensusState( - time.Now(), commitmenttypes.NewMerkleRoot([]byte("root")), []byte("nextValsHash"), - ) - invalidAny := clienttypes.MustPackConsensusState(consState) - - // invalidClientState fails validateBasic - invalidClient := ibctm.NewClientState( - chainID, ibctm.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clienttypes.ZeroHeight(), commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, - ) connectionID := "connection-0" testCases := []struct { @@ -188,13 +162,7 @@ func (suite *MsgTestSuite) TestNewMsgConnectionOpenAck() { }{ {"invalid connection ID", types.NewMsgConnectionOpenAck("test/conn1", connectionID, clientState, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, {"invalid counterparty connection ID", types.NewMsgConnectionOpenAck(connectionID, "test/conn1", clientState, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, - {"invalid nil counterparty client", types.NewMsgConnectionOpenAck(connectionID, connectionID, nil, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, - {"invalid unpacking counterparty client", &types.MsgConnectionOpenAck{connectionID, connectionID, ibctesting.ConnectionVersion, invalidAny, clientHeight, suite.proof, suite.proof, suite.proof, clientHeight, signer, nil}, false}, - {"counterparty client failed validate", types.NewMsgConnectionOpenAck(connectionID, connectionID, invalidClient, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, {"empty proofTry", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, emptyProof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, - {"empty proofClient", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, emptyProof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, - {"empty proofConsensus", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, suite.proof, emptyProof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), false}, - {"invalid consensusHeight", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, suite.proof, suite.proof, clientHeight, clienttypes.ZeroHeight(), ibctesting.ConnectionVersion, signer), false}, {"invalid version", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, &types.Version{}, signer), false}, {"empty signer", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, ""), false}, {"success", types.NewMsgConnectionOpenAck(connectionID, connectionID, clientState, suite.proof, suite.proof, suite.proof, clientHeight, clientHeight, ibctesting.ConnectionVersion, signer), true}, diff --git a/modules/core/03-connection/types/tx.pb.go b/modules/core/03-connection/types/tx.pb.go index acfeff2341d..31629286cfd 100644 --- a/modules/core/03-connection/types/tx.pb.go +++ b/modules/core/03-connection/types/tx.pb.go @@ -117,7 +117,7 @@ type MsgConnectionOpenTry struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. PreviousConnectionId string `protobuf:"bytes,2,opt,name=previous_connection_id,json=previousConnectionId,proto3" json:"previous_connection_id,omitempty" yaml:"previous_connection_id"` // Deprecated: Do not use. - ClientState *types.Any `protobuf:"bytes,3,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + ClientState *types.Any `protobuf:"bytes,3,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` // Deprecated: Do not use. Counterparty Counterparty `protobuf:"bytes,4,opt,name=counterparty,proto3" json:"counterparty"` DelayPeriod uint64 `protobuf:"varint,5,opt,name=delay_period,json=delayPeriod,proto3" json:"delay_period,omitempty" yaml:"delay_period"` CounterpartyVersions []*Version `protobuf:"bytes,6,rep,name=counterparty_versions,json=counterpartyVersions,proto3" json:"counterparty_versions,omitempty" yaml:"counterparty_versions"` @@ -126,13 +126,13 @@ type MsgConnectionOpenTry struct { // INIT` ProofInit []byte `protobuf:"bytes,8,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` // proof of client state included in message - ProofClient []byte `protobuf:"bytes,9,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` + ProofClient []byte `protobuf:"bytes,9,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` // Deprecated: Do not use. // proof of client consensus state - ProofConsensus []byte `protobuf:"bytes,10,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` - ConsensusHeight types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` + ProofConsensus []byte `protobuf:"bytes,10,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` // Deprecated: Do not use. + ConsensusHeight types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` // Deprecated: Do not use. Signer string `protobuf:"bytes,12,opt,name=signer,proto3" json:"signer,omitempty"` // optional proof data for host state machines that are unable to introspect their own consensus state - HostConsensusStateProof []byte `protobuf:"bytes,13,opt,name=host_consensus_state_proof,json=hostConsensusStateProof,proto3" json:"host_consensus_state_proof,omitempty"` + HostConsensusStateProof []byte `protobuf:"bytes,13,opt,name=host_consensus_state_proof,json=hostConsensusStateProof,proto3" json:"host_consensus_state_proof,omitempty"` // Deprecated: Do not use. } func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } @@ -391,68 +391,70 @@ func init() { func init() { proto.RegisterFile("ibc/core/connection/v1/tx.proto", fileDescriptor_5d00fde5fc97399e) } var fileDescriptor_5d00fde5fc97399e = []byte{ - // 965 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x31, 0x73, 0xe3, 0x44, - 0x14, 0xb6, 0x62, 0xc7, 0xb1, 0xd7, 0x3e, 0xee, 0x6e, 0x71, 0x12, 0x21, 0xee, 0x2c, 0x23, 0x60, - 0x48, 0x41, 0xa4, 0xf3, 0xdd, 0x31, 0x40, 0x80, 0x22, 0x76, 0x43, 0x8a, 0x83, 0x8c, 0xb8, 0xb9, - 0x19, 0xae, 0xf1, 0xd8, 0xf2, 0x46, 0xd9, 0xb1, 0xad, 0xf5, 0x68, 0x65, 0x83, 0x68, 0x69, 0x18, - 0x2a, 0x7e, 0x01, 0x73, 0xff, 0x81, 0x3f, 0x71, 0x65, 0x0a, 0x0a, 0x2a, 0x0d, 0x93, 0x34, 0xd4, - 0xee, 0xe8, 0x98, 0xdd, 0x95, 0xe4, 0xb5, 0x23, 0x0f, 0x31, 0x0e, 0x9d, 0x9e, 0xde, 0xf7, 0xde, - 0xdb, 0xf7, 0xf6, 0xfb, 0xde, 0x48, 0x40, 0xc7, 0x3d, 0xc7, 0x72, 0x88, 0x8f, 0x2c, 0x87, 0x78, - 0x1e, 0x72, 0x02, 0x4c, 0x3c, 0x6b, 0xda, 0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xb3, 0x3b, 0xbb, 0x79, 0xe1, 0x63, 0x67, 0xb0, 0x46, 0x61, 0x89, 0xa6, 0xf0, 0x47, 0x05, - 0xec, 0x66, 0x73, 0xf4, 0xd1, 0x8d, 0xf3, 0xc5, 0x11, 0xda, 0x27, 0xeb, 0x46, 0x24, 0xa7, 0x68, - 0xbd, 0x78, 0x7d, 0x59, 0x57, 0x2e, 0x2e, 0xeb, 0xca, 0x9f, 0x97, 0x75, 0xe5, 0x97, 0xab, 0x7a, - 0xee, 0xe2, 0xaa, 0x9e, 0xfb, 0xe3, 0xaa, 0x9e, 0x7b, 0xf9, 0xb9, 0x8b, 0x83, 0xf3, 0x49, 0xcf, - 0x74, 0xc8, 0xc8, 0x72, 0x08, 0x1d, 0x11, 0x6a, 0xe1, 0x9e, 0x73, 0xe8, 0x12, 0x6b, 0xfa, 0xb1, - 0x35, 0x22, 0xfd, 0xc9, 0x10, 0x51, 0xf1, 0x7b, 0xf0, 0xe8, 0xc9, 0xa1, 0xf4, 0x87, 0x10, 0x84, - 0x63, 0x44, 0x7b, 0x45, 0xbe, 0xaf, 0x9f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x40, 0xa4, 0x36, - 0x0d, 0xd0, 0x0c, 0x00, 0x00, + // 1008 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x73, 0xdb, 0x44, + 0x14, 0xb7, 0x62, 0xc7, 0x89, 0xd7, 0x2e, 0x6d, 0x85, 0x13, 0x2b, 0x22, 0xb5, 0x5c, 0x01, 0x43, + 0x0e, 0x44, 0xaa, 0xdb, 0x32, 0x40, 0x28, 0xc3, 0xc4, 0x1e, 0x66, 0xc8, 0xa1, 0x90, 0x11, 0x9d, + 0xce, 0xd0, 0x8b, 0xc7, 0x96, 0x37, 0xb2, 0xc6, 0xb6, 0xd6, 0xa3, 0x95, 0x0d, 0xe2, 0xca, 0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 0x0a, 0x57, 0x78, 0x0a, 0x8b, 0xdf, 0x00, 0x79, 0x80, 0xb0, 0xb7, 0x08, 0x93, 0x0d, + 0x71, 0x87, 0x06, 0x2a, 0xdd, 0xa2, 0x39, 0x6d, 0x48, 0x82, 0x51, 0x23, 0xa8, 0x38, 0x70, 0x3a, + 0xd8, 0xa7, 0x04, 0xc2, 0xed, 0x80, 0x3a, 0xd8, 0x4f, 0x63, 0x78, 0xbc, 0x02, 0xfe, 0x2a, 0xa6, + 0xac, 0x80, 0x63, 0x73, 0x28, 0x7e, 0x0d, 0x6e, 0x25, 0x69, 0xcc, 0xd6, 0x80, 0x34, 0x0f, 0x94, + 0x6a, 0x9c, 0x22, 0xc7, 0x5e, 0xc2, 0x07, 0x8e, 0xb3, 0x26, 0x90, 0x13, 0xb3, 0x98, 0xb6, 0x12, + 0x3e, 0x9e, 0x07, 0xca, 0xfd, 0x94, 0xb9, 0x5d, 0x32, 0x2c, 0xf1, 0xc2, 0xc4, 0x62, 0xb8, 0xc1, + 0xe6, 0x3d, 0x5d, 0xda, 0x29, 0x85, 0x4b, 0x76, 0x4a, 0x2d, 0x63, 0xa7, 0x24, 0x37, 0xca, 0x32, + 0x9b, 0x36, 0xdf, 0x21, 0x9b, 0x9a, 0x80, 0x91, 0xa4, 0xe3, 0xb9, 0xbe, 0x54, 0xa4, 0xfd, 0xe7, + 0xf6, 0x71, 0x2c, 0x52, 0x8d, 0x6d, 0xfa, 0x4d, 0x56, 0xf8, 0xd1, 0x12, 0x95, 0xb6, 0xa8, 0x56, + 0x2d, 0x83, 0x4a, 0x49, 0x22, 0xb5, 0x57, 0x89, 0xc4, 0x18, 0x2c, 0x67, 0x13, 0x69, 0x85, 0x46, + 0x67, 0x29, 0x34, 0x2a, 0x5d, 0x59, 0x13, 0xe5, 0x0a, 0x1a, 0x5d, 0x46, 0x22, 0x90, 0x20, 0xd1, + 0x57, 0x97, 0x92, 0x88, 0x10, 0xba, 0xf2, 0xb6, 0x04, 0x3a, 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 0x04, + 0x31, 0xfb, 0x55, 0x78, 0xf0, 0xe8, 0x90, 0xfb, 0x5b, 0xf0, 0xfc, 0x09, 0xc4, 0xbd, 0x22, 0xdd, + 0xd7, 0x8f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x24, 0x83, 0xf0, 0xdc, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index 47fff9c102e..160e83dbb27 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -112,13 +112,8 @@ func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.M func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - if _, err := k.ConnectionKeeper.ConnOpenTry( - ctx, msg.Counterparty, msg.DelayPeriod, msg.ClientId, targetClient, + ctx, msg.Counterparty, msg.DelayPeriod, msg.ClientId, nil, connectiontypes.ProtoVersionsToExported(msg.CounterpartyVersions), msg.ProofInit, msg.ProofClient, msg.ProofConsensus, msg.ProofHeight, msg.ConsensusHeight, ); err != nil { @@ -131,13 +126,8 @@ func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.Ms // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - if err := k.ConnectionKeeper.ConnOpenAck( - ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, + ctx, msg.ConnectionId, nil, msg.Version, msg.CounterpartyConnectionId, msg.ProofTry, msg.ProofClient, msg.ProofConsensus, msg.ProofHeight, msg.ConsensusHeight, ); err != nil { diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto index af8f505c461..b97d1ab6fff 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -51,9 +51,9 @@ message MsgConnectionOpenTry { string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. string previous_connection_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_connection_id\""]; - google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + google.protobuf.Any client_state = 3 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_state\""]; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; ibc.core.client.v1.Height proof_height = 7 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; @@ -61,14 +61,14 @@ message MsgConnectionOpenTry { // INIT` bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 9 [deprecated = true, (gogoproto.moretags) = "yaml:\"proof_client\""]; // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; + bytes proof_consensus = 10 [deprecated = true, (gogoproto.moretags) = "yaml:\"proof_consensus\""]; ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; + [deprecated = true, (gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; string signer = 12; // optional proof data for host state machines that are unable to introspect their own consensus state - bytes host_consensus_state_proof = 13; + bytes host_consensus_state_proof = 13 [deprecated = true]; } // MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. diff --git a/testing/solomachine.go b/testing/solomachine.go index 06e4e371de4..f3e14f2bdaf 100644 --- a/testing/solomachine.go +++ b/testing/solomachine.go @@ -281,15 +281,10 @@ func (solo *Solomachine) ConnOpenAck(chain *TestChain, clientID, connectionID st proofTry := solo.GenerateConnOpenTryProof(clientID, connectionID) clientState := ibctm.NewClientState(chain.ChainID, DefaultTrustLevel, TrustingPeriod, UnbondingPeriod, MaxClockDrift, chain.LastHeader.GetHeight().(clienttypes.Height), commitmenttypes.GetSDKSpecs(), UpgradePath) - proofClient := solo.GenerateClientStateProof(clientState) - - consensusState := chain.LastHeader.ConsensusState() - consensusHeight := chain.LastHeader.GetHeight() - proofConsensus := solo.GenerateConsensusStateProof(consensusState, consensusHeight) msgConnOpenAck := connectiontypes.NewMsgConnectionOpenAck( connectionID, connectionIDSolomachine, clientState, - proofTry, proofClient, proofConsensus, + proofTry, nil, nil, clienttypes.ZeroHeight(), clientState.GetLatestHeight().(clienttypes.Height), ConnectionVersion, chain.SenderAccount.GetAddress().String(),