diff --git a/CHANGELOG.md b/CHANGELOG.md index dbfbc24e32..7e2fbe18e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,49 @@ -## [pending_version] +# Changelog -* Refactored `relayer/cli` into `relayer-cli` folder. ([#180](https://github.com/informalsystems/ibc-rs/issues/180)) -* Refactored `relayer/relay` into `relayer` folder. ([#180](https://github.com/informalsystems/ibc-rs/issues/180)) +## v0.0.2 -## [0.0.1] +*August 1, 2020* + +This release is focused on updating the query system from amino to protobuf, +implementing a few queries from the CLI, and establishing an initial testing framework +that will support multiple chain types. + +It does not target a stable release of Cosmos-SDK chains, but is tracking +the latest state of development towards the Cosmos-SDK Stargate release. + +### BREAKING CHANGES: + +- [modules|relayer] Refactor queries, paths, and Chain trait to reduce code and use + protobuf instead of Amino. + [\#152](https://github.com/informalsystems/ibc-rs/pull/152), + [\#174](https://github.com/informalsystems/ibc-rs/pull/174), + [\#155](https://github.com/informalsystems/ibc-rs/pull/155) +- [repo] Moved relayer/cli to relayer-cli, relayer/relay to relayer. [\#183](https://github.com/informalsystems/ibc-rs/pull/183) + +### FEATURES: + +- [relayer] Query connections given client id. [\#169](https://github.com/informalsystems/ibc-rs/pull/169) +- [relayer] Query connection given connection id. [\#136](https://github.com/informalsystems/ibc-rs/pull/136) +- [relayer] Query channel given channel id and port [\#163](https://github.com/informalsystems/ibc-rs/pull/163) +- [spec] Channel closing datagrams in TLA+ [\#141](https://github.com/informalsystems/ibc-rs/pull/141) + +### IMPROVEMENTS: + +- [ci] Framework (scripts and Github Actions) for integration testing the relayer queries against + the Cosmos-SDK's `simd` binary with prepopulated IBC state in the genesis + [\#140](https://github.com/informalsystems/ibc-rs/pull/140), + [\#184](https://github.com/informalsystems/ibc-rs/pull/184) +- [relayer|modules] Implemented better Raw type handling. [\#156](https://github.com/informalsystems/ibc-rs/pull/156) +- [repo] Add rust-toolchain file. [\#154](https://github.com/informalsystems/ibc-rs/pull/154) + +### BUG FIXES: + +- [modules] Fixed the identifiers limits according to updated ics spec. [\#189](https://github.com/informalsystems/ibc-rs/pull/189) +- [modules/relayer] Remove some warnings triggered during compilation due to dependency specification. [\#132](https://github.com/informalsystems/ibc-rs/pull/132) +- [modules] Fix nightly runs. [\#161](https://github.com/informalsystems/ibc-rs/pull/161) +- [repo] Fix for incomplete licence terms. [\#153](https://github.com/informalsystems/ibc-rs/pull/153) + +## 0.0.1 *July 1st, 2020* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..d9d9e99fef --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,145 @@ +# Contributing + +Thank you for your interest in contributing. The goal +of ibc-rs is to provide a high quality, formally verified implementation of +the IBC protocol. + +All work on the code base should be motivated by a Github +Issue. Search is a good place start when looking for places to contribute. If you +would like to work on an issue which already exists, please indicate so +by leaving a comment. If you'd like to work on something else, open an Issue to +start the discussion. + +The rest of this document outlines the best practices for contributing to this +repository: + +- [Decision Making](#decision-making) - process for agreeing to changes +- [Forking](#forking) - fork the repo to make pull requests +- [Changelog](#changelog) - changes must be recorded in the changelog +- [Pull Requests](#pull-requests) - what makes a good pull request + +## Decision Making + +When contributing to the project, the following process leads to the best chance of +landing the changes in master. + +All new contributions should start with a Github +Issue. The issue helps capture the problem you're trying to solve and allows for +early feedback. Once the issue is created, maintainers may request more detailed +documentation be written in the form of a Request for Comment (RFC) or +Architectural Decision Record +([ADR](https://github.com/informalsystems/ibc-rs/blob/master/docs/architecture/README.md)). + +Discussion at the RFC stage will build collective understanding of the dimensions +of the problems and help structure conversations around trade-offs. + +When the problem is well understood but the solution leads to large +structural changes to the code base, these changes should be proposed in +the form of an [Architectural Decision Record +(ADR)](./docs/architecture/). The ADR will help build consensus on an +overall strategy to ensure the code base maintains coherence +in the larger context. If you are not comfortable with writing an ADR, +you can open a less-formal issue and the maintainers will help you +turn it into an ADR. + +TODO: ADR registration (eg. in an ADR registration issue) + +When the problem as well as proposed solution are well understood, +changes should start with a [draft +pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) +against master. The draft signals that work is underway. When the work +is ready for feedback, hitting "Ready for Review" will signal to the +maintainers to take a look. + +Implementation trajectories should aim to proceed where possible as a series +of smaller incremental changes, in the form of small PRs that can be merged +quickly. This helps manage the load for reviewers and reduces the likelihood +that PRs will sit open for longer. + +![Contributing +flow](https://github.com/tendermint/tendermint/blob/v0.33.6/docs/imgs/contributing.png) + +Each stage of the process is aimed at creating feedback cycles which align contributors and maintainers to make sure: + +- Contributors don’t waste their time implementing/proposing features which won’t land in `master`. +- Maintainers have the necessary context in order to support and review contributions. + +## Forking + +If you do not have write access to the repository, your contribution should be +made through a fork on Github. Fork the repository, contribute to your fork, +and make a pull request back upstream. + +When forking, add your fork's URL as a new git remote in your local copy of the +repo. For instance, to create a fork and work on a branch of it: + +- Create the fork on GitHub, using the fork button. +- `cd` to the original clone of the repo on your machine +- `git remote rename origin upstream` +- `git remote add origin git@github.com: + +Now `origin` refers to your fork and `upstream` refers to this version. +Now `git push -u origin master` to update the fork, and make pull requests against this repo. + +To pull in updates from the origin repo, run + +- `git fetch upstream` +- `git rebase upstream/master` (or whatever branch you want) + +## Changelog + +Every non-trivial PR must update the [CHANGELOG.md]. + +Changelog structure is modeled after +[Tendermint +Core](https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md) +and +[Hashicorp Consul](http://github.com/hashicorp/consul/tree/master/CHANGELOG.md). +See those changelogs for examples. + +Changes for a given release should be split between the five sections: Security, Breaking +Changes, Features, Improvements, Bug Fixes. + +Changelog entries should be formatted as follows: +``` +- [pkg] \#xxx Some description about the change (@contributor) +``` +Here, `pkg` is the part of the code that changed (typically a +top-level crate, but could be /), `xxx` is the pull-request number, and `contributor` +is the author/s of the change. + +It's also acceptable for `xxx` to refer to the relevent issue number, but pull-request +numbers are preferred. +Note this means pull-requests should be opened first so the changelog can then +be updated with the pull-request's number. + +Changelog entries should be ordered alphabetically according to the +`pkg`, and numerically according to the pull-request number. + +Changes with multiple classifications should be doubly included (eg. a bug fix +that is also a breaking change should be recorded under both). + +Breaking changes are further subdivided according to the APIs/users they impact. +Any change that effects multiple APIs/users should be recorded multiply - for +instance, a change to some core protocol data structure might need to be +reflected both as breaking the core protocol but also breaking any APIs where core data structures are +exposed. + +## Pull Requests + +The master development branch is `master`. +Branch names should be prefixed with the author, eg. `name/feature-x`. + +Pull requests are made against `master` +and are squash merged into master. + +PRs must: + +- make reference to an issue outlining the context. +- update any relevant documentation and include tests. +- update the [changelog](#changelog) with a description of the change + +Pull requests should aim to be small and self contained to facilitate quick +review and merging. Larger change sets should be broken up across multiple PRs. +Commits should be concise but informative, and moderately clean. Commits will be squashed into a +single commit for the PR with all the commit messages. diff --git a/README.md b/README.md index 787ceac26a..fd9b2ec297 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ THIS PROJECT IS UNDER HEAVY DEVELOPMENT AND IS NOT IN A WORKING STAGE NOW, USE A ## Releases -This project is still a pre v0.1.0 prototype. Releases can be found -[here](https://github.com/informalsystems/ibc-rs/releases) +This project is still a pre v0.1.0 prototype. Releases are made on +[Github](https://github.com/informalsystems/ibc-rs/releases) ## Installation diff --git a/relayer-cli/Cargo.toml b/relayer-cli/Cargo.toml index 53f41edf67..dacbdabbed 100644 --- a/relayer-cli/Cargo.toml +++ b/relayer-cli/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "relayer-cli" -version = "0.0.1" +version = "0.0.2" edition = "2018" authors = [ - "Anca Zamfir ", - "Romain Ruetschi " + "Informal Systems " ] [dependencies] relayer = { path = "../relayer" } -relayer-modules = { path = "../modules" } -tendermint = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master" } +modules = { path = "../modules" } +tendermint = "0.15.0" abscissa_tokio = "0.5.1" anomaly = "0.2.0" diff --git a/relayer-cli/README.md b/relayer-cli/README.md index 8993029580..f46b8b372a 100644 --- a/relayer-cli/README.md +++ b/relayer-cli/README.md @@ -1,6 +1,6 @@ -# Cli +# relayer-cli -Cli is an application. +`relayer-cli` is an application. ## Getting Started diff --git a/relayer-cli/src/commands/listen.rs b/relayer-cli/src/commands/listen.rs index 12f55d0344..68a54ead33 100644 --- a/relayer-cli/src/commands/listen.rs +++ b/relayer-cli/src/commands/listen.rs @@ -14,7 +14,7 @@ use tokio::sync::mpsc::{channel, Sender}; use crate::config::Config; use ::tendermint::chain::Id as ChainId; use futures::future::join_all; -use relayer_modules::events::IBCEvent; +use modules::events::IBCEvent; #[derive(Command, Debug, Options)] pub struct ListenCmd { diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index a2771f0fc1..177ecd183f 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -3,12 +3,12 @@ use crate::prelude::*; use abscissa_core::{Command, Options, Runnable}; use relayer::config::{ChainConfig, Config}; -use relayer_modules::ics04_channel::channel::ChannelEnd; -use relayer_modules::ics24_host::identifier::{ChannelId, PortId}; -use relayer_modules::ics24_host::Path::ChannelEnds; +use modules::ics04_channel::channel::ChannelEnd; +use modules::ics24_host::identifier::{ChannelId, PortId}; +use modules::ics24_host::Path::ChannelEnds; +use modules::ics24_host::error::ValidationError; use relayer::chain::{Chain, CosmosSDKChain}; -use relayer_modules::ics24_host::error::ValidationError; use tendermint::chain::Id as ChainId; #[derive(Clone, Command, Debug, Options)] diff --git a/relayer-cli/src/commands/query/client.rs b/relayer-cli/src/commands/query/client.rs index d1d402aa0a..00253b4eeb 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -3,11 +3,11 @@ use crate::prelude::*; use abscissa_core::{Command, Options, Runnable}; use relayer::config::{ChainConfig, Config}; +use modules::ics24_host::error::ValidationError; +use modules::ics24_host::identifier::ClientId; +use modules::ics24_host::Path::ClientConnections; use relayer::chain::Chain; use relayer::chain::CosmosSDKChain; -use relayer_modules::ics24_host::error::ValidationError; -use relayer_modules::ics24_host::identifier::ClientId; -use relayer_modules::ics24_host::Path::ClientConnections; use tendermint::chain::Id as ChainId; /// Query client state command diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index bc4614525d..8ee9662453 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -3,13 +3,13 @@ use crate::prelude::*; use abscissa_core::{Command, Options, Runnable}; use relayer::config::{ChainConfig, Config}; +use modules::ics24_host::error::ValidationError; +use modules::ics24_host::identifier::ConnectionId; +use modules::ics24_host::Path::Connections; use relayer::chain::{Chain, CosmosSDKChain}; -use relayer_modules::ics24_host::error::ValidationError; -use relayer_modules::ics24_host::identifier::ConnectionId; -use relayer_modules::ics24_host::Path::Connections; use tendermint::chain::Id as ChainId; -use relayer_modules::ics03_connection::connection::ConnectionEnd; +use modules::ics03_connection::connection::ConnectionEnd; #[derive(Clone, Command, Debug, Options)] pub struct QueryConnectionEndCmd { diff --git a/relayer-cli/tests/integration.rs b/relayer-cli/tests/integration.rs index 58b08c434e..ebc0c82ad1 100644 --- a/relayer-cli/tests/integration.rs +++ b/relayer-cli/tests/integration.rs @@ -11,18 +11,18 @@ unused_qualifications )] +use modules::ics03_connection::connection::ConnectionEnd; +use modules::ics03_connection::exported::Connection; +use modules::ics03_connection::exported::State as ConnectionState; +use modules::ics04_channel::channel::ChannelEnd; +use modules::ics04_channel::exported::Channel; +use modules::ics04_channel::exported::Order; +use modules::ics04_channel::exported::State as ChannelState; +use modules::ics23_commitment::CommitmentPrefix; +use modules::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; +use modules::ics24_host::Path::{ChannelEnds, ClientConnections, Connections}; use relayer::chain::{Chain, CosmosSDKChain}; use relayer::config::{ChainConfig, Config}; -use relayer_modules::ics03_connection::connection::ConnectionEnd; -use relayer_modules::ics03_connection::exported::Connection; -use relayer_modules::ics03_connection::exported::State as ConnectionState; -use relayer_modules::ics04_channel::channel::ChannelEnd; -use relayer_modules::ics04_channel::exported::Channel; -use relayer_modules::ics04_channel::exported::Order; -use relayer_modules::ics04_channel::exported::State as ChannelState; -use relayer_modules::ics23_commitment::CommitmentPrefix; -use relayer_modules::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; -use relayer_modules::ics24_host::Path::{ChannelEnds, ClientConnections, Connections}; use std::str::FromStr; use tendermint::chain::Id; use tendermint::net::Address; diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 03aa33c7cc..59e25ce90b 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "relayer" -version = "0.0.1" +version = "0.0.2" edition = "2018" authors = [ - "Anca Zamfir ", - "Romain Ruetschi " + "Informal Systems " ] [dependencies] -relayer-modules = { path = "../modules" } -tendermint = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master" } -tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master", features=["client"] } +modules = { path = "../modules" } +tendermint = "0.15.0" +tendermint-rpc = { version = "0.15.0", features=["client"] } anomaly = "0.2.0" async-trait = "0.1.24" humantime-serde = "1.0.0" diff --git a/relayer/src/chain.rs b/relayer/src/chain.rs index f8cb81b30d..d71e965eda 100644 --- a/relayer/src/chain.rs +++ b/relayer/src/chain.rs @@ -8,9 +8,9 @@ use ::tendermint::lite::types as tmlite; use ::tendermint::lite::{self, Height, TrustThresholdFraction}; use ::tendermint_rpc::Client as RpcClient; -use relayer_modules::ics02_client::state::{ClientState, ConsensusState}; -use relayer_modules::ics24_host::Path; -use relayer_modules::try_from_raw::TryFromRaw; +use modules::ics02_client::state::{ClientState, ConsensusState}; +use modules::ics24_host::Path; +use modules::try_from_raw::TryFromRaw; use crate::config::ChainConfig; use crate::error; diff --git a/relayer/src/chain/cosmos.rs b/relayer/src/chain/cosmos.rs index 59aad7b597..436dde6f1f 100644 --- a/relayer/src/chain/cosmos.rs +++ b/relayer/src/chain/cosmos.rs @@ -8,10 +8,10 @@ use tendermint::lite::TrustThresholdFraction; use tendermint_rpc::Client as RpcClient; use core::future::Future; -use relayer_modules::ics07_tendermint::client_state::ClientState; -use relayer_modules::ics07_tendermint::consensus_state::ConsensusState; -use relayer_modules::ics24_host::{Path, IBC_QUERY_PATH}; -use relayer_modules::try_from_raw::TryFromRaw; +use modules::ics07_tendermint::client_state::ClientState; +use modules::ics07_tendermint::consensus_state::ConsensusState; +use modules::ics24_host::{Path, IBC_QUERY_PATH}; +use modules::try_from_raw::TryFromRaw; use crate::client::rpc_requester::RpcRequester; use crate::config::ChainConfig; diff --git a/relayer/src/event_handler.rs b/relayer/src/event_handler.rs index 56aa9ae1b0..06245dcd61 100644 --- a/relayer/src/event_handler.rs +++ b/relayer/src/event_handler.rs @@ -1,4 +1,4 @@ -use relayer_modules::events::IBCEvent; +use modules::events::IBCEvent; use tokio::sync::mpsc::Receiver; use ::tendermint::chain::Id as ChainId; diff --git a/relayer/src/event_monitor.rs b/relayer/src/event_monitor.rs index ce694a43ec..9761e5bda1 100644 --- a/relayer/src/event_monitor.rs +++ b/relayer/src/event_monitor.rs @@ -1,4 +1,4 @@ -use relayer_modules::events::IBCEvent; +use modules::events::IBCEvent; use tendermint::{net, Error as TMError}; use tendermint_rpc::{event_listener, event_listener::EventSubscription}; use tokio::sync::mpsc::Sender; @@ -82,7 +82,7 @@ impl EventMonitor { /// get a TM event and extract the IBC events pub async fn collect_events(&mut self) -> Result<(), TMError> { if let Some(tm_event) = self.event_listener.get_event().await? { - if let Ok(ibc_events) = relayer_modules::events::get_all_events(tm_event) { + if let Ok(ibc_events) = modules::events::get_all_events(tm_event) { // TODO - send_timeout()? self.channel_to_handler .send((self.chain_id, ibc_events)) diff --git a/relayer/src/query/client.rs b/relayer/src/query/client.rs index aaea6e4fa9..4ee341fa2d 100644 --- a/relayer/src/query/client.rs +++ b/relayer/src/query/client.rs @@ -1,10 +1,10 @@ -use relayer_modules::ics24_host::identifier::ClientId; -use relayer_modules::Height; +use modules::ics24_host::identifier::ClientId; +use modules::Height; use crate::chain::Chain; -use relayer_modules::ics02_client::query::{ClientFullStateResponse, ConsensusStateResponse}; +use modules::ics02_client::query::{ClientFullStateResponse, ConsensusStateResponse}; -use relayer_modules::error; +use modules::error; pub async fn query_client_full_state( _chain: &C,