Skip to content

Commit

Permalink
Migration to recent stargate (informalsystems#449)
Browse files Browse the repository at this point in the history
* Initial migration changes

* More changes, add some of the ack CLIs

* cleanup

* fix packet ack

* clippy and fmt fixes

* Fixed connOpenTry tests; ignored update client tests

* Fixed ack msg tests

* Added next identifier generation in mock context

* Fixed ICS26 tests

* Fix for relayer tests

* Timeout packet, add Uninit for conn and chan, extract clientId

* Fix option order in packet Tx clis

* Tx result parsing (not generalized yet)

* add extern paths back

* WIP General event parsing out of tx response

* change packet envelope to packet

* Make the code compile, return clientID in relayer and CLI

* event parsing and matching for conn open init

* Change tm dependency, fix update client CLI

* log fix and move to cosmos v0.40.0-rc5 (no changes)

* Finished connection CLIs

* Event parsing and fixes for channel open CLIs

* add more event attributes, some refactor of the packet CLIs and packet relaying

* cleanup CLI output for channel, add more fields to events

* Fix relayer connection loop for dynamic IDs

* Fix relayer channel loop for dynamic IDs, started on config cleanup

* Cleanup relayer config

* update Changelog

* fix channel verification for packets

* Fix changelog typo

Co-authored-by: Adi Seredinschi <adi@informal.systems>
  • Loading branch information
ancazamfir and adizere committed Dec 23, 2020
1 parent fd06866 commit af13da5
Show file tree
Hide file tree
Showing 33 changed files with 1,957 additions and 1,241 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
## Unreleased Changes

### FEATURES
- Update to tendermint-rs version `0.17` ([#451])
- Update to cosmos-sdk IBC proto version `v0.40.0-rc5` ([#451])

- [relayer]
- Implement relaying for recv_packet ([#379])
- Implement packet relaying ([#379])

- [relayer-cli]
- Packet CLIs for recv_packet ([#443])

- Packet CLIs for acknowledging packets ([#468])

### IMPROVEMENTS
- [relayer]
- Mock chain (implementing IBC handlers) and integration against CLI ([#158])
Expand All @@ -20,6 +24,9 @@
[#381]: https://github.com/informalsystems/ibc-rs/issues/381
[#443]: https://github.com/informalsystems/ibc-rs/issues/443
[#447]: https://github.com/informalsystems/ibc-rs/issues/447
[#451]: https://github.com/informalsystems/ibc-rs/issues/451
[#468]: https://github.com/informalsystems/ibc-rs/issues/468


## v0.0.5
*December 2, 2020*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ tendermint = { git = "https://github.com/informalsystems/tendermint
tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-light-client = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-testgen = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-testgen = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
6 changes: 2 additions & 4 deletions docs/architecture/adr-004-relayer-domain-decomposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,11 @@ fn main() -> Result<(), Box<dyn Error>> {

let src_foreign_client_on_dst = ForeignClient::new(
&src_chain_handle,
&dst_chain_handle,
ForeignClientConfig::default())?;
&dst_chain_handle)?;

let dst_foreign_client_on_src = ForeignClient::new(
&src_chain_handle,
&dst_chain_handle,
ForeignClientConfig::default())?;
&dst_chain_handle)?;

let connection = Connection::new(
&src_chain_handle,
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/relayer/Packets.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func CreateDatagram(ev WriteAcknowledgementEvent,

// Stage 1
// Verify if acknowledment is committed to chain A and it is still pending
packetAck, packetAckCommitmentProof, error =
packetAck, PacketStateProof, error =
GetPacketAcknowledgement(chainA, ev.port, ev.channel, ev.sequence, proofHeight)
if error != nil { return (nil, error) }

Expand Down Expand Up @@ -191,6 +191,6 @@ func CreateDatagram(ev WriteAcknowledgementEvent,
data: ev.data
}

return (PacketAcknowledgement { packet, ev.acknowledgement, packetAckCommitmentProof, proofHeight }, nil)
return (PacketAcknowledgement { packet, ev.acknowledgement, PacketStateProof, proofHeight }, nil)
}
```
9 changes: 5 additions & 4 deletions relayer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,25 @@ tracing-subscriber = "0.2.3"
futures = "0.3.5"
toml = "0.5.6"
serde_derive = "1.0.116"
serde_json = "1"
sled = "0.34.4"
prost = "0.6.1"
prost-types = { version = "0.6.1" }
hex = "0.4"
crossbeam-channel = "0.5.0"

[dependencies.tendermint-proto]
version = "=0.17.0-rc3"
version = "=0.17.0"

[dependencies.tendermint]
version = "=0.17.0-rc3"
version = "=0.17.0"

[dependencies.tendermint-rpc]
version = "=0.17.0-rc3"
version = "=0.17.0"
features = ["http-client", "websocket-client"]

[dependencies.tendermint-light-client]
version = "=0.17.0-rc3"
version = "=0.17.0"

[dependencies.abscissa_core]
version = "0.5.2"
Expand Down
12 changes: 12 additions & 0 deletions relayer-cli/src/commands/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,16 @@ pub enum QueryPacketCmds {
/// The `query unreceived packets` subcommand
#[options(help = "query unreceived packets")]
UnreceivedPackets(packet::QueryUnreceivedPacketsCmd),

/// The `query packet commitments` subcommand
#[options(help = "query packet acknowledgements")]
Acks(packet::QueryPacketAcknowledgementsCmd),

/// The `query packet commitment` subcommand
#[options(help = "query packet acknowledgment")]
Ack(packet::QueryPacketAcknowledgmentCmd),

/// The `query unreceived packets` subcommand
#[options(help = "query un-acknowledged packets")]
UnreceivedAcks(packet::QueryUnreceivedAcknowledgementCmd),
}
16 changes: 8 additions & 8 deletions relayer-cli/src/commands/query/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl QueryClientStateCmd {
let opts = QueryClientStateOptions {
client_id,
height: self.height.unwrap_or(0_u64),
proof: self.proof.unwrap_or(true),
proof: self.proof.unwrap_or(false),
};
Ok((chain_config, opts))
}
Expand Down Expand Up @@ -120,8 +120,8 @@ pub struct QueryClientConsensusCmd {
#[derive(Debug)]
struct QueryClientConsensusOptions {
client_id: ClientId,
version_number: u64,
version_height: u64,
revision_number: u64,
revision_height: u64,
height: u64,
proof: bool,
}
Expand All @@ -135,11 +135,11 @@ impl QueryClientConsensusCmd {
validate_common_options(&self.chain_id, &self.client_id, config)?;

match (self.consensus_epoch, self.consensus_height) {
(Some(version_number), Some(version_height)) => {
(Some(revision_number), Some(revision_height)) => {
let opts = QueryClientConsensusOptions {
client_id,
version_number,
version_height,
revision_number,
revision_height,
height: self.height.unwrap_or(0_u64),
proof: self.proof.unwrap_or(true),
};
Expand Down Expand Up @@ -179,8 +179,8 @@ impl Runnable for QueryClientConsensusCmd {
.query(
ClientConsensusState {
client_id: opts.client_id,
epoch: opts.version_number,
height: opts.version_height,
epoch: opts.revision_number,
height: opts.revision_height,
},
height,
opts.proof,
Expand Down
Loading

0 comments on commit af13da5

Please sign in to comment.