Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize connection versioning + channel versioning docs #6640

Merged
merged 37 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4e0f898
update connection versions with feature set flag
colin-axner Jul 8, 2020
c7b7e42
make connection version modular to support channel versioning and reg…
colin-axner Jul 8, 2020
7dd7d56
revert IBCVersion renaming, add channel versioning logic
colin-axner Jul 8, 2020
b69d9c5
merge master
colin-axner Jul 8, 2020
4b8989c
fix channel version flag
colin-axner Jul 8, 2020
17bed09
remove unnecessary godoc
colin-axner Jul 8, 2020
7176684
remove unused func
colin-axner Jul 8, 2020
1baea76
fix lint and version test
colin-axner Jul 8, 2020
83a54e9
add test and fix error
colin-axner Jul 8, 2020
35a6e3e
Merge branch 'master' into colin/5846-channel-versioning
colin-axner Jul 8, 2020
f6d58c1
revert changes
colin-axner Jul 8, 2020
e0183f9
Merge branch 'colin/5846-channel-versioning' of github.com:cosmos/cos…
colin-axner Jul 8, 2020
c864d6f
update docs
colin-axner Jul 8, 2020
608866e
Merge branch 'master' into colin/5846-channel-versioning
colin-axner Jul 8, 2020
5e1e6f9
remove unnecessary godoc
colin-axner Jul 8, 2020
26148ca
Merge branch 'colin/5846-channel-versioning' of github.com:cosmos/cos…
colin-axner Jul 8, 2020
a513032
Apply suggestions from code review
colin-axner Jul 9, 2020
a7bd313
update doc
colin-axner Jul 9, 2020
ccff9de
add test cases for unchecked lines
colin-axner Jul 9, 2020
097e7ee
Merge branch 'colin/5846-channel-versioning' of github.com:cosmos/cos…
colin-axner Jul 9, 2020
3a60d37
Merge branch 'master' of github.com:cosmos/cosmos-sdk into colin/5846…
colin-axner Jul 9, 2020
54b95f5
go fmt
colin-axner Jul 9, 2020
5303fc4
begin migration to standardized version
colin-axner Jul 10, 2020
4ad50ab
revert proto changes
colin-axner Jul 13, 2020
dd1d31e
restructure versioning to go from string to proto
colin-axner Jul 13, 2020
e34c8dd
update versionStr to encodedVersion naming
colin-axner Jul 13, 2020
64611d6
fix version test build
colin-axner Jul 13, 2020
1a185e9
merge master
colin-axner Jul 13, 2020
b00df37
fix keeper tests
colin-axner Jul 13, 2020
f57fbcc
fix various tests
colin-axner Jul 13, 2020
c21ac65
fixes from self review
colin-axner Jul 13, 2020
0a9ba5e
update docs
colin-axner Jul 13, 2020
18d02fb
fix lint
colin-axner Jul 13, 2020
eed690b
add more code cov
colin-axner Jul 13, 2020
36c0012
rename ToString funcs to Encode/DecodeVersion + GetCompatibleEncodedV…
colin-axner Jul 13, 2020
59996b5
update spec docs
colin-axner Jul 14, 2020
0b49257
Merge branch 'master' into colin/5846-channel-versioning
colin-axner Jul 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/ibc/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ OnChanCloseConfirm(
}
```

#### Channel Handshake Version Negotiation

Application modules are expected to verify versioning used during the channel handshake procedure.

* `ChanOpenInit` callback should verify that the `MsgChanOpenInit.Version` is valid
* `ChanOpenTry` callback should verify that the `MsgChanOpenTry.Version` is valid and that `MsgChanOpenTry.CounterpartyVersion` is valid.
* `ChanOpenAck` callback should verify that the `MsgChanOpenAck.CounterpartyVersion` is valid and supported.

Versions must be strings but can implement any versioning structure. If your application plans to
have linear releases then semantic versioning is recommended. If your application plans to release
various features in between major releases then it is advised to use the same versioning scheme
as IBC. This versioning scheme specifies a version identifier and compatible feature set with
that identifier. Valid version selection includes selecting a compatible version identifier with
a subset of features supported by your application for that version.

### Bind Ports

Currently, ports must be bound on app initialization. A module may bind to ports in `InitGenesis`
Expand Down
145 changes: 98 additions & 47 deletions proto/ibc/connection/connection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,97 @@ import "ibc/commitment/commitment.proto";
// MsgConnectionOpenInit defines the msg sent by an account on Chain A to
// initialize a connection with Chain B.
message MsgConnectionOpenInit {
string client_id = 1 [(gogoproto.customname) = "ClientID", (gogoproto.moretags) = "yaml:\"client_id\""];
string connection_id = 2 [(gogoproto.customname) = "ConnectionID", (gogoproto.moretags) = "yaml:\"connection_id\""];
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string client_id = 1 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];
string connection_id = 2 [
(gogoproto.customname) = "ConnectionID",
(gogoproto.moretags) = "yaml:\"connection_id\""
];
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a connection
// on Chain B.
// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a
// connection on Chain B.
message MsgConnectionOpenTry {
string client_id = 1 [(gogoproto.customname) = "ClientID", (gogoproto.moretags) = "yaml:\"client_id\""];
string connection_id = 2 [(gogoproto.customname) = "ConnectionID", (gogoproto.moretags) = "yaml:\"connection_id\""];
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
repeated string counterparty_versions = 4 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""];
// proof of the initialization the connection on Chain A: `UNITIALIZED -> INIT`
bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
string client_id = 1 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];
string connection_id = 2 [
(gogoproto.customname) = "ConnectionID",
(gogoproto.moretags) = "yaml:\"connection_id\""
];
Counterparty counterparty = 3 [(gogoproto.nullable) = false];
repeated string counterparty_versions = 4 [
(gogoproto.moretags) = "yaml:\"counterparty_versions\""
];
// proof of the initialization the connection on Chain A: `UNITIALIZED ->
// INIT`
bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
uint64 proof_height = 6;
// proof of client consensus state
bytes proof_consensus = 7
[(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 8 [(gogoproto.moretags) = "yaml:\"consensus_height\""];
bytes signer = 9 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
bytes proof_consensus = 7 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 8
[(gogoproto.moretags) = "yaml:\"consensus_height\""];
bytes signer = 9
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to acknowledge
// the change of connection state to TRYOPEN on Chain B.
// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to
// acknowledge the change of connection state to TRYOPEN on Chain B.
message MsgConnectionOpenAck {
string connection_id = 1 [(gogoproto.customname) = "ConnectionID", (gogoproto.moretags) = "yaml:\"connection_id\""];
string version = 2;
// proof of the initialization the connection on Chain B: `UNITIALIZED -> TRYOPEN`
bytes proof_try = 3
[(gogoproto.moretags) = "yaml:\"proof_try\""];
string connection_id = 1 [
(gogoproto.customname) = "ConnectionID",
(gogoproto.moretags) = "yaml:\"connection_id\""
];
string version = 2;
// proof of the initialization the connection on Chain B: `UNITIALIZED ->
// TRYOPEN`
bytes proof_try = 3 [(gogoproto.moretags) = "yaml:\"proof_try\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
// proof of client consensus state
bytes proof_consensus = 5
[(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 6 [(gogoproto.moretags) = "yaml:\"consensus_height\""];
bytes signer = 7 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
bytes proof_consensus = 5 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 6
[(gogoproto.moretags) = "yaml:\"consensus_height\""];
bytes signer = 7
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to acknowledge
// the change of connection state to OPEN on Chain A.
// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to
// acknowledge the change of connection state to OPEN on Chain A.
message MsgConnectionOpenConfirm {
string connection_id = 1 [(gogoproto.customname) = "ConnectionID", (gogoproto.moretags) = "yaml:\"connection_id\""];
string connection_id = 1 [
(gogoproto.customname) = "ConnectionID",
(gogoproto.moretags) = "yaml:\"connection_id\""
];
// proof for the change of the connection state on Chain A: `INIT -> OPEN`
bytes proof_ack = 2
[(gogoproto.moretags) = "yaml:\"proof_ack\""];
bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

// ICS03 - Connection Data Structures as defined in
// https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures

// ConnectionEnd defines a stateful object on a chain connected to another separate
// one.
// NOTE: there must only be 2 defined ConnectionEnds to establish a connection
// between two chains.
// ConnectionEnd defines a stateful object on a chain connected to another
// separate one. NOTE: there must only be 2 defined ConnectionEnds to establish
// a connection between two chains.
message ConnectionEnd {
option (gogoproto.goproto_getters) = false;
// connection identifier.
string id = 1 [(gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\""];
string id = 1
[(gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\""];
// client associated with this connection.
string client_id = 2 [(gogoproto.customname) = "ClientID", (gogoproto.moretags) = "yaml:\"client_id\""];
// opaque string which can be utilised to determine encodings or protocols for
string client_id = 2 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];
// IBC version which can be utilised to determine encodings or protocols for
// channels or packets utilising this connection
repeated string versions = 3;
// current state of the connection end.
Expand All @@ -87,10 +114,12 @@ enum State {
option (gogoproto.goproto_enum_prefix) = false;

// Default State
STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"];
STATE_UNINITIALIZED_UNSPECIFIED = 0
[(gogoproto.enumvalue_customname) = "UNINITIALIZED"];
// A connection end has just started the opening handshake.
STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"];
// A connection end has acknowledged the handshake step on the counterparty chain.
// A connection end has acknowledged the handshake step on the counterparty
// chain.
STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"];
// A connection end has completed the handshake.
STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"];
Expand All @@ -100,10 +129,18 @@ enum State {
message Counterparty {
option (gogoproto.goproto_getters) = false;

// identifies the client on the counterparty chain associated with a given connection.
string client_id = 1 [(gogoproto.customname) = "ClientID", (gogoproto.moretags) = "yaml:\"client_id\""];
// identifies the connection end on the counterparty chain associated with a given connection.
string connection_id = 2 [(gogoproto.customname) = "ConnectionID", (gogoproto.moretags) = "yaml:\"connection_id\""];
// identifies the client on the counterparty chain associated with a given
// connection.
string client_id = 1 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];
// identifies the connection end on the counterparty chain associated with a
// given connection.
string connection_id = 2 [
(gogoproto.customname) = "ConnectionID",
(gogoproto.moretags) = "yaml:\"connection_id\""
];
// commitment merkle prefix of the counterparty chain
ibc.commitment.MerklePrefix prefix = 3 [(gogoproto.nullable) = false];
}
Expand All @@ -117,7 +154,21 @@ message ClientPaths {
// ConnectionPaths define all the connection paths for a given client state.
message ConnectionPaths {
// client state unique identifier
string client_id = 1 [(gogoproto.customname) = "ClientID", (gogoproto.moretags) = "yaml:\"client_id\""];
string client_id = 1 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];
// list of connection paths
repeated string paths = 2;
}

// Version defines the versioning scheme used to negotiate the IBC verison in
// the connection handshake.
message Version {
option (gogoproto.goproto_getters) = false;

// unique version identifier
string identifier = 1;
// list of features compatible with the specified identifier
repeated string features = 2;
}
2 changes: 1 addition & 1 deletion x/ibc-transfer/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (chain *TestChain) createConnection(
State: state,
ClientID: clientID,
Counterparty: counterparty,
Versions: connectiontypes.GetCompatibleVersions(),
Versions: connectiontypes.GetCompatibleVersionStrings(),
}
ctx := chain.GetContext()
chain.App.IBCKeeper.ConnectionKeeper.SetConnection(ctx, connID, connection)
Expand Down
2 changes: 1 addition & 1 deletion x/ibc-transfer/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (chain *TestChain) createConnection(
State: state,
ClientID: clientID,
Counterparty: counterparty,
Versions: connectiontypes.GetCompatibleVersions(),
Versions: connectiontypes.GetCompatibleVersionStrings(),
}
ctx := chain.GetContext()
chain.App.IBCKeeper.ConnectionKeeper.SetConnection(ctx, connID, connection)
Expand Down
2 changes: 1 addition & 1 deletion x/ibc-transfer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (am AppModule) OnChanOpenInit(
}

if version != types.Version {
return sdkerrors.Wrapf(types.ErrInvalidVersion, "got: %s, expected %s", version, types.Version)
return sdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version)
}

// Claim channel capability passed back by IBC module
Expand Down
2 changes: 1 addition & 1 deletion x/ibc-transfer/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ var (
ErrInvalidPacketTimeout = sdkerrors.Register(ModuleName, 2, "invalid packet timeout")
ErrOnlyOneDenomAllowed = sdkerrors.Register(ModuleName, 3, "only one denom allowed")
ErrInvalidDenomForTransfer = sdkerrors.Register(ModuleName, 4, "invalid denomination for cross-chain transfer")
ErrInvalidVersion = sdkerrors.Register(ModuleName, 5, "invalid version")
ErrInvalidVersion = sdkerrors.Register(ModuleName, 5, "invalid ICS20 version")
)
8 changes: 4 additions & 4 deletions x/ibc/03-connection/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestQueryConnection() {
connB := suite.chainB.GetFirstTestConnection(clientB, clientA)

counterparty := types.NewCounterparty(clientB, connB.ID, suite.chainB.GetPrefix())
expConnection = types.NewConnectionEnd(types.INIT, connA.ID, clientA, counterparty, types.GetCompatibleVersions())
expConnection = types.NewConnectionEnd(types.INIT, connA.ID, clientA, counterparty, types.GetCompatibleVersionStrings())
suite.chainA.App.IBCKeeper.ConnectionKeeper.SetConnection(suite.chainA.GetContext(), connA.ID, expConnection)

req = &types.QueryConnectionRequest{
Expand Down Expand Up @@ -119,9 +119,9 @@ func (suite *KeeperTestSuite) TestQueryConnections() {
counterparty2 := types.NewCounterparty(clientB, connB1.ID, suite.chainB.GetPrefix())
counterparty3 := types.NewCounterparty(clientB1, connB2.ID, suite.chainB.GetPrefix())

conn1 := types.NewConnectionEnd(types.OPEN, connA0.ID, clientA, counterparty1, types.GetCompatibleVersions())
conn2 := types.NewConnectionEnd(types.INIT, connA1.ID, clientA, counterparty2, types.GetCompatibleVersions())
conn3 := types.NewConnectionEnd(types.OPEN, connA2.ID, clientA1, counterparty3, types.GetCompatibleVersions())
conn1 := types.NewConnectionEnd(types.OPEN, connA0.ID, clientA, counterparty1, types.GetCompatibleVersionStrings())
conn2 := types.NewConnectionEnd(types.INIT, connA1.ID, clientA, counterparty2, types.GetCompatibleVersionStrings())
conn3 := types.NewConnectionEnd(types.OPEN, connA2.ID, clientA1, counterparty3, types.GetCompatibleVersionStrings())

expConnections = []*types.ConnectionEnd{&conn1, &conn2, &conn3}

Expand Down
22 changes: 12 additions & 10 deletions x/ibc/03-connection/keeper/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (k Keeper) ConnOpenInit(
}

// connection defines chain A's ConnectionEnd
connection := types.NewConnectionEnd(types.INIT, connectionID, clientID, counterparty, types.GetCompatibleVersions())
connection := types.NewConnectionEnd(types.INIT, connectionID, clientID, counterparty, types.GetCompatibleVersionStrings())
k.SetConnection(ctx, connectionID, connection)

if err := k.addConnectionToClient(ctx, clientID, connectionID); err != nil {
Expand Down Expand Up @@ -128,7 +128,7 @@ func (k Keeper) ConnOpenTry(
func (k Keeper) ConnOpenAck(
ctx sdk.Context,
connectionID string,
version string, // version that ChainB chose in ConnOpenTry
encodedVersion string, // version that ChainB chose in ConnOpenTry
proofTry []byte, // proof that connectionEnd was added to ChainB state in ConnOpenTry
proofConsensus []byte, // proof that chainB has stored ConsensusState of chainA on its client
proofHeight uint64, // height that relayer constructed proofTry
Expand Down Expand Up @@ -156,7 +156,12 @@ func (k Keeper) ConnOpenAck(
)
}

// Check that ChainB's proposed version number is supported by chainA
// Check that ChainB's proposed version identifier is supported by chainA
version, err := types.StringToVersion(encodedVersion)
if err != nil {
return sdkerrors.Wrap(err, "version negotiation failed")
}

supportedVersion, found := types.FindSupportedVersion(version, types.GetCompatibleVersions())
if !found {
return sdkerrors.Wrapf(
Expand All @@ -166,11 +171,8 @@ func (k Keeper) ConnOpenAck(
}

// Check that ChainB's proposed feature set is supported by chainA
if !types.VerifyProposedFeatureSet(version, supportedVersion) {
return sdkerrors.Wrapf(
types.ErrVersionNegotiationFailed,
"connection version feature set provided (%s) is not supported (%s)", version, types.GetCompatibleVersions(),
)
if err := types.VerifyProposedVersion(version, supportedVersion); err != nil {
return err
colin-axner marked this conversation as resolved.
Show resolved Hide resolved
}

// Retrieve chainA's consensus state at consensusheight
Expand All @@ -181,7 +183,7 @@ func (k Keeper) ConnOpenAck(

prefix := k.GetCommitmentPrefix()
expectedCounterparty := types.NewCounterparty(connection.ClientID, connectionID, commitmenttypes.NewMerklePrefix(prefix.Bytes()))
expectedConnection := types.NewConnectionEnd(types.TRYOPEN, connection.Counterparty.ConnectionID, connection.Counterparty.ClientID, expectedCounterparty, []string{version})
expectedConnection := types.NewConnectionEnd(types.TRYOPEN, connection.Counterparty.ConnectionID, connection.Counterparty.ClientID, expectedCounterparty, []string{encodedVersion})

// Ensure that ChainB stored expected connectionEnd in its state during ConnOpenTry
if err := k.VerifyConnectionState(
Expand All @@ -202,7 +204,7 @@ func (k Keeper) ConnOpenAck(

// Update connection state to Open
connection.State = types.OPEN
connection.Versions = []string{version}
connection.Versions = []string{encodedVersion}
k.SetConnection(ctx, connectionID, connection)
return nil
}
Expand Down
27 changes: 20 additions & 7 deletions x/ibc/03-connection/keeper/handshake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ func (suite *KeeperTestSuite) TestConnOpenTry() {
_, _, err := suite.coordinator.ConnOpenInit(suite.chainA, suite.chainB, clientA, clientB)
suite.Require().NoError(err)

versions = []string{"(version won't match,[])"}
version, err := types.NewVersion("0.0", nil).ToString()
suite.Require().NoError(err)
versions = []string{version}
}, false},
{"connection state verification failed", func() {
clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, clientexported.Tendermint)
Expand Down Expand Up @@ -140,9 +142,9 @@ func (suite *KeeperTestSuite) TestConnOpenTry() {
tc := tc

suite.Run(tc.msg, func() {
suite.SetupTest() // reset
consensusHeight = 0 // must be explicitly changed in malleate
versions = types.GetCompatibleVersions() // must be explicitly changed in malleate
suite.SetupTest() // reset
consensusHeight = 0 // must be explicitly changed in malleate
versions = types.GetCompatibleVersionStrings() // must be explicitly changed in malleate

tc.malleate()

Expand Down Expand Up @@ -266,6 +268,17 @@ func (suite *KeeperTestSuite) TestConnOpenAck() {

version = ""
}, false},
{"feature set verification failed - unsupported feature", func() {
clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, clientexported.Tendermint)
connA, connB, err := suite.coordinator.ConnOpenInit(suite.chainA, suite.chainB, clientA, clientB)
suite.Require().NoError(err)

err = suite.coordinator.ConnOpenTry(suite.chainB, suite.chainA, connB, connA)
suite.Require().NoError(err)

version, err = types.NewVersion(types.DefaultIBCVersionIdentifier, []string{"ORDER_ORDERED", "ORDER_UNORDERED", "ORDER_DAG"}).ToString()
suite.Require().NoError(err)
}, false},
{"self consensus state not found", func() {
clientA, clientB = suite.coordinator.SetupClients(suite.chainA, suite.chainB, clientexported.Tendermint)
connA, connB, err := suite.coordinator.ConnOpenInit(suite.chainA, suite.chainB, clientA, clientB)
Expand Down Expand Up @@ -305,9 +318,9 @@ func (suite *KeeperTestSuite) TestConnOpenAck() {
for _, tc := range testCases {
tc := tc
suite.Run(tc.msg, func() {
suite.SetupTest() // reset
version = types.GetCompatibleVersions()[0] // must be explicitly changed in malleate
consensusHeight = 0 // must be explicitly changed in malleate
suite.SetupTest() // reset
version = types.GetCompatibleVersionStrings()[0] // must be explicitly changed in malleate
consensusHeight = 0 // must be explicitly changed in malleate

tc.malleate()

Expand Down
Loading