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

Implement Height interface in core IBC #7211

Merged
merged 34 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6e695f1
change interfaces
AdityaSripal Aug 31, 2020
48f8119
fix tendermint client interfaces
AdityaSripal Aug 31, 2020
8f884d3
fix other clients interfaces
AdityaSripal Aug 31, 2020
0f669d8
fix queries
AdityaSripal Aug 31, 2020
afb615b
fix tendermint build
AdityaSripal Aug 31, 2020
6d23423
fix builds of clients
AdityaSripal Aug 31, 2020
20380f2
fix 02-build
AdityaSripal Sep 1, 2020
9cc8450
start fixing connection and make queries non-nullable
AdityaSripal Sep 1, 2020
a74862f
fix connection keepers and queries
AdityaSripal Sep 1, 2020
e0c1692
fix connection build
AdityaSripal Sep 1, 2020
b9471a9
fix channel build
AdityaSripal Sep 1, 2020
bad9d59
fix all non-test files
AdityaSripal Sep 1, 2020
7d17d80
fix testing build
AdityaSripal Sep 1, 2020
be79eaa
cleanup
AdityaSripal Sep 1, 2020
0f5c6a3
lint
AdityaSripal Sep 1, 2020
2d1a2b2
fix merge
AdityaSripal Sep 1, 2020
124d808
merge and refix build
AdityaSripal Sep 2, 2020
f1a86ff
fix timeout height interface
AdityaSripal Sep 2, 2020
848b510
fix tendermint tests
AdityaSripal Sep 2, 2020
775855b
fix rest of clients
AdityaSripal Sep 2, 2020
faae161
fix connection tests
AdityaSripal Sep 2, 2020
2543a7b
fix client tests
AdityaSripal Sep 2, 2020
e3cee11
Merge branch 'master' into aditya/height-interface
jackzampolin Sep 2, 2020
5f6ef15
fix channel tests
AdityaSripal Sep 2, 2020
9ce03df
fix all ibc tests
AdityaSripal Sep 2, 2020
7602b5a
Merge branch 'aditya/height-interface' of github.com:cosmos/cosmos-sd…
AdityaSripal Sep 2, 2020
9c0276a
fix transfer tests:
AdityaSripal Sep 2, 2020
eaaad0f
docs
AdityaSripal Sep 2, 2020
eb56e9a
fix connection query
AdityaSripal Sep 2, 2020
8bd956f
Merge branch 'master' into aditya/height-interface
colin-axner Sep 3, 2020
f953ac2
Apply suggestions from code review
AdityaSripal Sep 3, 2020
d9ed6be
wrap-up review
AdityaSripal Sep 3, 2020
2df72d9
Merge branch 'aditya/height-interface' of github.com:cosmos/cosmos-sd…
AdityaSripal Sep 3, 2020
2d62a86
Merge branch 'master' into aditya/height-interface
AdityaSripal Sep 3, 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
46 changes: 37 additions & 9 deletions proto/ibc/channel/channel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package ibc.channel;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types";

import "gogoproto/gogo.proto";
import "ibc/client/client.proto";

// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It
// is called by a relayer on Chain A.
Expand All @@ -24,7 +25,10 @@ message MsgChannelOpenTry {
string counterparty_version = 4
[(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
uint64 proof_height = 6 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 6 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 7
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -37,7 +41,10 @@ message MsgChannelOpenAck {
string counterparty_version = 3
[(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_try = 4 [(gogoproto.moretags) = "yaml:\"proof_try\""];
uint64 proof_height = 5 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 5 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 6
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -48,7 +55,10 @@ message MsgChannelOpenConfirm {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 4 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -68,7 +78,10 @@ message MsgChannelCloseConfirm {
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 4 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -77,7 +90,10 @@ message MsgChannelCloseConfirm {
message MsgRecvPacket {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 3 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -86,7 +102,10 @@ message MsgRecvPacket {
message MsgTimeout {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 3 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
uint64 next_sequence_recv = 4
[(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 5
Expand All @@ -98,7 +117,10 @@ message MsgTimeoutOnClose {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof = 2;
bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 4 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
uint64 next_sequence_recv = 5
[(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 6
Expand All @@ -110,7 +132,10 @@ message MsgAcknowledgement {
Packet packet = 1 [(gogoproto.nullable) = false];
bytes acknowledgement = 2;
bytes proof = 3;
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 4 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 5
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand Down Expand Up @@ -222,7 +247,10 @@ message Packet {
// actual opaque bytes transferred directly to the application module
bytes data = 6;
// block height after which the packet times out
uint64 timeout_height = 7 [(gogoproto.moretags) = "yaml:\"timeout_height\""];
ibc.client.Height timeout_height = 7 [
(gogoproto.moretags) = "yaml:\"timeout_height\"",
(gogoproto.nullable) = false
];
// block timestamp (in nanoseconds) after which the packet times out
uint64 timeout_timestamp = 8
[(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
Expand Down
49 changes: 36 additions & 13 deletions proto/ibc/channel/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
import "ibc/channel/channel.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types";

Expand Down Expand Up @@ -39,7 +40,7 @@ service Query {
// associated with the provided channel identifiers.
rpc ChannelConsensusState(QueryChannelConsensusStateRequest)
returns (QueryChannelConsensusStateResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/{height}";
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/epoch/{epoch_number}/height/{epoch_height}";
}

// PacketCommitment queries a stored packet commitment hash.
Expand Down Expand Up @@ -94,7 +95,9 @@ message QueryChannelResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

// QueryChannelsRequest is the request type for the Query/Channels RPC method
Expand All @@ -110,7 +113,9 @@ message QueryChannelsResponse {
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
// query block height
int64 height = 3;
ibc.client.Height height = 3 [
(gogoproto.nullable) = false
];
}

// QueryConnectionChannelsRequest is the request type for the
Expand All @@ -130,7 +135,9 @@ message QueryConnectionChannelsResponse {
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
// query block height
int64 height = 3;
ibc.client.Height height = 3 [
(gogoproto.nullable) = false
];
}

// QueryChannelClientStateRequest is the request type for the Query/ClientState
Expand All @@ -152,7 +159,9 @@ message QueryChannelClientStateResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

// QueryChannelConsensusStateRequest is the request type for the
Expand All @@ -162,8 +171,10 @@ message QueryChannelConsensusStateRequest {
string port_id = 1;
// channel unique identifier
string channel_id = 2;
// height of the consensus state
uint64 height = 3;
// epoch number of the consensus state
uint64 epoch_number = 3;
AdityaSripal marked this conversation as resolved.
Show resolved Hide resolved
// epoch height of the consensus state
uint64 epoch_height = 4;
}

// QueryChannelClientStateResponse is the Response type for the
Expand All @@ -178,7 +189,9 @@ message QueryChannelConsensusStateResponse {
// merkle proof path
string proof_path = 4;
// height at which the proof was retrieved
uint64 proof_height = 5;
ibc.client.Height proof_height = 5 [
(gogoproto.nullable) = false
];
}

// QueryPacketCommitmentRequest is the request type for the
Expand All @@ -203,7 +216,9 @@ message QueryPacketCommitmentResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

// QueryPacketCommitmentsRequest is the request type for the
Expand All @@ -224,7 +239,9 @@ message QueryPacketCommitmentsResponse {
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
// query block height
int64 height = 3;
ibc.client.Height height = 3 [
(gogoproto.nullable) = false
];
}

// QueryPacketAcknowledgementRequest is the request type for the
Expand All @@ -249,7 +266,9 @@ message QueryPacketAcknowledgementResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

// QueryUnrelayedPacketsRequest is the request type for the
Expand All @@ -272,7 +291,9 @@ message QueryUnrelayedPacketsResponse {
// list of unrelayed packet sequences
repeated uint64 sequences = 1;
// query block height
int64 height = 2;
ibc.client.Height height = 2 [
(gogoproto.nullable) = false
];
}

// QueryNextSequenceReceiveRequest is the request type for the
Expand All @@ -294,6 +315,8 @@ message QueryNextSequenceReceiveResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

20 changes: 14 additions & 6 deletions proto/ibc/client/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
import "ibc/client/client.proto";
import "google/protobuf/any.proto";
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/02-client/types";

Expand All @@ -22,7 +23,7 @@ service Query {

// ConsensusState queries a consensus state associated with a client state at a given height.
rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}/{height}";
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}/epoch/{epoch_number}/height/{epoch_height}";
}

// ConsensusStates queries all the consensus state associated with a given client.
Expand All @@ -49,7 +50,9 @@ message QueryClientStateResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
}

// QueryClientStatesRequest is the request type for the Query/ClientStates RPC
Expand All @@ -73,10 +76,12 @@ message QueryClientStatesResponse {
message QueryConsensusStateRequest {
// client identifier
string client_id = 1;
// consensus state height
uint64 height = 2;
// consensus state epoch number
uint64 epoch_number = 2;
// consensus state epoch height
uint64 epoch_height = 3;
// latest_height overrrides the height field and queries the latest stored ConsensusState
bool latest_height = 3;
bool latest_height = 4;
}

// QueryConsensusStateResponse is the response type for the Query/ConsensusState RPC method
Expand All @@ -88,7 +93,10 @@ message QueryConsensusStateResponse {
// merkle proof path
string proof_path = 3;
// height at which the proof was retrieved
uint64 proof_height = 4;
ibc.client.Height proof_height = 4 [
(gogoproto.nullable) = false
];
;
}

// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates RPC method.
Expand Down
28 changes: 21 additions & 7 deletions proto/ibc/connection/connection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "ibc/commitment/commitment.proto";
import "ibc/client/client.proto";

// MsgConnectionOpenInit defines the msg sent by an account on Chain A to
// initialize a connection with Chain B.
Expand Down Expand Up @@ -36,16 +37,21 @@ message MsgConnectionOpenTry {
Counterparty counterparty = 4 [(gogoproto.nullable) = false];
repeated string counterparty_versions = 5
[(gogoproto.moretags) = "yaml:\"counterparty_versions\""];
uint64 proof_height = 6 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 6 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
// proof of the initialization the connection on Chain A: `UNITIALIZED ->
// INIT`
bytes proof_init = 7 [(gogoproto.moretags) = "yaml:\"proof_init\""];
// proof of client state included in message
bytes proof_client = 8 [(gogoproto.moretags) = "yaml:\"proof_client\""];
// proof of client consensus state
bytes proof_consensus = 9 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 10
[(gogoproto.moretags) = "yaml:\"consensus_height\""];
ibc.client.Height consensus_height = 10 [
(gogoproto.moretags) = "yaml:\"consensus_height\"",
(gogoproto.nullable) = false
];
bytes signer = 11
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -60,16 +66,21 @@ message MsgConnectionOpenAck {
google.protobuf.Any client_state = 3 [
(gogoproto.moretags) = "yaml:\"client_state\""
];
uint64 proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 4 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
// proof of the initialization the connection on Chain B: `UNITIALIZED ->
// TRYOPEN`
bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""];
// proof of client state included in message
bytes proof_client = 6 [(gogoproto.moretags) = "yaml:\"proof_client\""];
// proof of client consensus state
bytes proof_consensus = 7 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
uint64 consensus_height = 8
[(gogoproto.moretags) = "yaml:\"consensus_height\""];
ibc.client.Height consensus_height = 8 [
(gogoproto.moretags) = "yaml:\"consensus_height\"",
(gogoproto.nullable) = false
];
bytes signer = 9
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand All @@ -82,7 +93,10 @@ message MsgConnectionOpenConfirm {
];
// proof for the change of the connection state on Chain A: `INIT -> OPEN`
bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
uint64 proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\""];
ibc.client.Height proof_height = 3 [
(gogoproto.moretags) = "yaml:\"proof_height\"",
(gogoproto.nullable) = false
];
bytes signer = 4
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
Expand Down
Loading