From e3ef2d80e44d4eb63adf76189da9c8a1b141ec65 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:22:39 +0200 Subject: [PATCH 01/16] Bump all 0.6.2 crates to 0.7.0 --- modules/Cargo.toml | 2 +- relayer-cli/Cargo.toml | 8 ++++---- relayer/Cargo.toml | 8 ++++---- telemetry/Cargo.toml | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/Cargo.toml b/modules/Cargo.toml index 4af0377e16..a7b8ec5f34 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc" -version = "0.6.2" +version = "0.7.0" edition = "2018" license = "Apache-2.0" readme = "README.md" diff --git a/relayer-cli/Cargo.toml b/relayer-cli/Cargo.toml index 03693323b9..562509d3b1 100644 --- a/relayer-cli/Cargo.toml +++ b/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "0.6.2" +version = "0.7.0" edition = "2018" license = "Apache-2.0" readme = "README.md" @@ -26,10 +26,10 @@ profiling = ["ibc-relayer/profiling"] telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] [dependencies] -ibc = { version = "0.6.2", path = "../modules" } -ibc-relayer = { version = "0.6.2", path = "../relayer" } +ibc = { version = "0.7.0", path = "../modules" } +ibc-relayer = { version = "0.7.0", path = "../relayer" } ibc-proto = { version = "0.9.1", path = "../proto" } -ibc-telemetry = { version = "0.6.2", path = "../telemetry", optional = true } +ibc-telemetry = { version = "0.7.0", path = "../telemetry", optional = true } ibc-relayer-rest = { version = "0.1.0", path = "../relayer-rest" } gumdrop = { version = "0.7", features = ["default_expr"] } diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 74de846e17..5f1b435335 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.6.2" +version = "0.7.0" edition = "2018" license = "Apache-2.0" readme = "README.md" @@ -22,9 +22,9 @@ profiling = [] telemetry = ["ibc-telemetry"] [dependencies] -ibc = { version = "0.6.2", path = "../modules" } +ibc = { version = "0.7.0", path = "../modules" } ibc-proto = { version = "0.9.1", path = "../proto" } -ibc-telemetry = { version = "0.6.2", path = "../telemetry", optional = true } +ibc-telemetry = { version = "0.7.0", path = "../telemetry", optional = true } subtle-encoding = "0.5" async-trait = "0.1.50" @@ -78,7 +78,7 @@ features = ["unstable"] version = "=0.21.0" [dev-dependencies] -ibc = { version = "0.6.2", path = "../modules", features = ["mocks"] } +ibc = { version = "0.7.0", path = "../modules", features = ["mocks"] } serial_test = "0.5.0" env_logger = "0.9.0" tracing-subscriber = "0.2.19" diff --git a/telemetry/Cargo.toml b/telemetry/Cargo.toml index e0c6a5c0f7..d60766c76d 100644 --- a/telemetry/Cargo.toml +++ b/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.6.2" +version = "0.7.0" edition = "2018" license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ description = """ """ [dependencies] -ibc = { version = "0.6.2", path = "../modules" } +ibc = { version = "0.7.0", path = "../modules" } crossbeam-channel = "0.5.1" once_cell = "1.8.0" From 81f8b73e65cf9c56c999b6618032445c26e6915d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:25:15 +0200 Subject: [PATCH 02/16] Bump `ibc-proto` to v0.10.0 --- modules/Cargo.toml | 2 +- proto/Cargo.toml | 2 +- relayer-cli/Cargo.toml | 2 +- relayer/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Cargo.toml b/modules/Cargo.toml index a7b8ec5f34..1a773e85c4 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -25,7 +25,7 @@ mocks = [ "tendermint-testgen", "sha2" ] [dependencies] # Proto definitions for all IBC-related interfaces, e.g., connections or channels. -ibc-proto = { version = "0.9.1", path = "../proto" } +ibc-proto = { version = "0.10.0", path = "../proto" } ics23 = "0.6.5" chrono = "0.4.19" thiserror = "1.0.26" diff --git a/proto/Cargo.toml b/proto/Cargo.toml index aaa51ada72..fafda4e937 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-proto" -version = "0.9.1" +version = "0.10.0" authors = ["Informal Systems "] edition = "2018" license = "Apache-2.0" diff --git a/relayer-cli/Cargo.toml b/relayer-cli/Cargo.toml index 562509d3b1..e854056019 100644 --- a/relayer-cli/Cargo.toml +++ b/relayer-cli/Cargo.toml @@ -28,7 +28,7 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] [dependencies] ibc = { version = "0.7.0", path = "../modules" } ibc-relayer = { version = "0.7.0", path = "../relayer" } -ibc-proto = { version = "0.9.1", path = "../proto" } +ibc-proto = { version = "0.10.0", path = "../proto" } ibc-telemetry = { version = "0.7.0", path = "../telemetry", optional = true } ibc-relayer-rest = { version = "0.1.0", path = "../relayer-rest" } diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 5f1b435335..05f396d228 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -23,7 +23,7 @@ telemetry = ["ibc-telemetry"] [dependencies] ibc = { version = "0.7.0", path = "../modules" } -ibc-proto = { version = "0.9.1", path = "../proto" } +ibc-proto = { version = "0.10.0", path = "../proto" } ibc-telemetry = { version = "0.7.0", path = "../telemetry", optional = true } subtle-encoding = "0.5" From 084f23e99957369adcc0e56175ee0499b5460934 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:25:25 +0200 Subject: [PATCH 03/16] Bump version in guide --- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- guide/src/commands/global.md | 2 +- guide/src/config.md | 2 +- guide/src/help.md | 4 ++-- guide/src/index.md | 2 +- guide/src/installation.md | 14 +++++++------- guide/src/tutorials/local-chains/start.md | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/guide/README.md b/guide/README.md index b8439a843e..f9a0cbfc8e 100644 --- a/guide/README.md +++ b/guide/README.md @@ -11,7 +11,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `0.6.2`. +Current version: `0.7.0`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 9f10f56385..e8289dbfb2 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes (v0.6.2) +# Hermes (v0.7.0) --- - [Introduction](./index.md) diff --git a/guide/src/commands/global.md b/guide/src/commands/global.md index 21b86b9ebd..498e9bd5cb 100644 --- a/guide/src/commands/global.md +++ b/guide/src/commands/global.md @@ -3,7 +3,7 @@ Hermes accepts global options which affect all commands. ```shell -hermes 0.6.2 +hermes 0.7.0 Informal Systems Implementation of `hermes`, an IBC Relayer developed in Rust. diff --git a/guide/src/config.md b/guide/src/config.md index ca86ab9dc9..bc1c43ec58 100644 --- a/guide/src/config.md +++ b/guide/src/config.md @@ -27,7 +27,7 @@ The configuration file must have one `global` section, and one `chains` section > **Note:** As of 0.6.0, the Hermes configuration file is self-documented. > This section of the guide which discusses each parameter in turn is no > longer maintained, and we may remove it soon. Please read the configuration -> file [`config.toml`](https://github.com/informalsystems/ibc-rs/blob/v0.6.2/config.toml) itself for the most up-to-date documentation of parameters. +> file [`config.toml`](https://github.com/informalsystems/ibc-rs/blob/v0.7.0/config.toml) itself for the most up-to-date documentation of parameters. ### `[global]` diff --git a/guide/src/help.md b/guide/src/help.md index ea59a8650c..313c7ff168 100644 --- a/guide/src/help.md +++ b/guide/src/help.md @@ -39,7 +39,7 @@ hermes help create will provide details about all the valid invocations of the `create` CLI command. ``` -hermes 0.6.2 +hermes 0.7.0 Informal Systems Hermes is an IBC Relayer written in Rust. @@ -63,7 +63,7 @@ hermes help create channel ``` ``` -hermes 0.6.2 +hermes 0.7.0 Informal Systems Hermes is an IBC Relayer written in Rust. diff --git a/guide/src/index.md b/guide/src/index.md index c08a4e3a28..b909718434 100644 --- a/guide/src/index.md +++ b/guide/src/index.md @@ -1,4 +1,4 @@ -# Hermes Guide (v0.6.2) +# Hermes Guide (v0.7.0) This guide can help you setup, configure, and operate Hermes to transfer packets between two IBC enabled chains. diff --git a/guide/src/installation.md b/guide/src/installation.md index fa773a3627..6044910ee5 100644 --- a/guide/src/installation.md +++ b/guide/src/installation.md @@ -14,8 +14,8 @@ There are two main approaches for obtaining Hermes: Simply head to the GitHub [Releases][releases] page and download the latest version of Hermes binary matching your platform: -- MacOS: `hermes-v0.6.2-x86_64-apple-darwin.tar.gz` (or .zip), -- Linux: `hermes-v0.6.2-x86_64-unknown-linux-gnu.tar.gz` (or .zip). +- MacOS: `hermes-v0.7.0-x86_64-apple-darwin.tar.gz` (or .zip), +- Linux: `hermes-v0.7.0-x86_64-unknown-linux-gnu.tar.gz` (or .zip). The step-by-step instruction below should carry you through the whole process: @@ -47,7 +47,7 @@ hermes version ``` ``` -hermes 0.6.2 +hermes 0.7.0 ``` ## Install via Cargo @@ -81,7 +81,7 @@ hermes version ``` ``` -hermes 0.6.2 +hermes 0.7.0 ``` ## Build from source @@ -103,10 +103,10 @@ cd ibc-rs Go to the [ibc-rs releases](https://github.com/informalsystems/ibc-rs/releases) page to see what is the most recent release. -Then checkout the release, for example if the most recent release is `v0.6.2` then execute the command: +Then checkout the release, for example if the most recent release is `v0.7.0` then execute the command: ```shell -git checkout v0.6.2 +git checkout v0.7.0 ``` ### Building with `cargo build` @@ -151,7 +151,7 @@ If you run the `hermes` without any additional parameters you should see the usa ``` ``` -hermes 0.6.2 +hermes 0.7.0 Informal Systems USAGE: diff --git a/guide/src/tutorials/local-chains/start.md b/guide/src/tutorials/local-chains/start.md index 2ff22741b8..1d0db6eaf5 100644 --- a/guide/src/tutorials/local-chains/start.md +++ b/guide/src/tutorials/local-chains/start.md @@ -8,7 +8,7 @@ To this end, clone the `ibc-rs` repository and check out the current version: ```bash git clone git@github.com:informalsystems/ibc-rs.git cd ibc-rs -git checkout v0.6.2 +git checkout v0.7.0 ``` ### Stop existing `gaiad` processes From 80aac54ee6ee9c045f44851b1e3070d81299a8d9 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:26:59 +0200 Subject: [PATCH 04/16] Add `ibc-relayer-rest` crate to README table --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e8bd64417c..4aa3527633 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Includes [TLA+ specifications](docs/spec). | [ibc](./modules) (modules) | lib| [![IBC Crate][ibc-crate-image]][ibc-crate-link] | [![IBC Docs][ibc-docs-image]][ibc-docs-link] | | [ibc-relayer](./relayer) | lib | [![IBC Relayer Crate][relayer-crate-image]][relayer-crate-link] | [![IBC Relayer Docs][relayer-docs-image]][relayer-docs-link] | | [ibc-relayer-cli](./relayer-cli) | bin: [hermes](relayer-cli/) | [![IBC Relayer CLI Crate][relayer-cli-crate-image]][relayer-cli-crate-link] | [![IBC Relayer CLI Docs][relayer-cli-docs-image]][relayer-cli-docs-link] | +| [ibc-relayer-rest](./relayer-rest) | lib | [![IBC Relayer REST Crate][relayer-rest-crate-image]][relayer-rest-crate-link] | [![IBC Relayer REST Docs][relayer-rest-docs-image]][relayer-rest-docs-link] | | [ibc-proto](./proto) | lib | [![IBC Proto Crate][ibc-proto-crate-image]][ibc-proto-crate-link] | [![IBC Proto Docs][ibc-proto-docs-image]][ibc-proto-docs-link] | | [ibc-telemetry](./telemetry) | lib | [![IBC Telemetry Crate][ibc-telemetry-crate-image]][ibc-telemetry-crate-link] | [![IBC Telemetry Docs][ibc-telemetry-docs-image]][ibc-telemetry-docs-link] | @@ -91,6 +92,10 @@ Unless required by applicable law or agreed to in writing, software distributed [relayer-cli-crate-link]: https://crates.io/crates/ibc-relayer-cli [relayer-cli-docs-image]: https://docs.rs/ibc-relayer-cli/badge.svg [relayer-cli-docs-link]: https://docs.rs/ibc-relayer-cli/ +[relayer-rest-crate-image]: https://img.shields.io/crates/v/ibc-relayer-rest.svg +[relayer-rest-crate-link]: https://crates.io/crates/ibc-relayer-rest +[relayer-rest-docs-image]: https://docs.rs/ibc-relayer-rest/badge.svg +[relayer-rest-docs-link]: https://docs.rs/ibc-relayer-rest/ [ibc-proto-crate-image]: https://img.shields.io/crates/v/ibc-proto.svg [ibc-proto-crate-link]: https://crates.io/crates/ibc-proto [ibc-proto-docs-image]: https://docs.rs/ibc-proto/badge.svg From c7a257b7c56ed79092e1461bb71ea1c35225f37e Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:28:45 +0200 Subject: [PATCH 05/16] fixup version --- relayer-rest/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer-rest/Cargo.toml b/relayer-rest/Cargo.toml index 32a40005d7..800d374129 100644 --- a/relayer-rest/Cargo.toml +++ b/relayer-rest/Cargo.toml @@ -14,8 +14,8 @@ description = """ """ [dependencies] -ibc = { version = "0.6.1", path = "../modules" } -ibc-relayer = { version = "0.6.1", path = "../relayer" } +ibc = { version = "0.7.0", path = "../modules" } +ibc-relayer = { version = "0.7.0", path = "../relayer" } crossbeam-channel = { version = "0.5" } rouille = { version = "3.1" } From ffe1c0b08a63967882c59e782510bd3b9802da6f Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Aug 2021 12:47:00 +0200 Subject: [PATCH 06/16] Update Cargo.lock --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e110eaa065..573961cab4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1336,7 +1336,7 @@ dependencies = [ [[package]] name = "ibc" -version = "0.6.2" +version = "0.7.0" dependencies = [ "bytes", "chrono", @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.9.1" +version = "0.10.0" dependencies = [ "bytes", "getrandom 0.2.3", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.6.2" +version = "0.7.0" dependencies = [ "anyhow", "async-stream", @@ -1431,7 +1431,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "0.6.2" +version = "0.7.0" dependencies = [ "abscissa_core", "atty", @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.6.2" +version = "0.7.0" dependencies = [ "crossbeam-channel 0.5.1", "ibc", From c0c1e7baafcd1b7391baad2e8db2d07b84c5cc19 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 18 Aug 2021 13:04:40 +0200 Subject: [PATCH 07/16] Update dependencies --- Cargo.lock | 86 ++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 573961cab4..f8837e4790 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" @@ -368,9 +368,9 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clap" -version = "3.0.0-beta.2" +version = "3.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" +checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406" dependencies = [ "atty", "bitflags", @@ -381,15 +381,14 @@ dependencies = [ "strsim 0.10.0", "termcolor", "textwrap", - "unicode-width", "vec_map", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.2" +version = "3.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" +checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac" dependencies = [ "heck", "proc-macro-error", @@ -555,9 +554,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32a398eb1ccfbe7e4f452bc749c44d38dd732e9a253f19da224c416f00ee7f4" +checksum = "09910f0830248af4499907177608b81d640c8c404526f8770b87b765fbd8c9a5" dependencies = [ "generic-array", "rand_core 0.6.3", @@ -722,9 +721,9 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "ecdsa" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713c32426287891008edb98f8b5c6abb2130aa043c93a818728fcda78606f274" +checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372" dependencies = [ "der", "elliptic-curve", @@ -804,9 +803,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63eec06c61e487eecf0f7e6e6372e596a81922c28d33e645d6983ca6493a1af0" +checksum = "d0f40b2dcd8bc322217a5f6559ae5f9e9d1de202a2ecee2e9eafcbece7562a4f" dependencies = [ "rand_core 0.6.3", "subtle", @@ -1360,7 +1359,7 @@ dependencies = [ "test-env-log", "thiserror", "tracing", - "tracing-subscriber 0.2.19", + "tracing-subscriber 0.2.20", ] [[package]] @@ -1426,7 +1425,7 @@ dependencies = [ "toml", "tonic", "tracing", - "tracing-subscriber 0.2.19", + "tracing-subscriber 0.2.20", ] [[package]] @@ -1466,7 +1465,7 @@ dependencies = [ "tokio", "toml", "tracing", - "tracing-subscriber 0.2.19", + "tracing-subscriber 0.2.20", ] [[package]] @@ -1635,9 +1634,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.98" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" +checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "lock_api" @@ -1668,9 +1667,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-uninit" @@ -1743,9 +1742,9 @@ dependencies = [ [[package]] name = "modelator" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ab4fd1c35db4a1c20a729d779b04d7d3f02a0091cec676d0f95755427a91a2e" +checksum = "c107a31c31b93540d2f058e24695b1c6a101b5cca01ab214db04a4d471e9f9e0" dependencies = [ "clap", "hex", @@ -1756,7 +1755,7 @@ dependencies = [ "tempfile", "thiserror", "tracing", - "tracing-subscriber 0.2.19", + "tracing-subscriber 0.2.20", "ureq", ] @@ -1780,9 +1779,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" +checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" dependencies = [ "lazy_static", "libc", @@ -1926,9 +1925,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.35" +version = "0.10.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" +checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -1946,9 +1945,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.65" +version = "0.9.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" +checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82" dependencies = [ "autocfg", "cc", @@ -1989,9 +1988,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "2.4.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" +checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d" [[package]] name = "owning_ref" @@ -3147,9 +3146,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.12.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" dependencies = [ "unicode-width", ] @@ -3289,9 +3288,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" +checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" dependencies = [ "autocfg", "bytes", @@ -3462,9 +3461,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8" dependencies = [ "lazy_static", ] @@ -3476,7 +3475,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24" dependencies = [ "tracing", - "tracing-subscriber 0.2.19", + "tracing-subscriber 0.2.20", ] [[package]] @@ -3529,9 +3528,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab69019741fca4d98be3c62d2b75254528b5432233fd8a4d2739fec20278de48" +checksum = "b9cbe87a2fa7e35900ce5de20220a582a9483a7063811defce79d7cbd59d4cfe" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -3606,12 +3605,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] +checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" [[package]] name = "unicode-normalization" From 2632b773b8c0a4ece043bbb5f26eb7f471b79bda Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 19 Aug 2021 13:00:45 +0200 Subject: [PATCH 08/16] Update supported Cosmos SDK version range, cf. #1266 --- guide/src/features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/src/features.md b/guide/src/features.md index 5f68eb83e4..18158dc06a 100644 --- a/guide/src/features.md +++ b/guide/src/features.md @@ -5,7 +5,7 @@ A feature matrix and comparison between the Rust and Go relayer implementations > **Cosmos SDK compatibility:** > Hermes supports Cosmos SDK chains implementing the [IBC v1.0][ibcv1] protocol specification. -> Cosmos SDK versions `0.41.3` to `0.42.6` are officially supported. +> Cosmos SDK versions `0.41.3` to `0.42.9` are officially supported. > In case Hermes finds an incompatible SDK version, it will output a log warning. [ibcv1]: https://github.com/cosmos/ibc-go/tree/main/proto/ibc From ab681b56cd8e2200d2f9afea4217dd03f0ec9ece Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 19 Aug 2021 14:32:12 +0200 Subject: [PATCH 09/16] Improve structure of JSON sent back by the REST server --- relayer-rest/Cargo.toml | 12 +++---- relayer-rest/src/handle.rs | 6 ++-- relayer-rest/src/server.rs | 41 ++++++++++++++++------ relayer/src/rest.rs | 22 +++++++----- relayer/src/rest/error.rs | 71 +++++++++++++++++++++++--------------- 5 files changed, 97 insertions(+), 55 deletions(-) diff --git a/relayer-rest/Cargo.toml b/relayer-rest/Cargo.toml index 800d374129..d48eacd242 100644 --- a/relayer-rest/Cargo.toml +++ b/relayer-rest/Cargo.toml @@ -17,12 +17,12 @@ description = """ ibc = { version = "0.7.0", path = "../modules" } ibc-relayer = { version = "0.7.0", path = "../relayer" } -crossbeam-channel = { version = "0.5" } -rouille = { version = "3.1" } -tracing = { version = "0.1" } +crossbeam-channel = "0.5" +rouille = "3.1" +serde = "1.0.127" +tracing = "0.1" [dev-dependencies] -serde = "1.0.127" serde_json = "1.0.66" -toml = "0.5.8" -ureq = "2.1.1" +toml = "0.5.8" +ureq = "2.1.1" diff --git a/relayer-rest/src/handle.rs b/relayer-rest/src/handle.rs index 01d577c722..d889281903 100644 --- a/relayer-rest/src/handle.rs +++ b/relayer-rest/src/handle.rs @@ -37,12 +37,12 @@ where // Send the request request_sender .send(req) - .map_err(|e| RestApiError::channel_send(e.to_string()))?; + .map_err(|e| RestApiError::ChannelSend(e.to_string()))?; // Wait for the reply reply_receiver .recv() - .map_err(|e| RestApiError::channel_recv(e.to_string()))? + .map_err(|e| RestApiError::ChannelRecv(e.to_string()))? } pub fn all_chain_ids(sender: &channel::Sender) -> Result, RestApiError> { @@ -55,7 +55,7 @@ pub fn chain_config( ) -> Result { match ChainId::from_str(chain_id) { Ok(chain_id) => submit_request(sender, |reply_to| Request::GetChain { chain_id, reply_to }), - Err(e) => Err(RestApiError::invalid_chain_id(chain_id.to_string(), e)), + Err(e) => Err(RestApiError::InvalidChainId(chain_id.to_string(), e.0)), } } diff --git a/relayer-rest/src/server.rs b/relayer-rest/src/server.rs index 5e2de727d4..89ac24199a 100644 --- a/relayer-rest/src/server.rs +++ b/relayer-rest/src/server.rs @@ -1,6 +1,7 @@ use std::thread; use crossbeam_channel as channel; +use serde::{Deserialize, Serialize}; use tracing::{info, trace}; use ibc_relayer::rest::request::Request; @@ -28,37 +29,57 @@ impl ServerHandle { pub fn spawn(config: Config) -> (ServerHandle, channel::Receiver) { let (req_tx, req_rx) = channel::unbounded::(); - info!("[rest] starting REST API server at {}", config); + info!("starting REST API server listening at http://{}", config); let handle = run(config, req_tx); (handle, req_rx) } +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "status", content = "result")] +#[serde(rename_all = "lowercase")] +enum JsonResult { + Success(R), + Error(E), +} + +impl From> for JsonResult { + fn from(r: Result) -> Self { + match r { + Ok(a) => Self::Success(a), + Err(e) => Self::Error(e), + } + } +} + #[allow(clippy::manual_strip)] fn run(config: Config, sender: channel::Sender) -> ServerHandle { let server = rouille::Server::new(config.address(), move |request| { router!(request, - (GET) (/) => { - trace!("[rest/server] GET /"); + (GET) (/version) => { + trace!("[rest/server] GET /version"); let result = assemble_version_info(&sender); rouille::Response::json(&result) }, - (GET) (/chain) => { + (GET) (/chains) => { // TODO(Soares): Add a `into_detail` to consume the error and obtain // the underlying detail, so that we avoid doing `e.0` - trace!("[rest/server] GET /chain"); - rouille::Response::json(&all_chain_ids(&sender).map_err(|e| e.0)) + trace!("[rest] GET /chains"); + let result = all_chain_ids(&sender); + rouille::Response::json(&JsonResult::from(result)) }, (GET) (/chain/{id: String}) => { - trace!("[rest/server] GET /chain/{}", id); - rouille::Response::json(&chain_config(&sender, &id).map_err(|e| e.0)) + trace!("[rest] GET /chain/{}", id); + let result = chain_config(&sender, &id); + rouille::Response::json(&JsonResult::from(result)) }, (GET) (/state) => { - trace!("[rest/server] GET /state"); - rouille::Response::json(&supervisor_state(&sender).map_err(|e| e.0)) + trace!("[rest] GET /state"); + let result = supervisor_state(&sender); + rouille::Response::json(&JsonResult::from(result)) }, _ => rouille::Response::empty_404(), diff --git a/relayer/src/rest.rs b/relayer/src/rest.rs index 9ae146fce3..8ad9e17486 100644 --- a/relayer/src/rest.rs +++ b/relayer/src/rest.rs @@ -1,5 +1,5 @@ use crossbeam_channel::TryRecvError; -use tracing::{debug, error}; +use tracing::{error, trace}; use crate::{ config::Config, @@ -44,38 +44,42 @@ pub fn process_incoming_requests(config: &Config, channel: &Receiver) -> Option< match channel.try_recv() { Ok(request) => match request { Request::Version { reply_to } => { - debug!("[rest/supervisor] Version"); + trace!("[rest] Version"); + let v = VersionInfo { name: NAME.to_string(), version: VER.to_string(), }; + reply_to.send(Ok(v)).unwrap_or_else(|e| { error!("[rest/supervisor] error replying to a REST request {}", e) }); } Request::GetChains { reply_to } => { - debug!("[rest/supervisor] GetChains"); + trace!("[rest] GetChains"); + reply_to .send(Ok(config.chains.iter().map(|c| c.id.clone()).collect())) - .unwrap_or_else(|e| { - error!("[rest/supervisor] error replying to a REST request {}", e) - }); + .unwrap_or_else(|e| error!("[rest] error replying to a REST request {}", e)); } Request::GetChain { chain_id, reply_to } => { - debug!("[rest/supervisor] GetChain {}", chain_id); + trace!("[rest] GetChain {}", chain_id); + let result = config .find_chain(&chain_id) .cloned() - .ok_or_else(|| RestApiError::chain_config_not_found(chain_id)); + .ok_or(RestApiError::ChainConfigNotFound(chain_id)); + reply_to.send(result).unwrap_or_else(|e| { error!("[rest/supervisor] error replying to a REST request {}", e) }); } Request::State { reply_to } => { - debug!("[rest/supervisor] State"); + trace!("[rest] State"); + return Some(Command::DumpState(reply_to)); } }, diff --git a/relayer/src/rest/error.rs b/relayer/src/rest/error.rs index b84d05c66b..bb77ec1e6f 100644 --- a/relayer/src/rest/error.rs +++ b/relayer/src/rest/error.rs @@ -1,37 +1,54 @@ -use flex_error::define_error; -use serde::Serialize; +use serde::ser::{Serialize, SerializeMap, Serializer}; +use thiserror::Error; -use ibc::{ics24_host::error::ValidationError, ics24_host::identifier::ChainId}; +use ibc::ics24_host::{error::ValidationErrorDetail, identifier::ChainId}; -define_error! { - #[derive(Debug, Serialize)] - RestApiError { - ChannelSend - { cause: String } - |e| { format!("failed to send a request through crossbeam channel: {0}", e.cause) }, +#[derive(Error, Debug)] +pub enum RestApiError { + #[error("failed to send a request through crossbeam channel: {0}")] + ChannelSend(String), - ChannelRecv - { cause: String } - |e| { format!("failed to receive a reply from crossbeam channel: {0}", e.cause) }, + #[error("failed to receive a reply from crossbeam channel: {0}")] + ChannelRecv(String), - Serialization - { cause: String } - |e| { format!("failed while serializing reply into json value: {0}", e.cause) }, + #[error("failed while serializing reply into json value: {0}")] + Serialization(String), - ChainConfigNotFound - { chain_id: ChainId } - |e| { format!("could not find configuration for chain id {0}", e.chain_id) }, + #[error("could not find configuration for chain: {0}")] + ChainConfigNotFound(ChainId), - InvalidChainId - { chain_id_raw: String } - [ ValidationError ] - |e| { format!("failed to parse the string {0} into a valid chain identifier", e.chain_id_raw) }, + #[error("failed to parse the string {0} into a valid chain identifier: {1}")] + InvalidChainId(String, ValidationErrorDetail), - InvalidChainConfig - { cause: String } - |e| { format!("failed while parsing the request body into a chain configuration {}", e.cause) }, + #[error("failed while parsing the request body into a chain configuration: {0}")] + InvalidChainConfig(String), - Unimplemented - | _ | { "not implemented".to_string() }, + #[error("not implemented")] + Unimplemented, +} + +impl RestApiError { + pub fn name(&self) -> &'static str { + match self { + RestApiError::ChannelSend(_) => "ChannelSend", + RestApiError::ChannelRecv(_) => "ChannelRecv", + RestApiError::Serialization(_) => "Serialization", + RestApiError::ChainConfigNotFound(_) => "ChainConfigNotFound", + RestApiError::InvalidChainId(_, _) => "InvalidChainId", + RestApiError::InvalidChainConfig(_) => "InvalidChainConfig", + RestApiError::Unimplemented => "Unimplemented", + } + } +} + +impl Serialize for RestApiError { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut map = serializer.serialize_map(Some(3))?; + map.serialize_entry("name", self.name())?; + map.serialize_entry("msg", &self.to_string())?; + map.end() } } From ad40397325f98d5c13e47c8ff1268c3625cd1fc3 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 19 Aug 2021 14:32:31 +0200 Subject: [PATCH 10/16] Remove prefix from info message in start command --- relayer-cli/src/commands/start.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relayer-cli/src/commands/start.rs b/relayer-cli/src/commands/start.rs index 552d26a583..e6e1e1d8ca 100644 --- a/relayer-cli/src/commands/start.rs +++ b/relayer-cli/src/commands/start.rs @@ -127,7 +127,7 @@ fn make_supervisor( match ibc_telemetry::spawn((telemetry.host, telemetry.port), state.clone()) { Ok((addr, _)) => { info!( - "telemetry service running, exposing metrics at {}/metrics", + "telemetry service running, exposing metrics at http://{}/metrics", addr ); } From 7fba0ec071bcc38ece2e987164a62539a4cc9cd8 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 19 Aug 2021 15:25:18 +0200 Subject: [PATCH 11/16] Document the REST server API --- guide/src/SUMMARY.md | 1 + guide/src/config.md | 25 +++++- guide/src/rest-api.md | 178 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 guide/src/rest-api.md diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index e8289dbfb2..8c9120513e 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -12,6 +12,7 @@ - [Installation](./installation.md) - [Configuration](./config.md) - [Telemetry](./telemetry.md) +- [REST API](./rest-api.md) - [Tutorials](./tutorials/index.md) - [Local chains](./tutorials/local-chains/index.md) - [Install Gaia](./tutorials/local-chains/gaia.md) diff --git a/guide/src/config.md b/guide/src/config.md index bc1c43ec58..cfddb27fa6 100644 --- a/guide/src/config.md +++ b/guide/src/config.md @@ -68,8 +68,29 @@ Here is an example for the `telemetry` section: ```toml [telemetry] enabled = true -host = '127.0.0.1' -port = 3001 +host = '127.0.0.1' +port = 3001 +``` + +### `[rest]` + +The `rest` section defines parameters for Hermes' built-in [REST API](rest-api.md).. + +#### Parameters + +* __enabled__: *(boolean)* Whether or not to enable the built-in REST server. Default: `false`. + +* __host__: *(string)* Specify the IPv4/6 host over which the built-in HTTP server will be listening. Default: `127.0.0.1` + +* __port__: *(u16)* Specify the port over which the built-in HTTP server will be listening. Default: `3000` + +Here is an example for the `rest` section: + +```toml +[rest] +enabled = true +host = '127.0.0.1' +port = 3000 ``` ### `[[chains]]` diff --git a/guide/src/rest-api.md b/guide/src/rest-api.md new file mode 100644 index 0000000000..12a24cb1c3 --- /dev/null +++ b/guide/src/rest-api.md @@ -0,0 +1,178 @@ +# REST API + +*Since version 0.7.0.* + +Hermes features a built-in HTTP server which exposes information +about the relayer configuration and state via a REST API. + +## Table of Contents + + + +## Configuration + +The REST API is not active by default, and must be enabled in the relayer configuration: + +```toml +[rest] +enabled = true +host = '127.0.0.1' +port = 3000 +``` + +Please see the [relevant section in the *Configuration* page](./config.md#rest) for details about the configuration options. + +## Endpoints + +### GET `/version` + +This endpoint returns the version of the Hermes (under the `ibc-relayer` key) as well +as the version of the REST server itself (under the `ibc-relayer-rest` key). + +**Example** + +``` +❯ curl -s -X GET 'http://127.0.0.1:3000/version' | jq +``` + +```json +[ + { + "name": "ibc-relayer", + "version": "0.7.0" + }, + { + "name": "ibc-relayer-rest", + "version": "0.1.0" + } +] +``` + +### GET `/chains` + +This endpoint return the identifiers of the chains that Hermes is connected to. +Those identifiers can be used with the `/chain/:id` endpoint to gather more +information about each chain's configuration. See the next section for more details. + +**Example** + +``` +❯ curl -s -X GET 'http://127.0.0.1:3000/chains' | jq +``` + +```json +{ + "status": "success", + "result": [ + "ibc-0", + "ibc-1" + ] +} +``` + +### GET `/chain/:id` + +This endpoint returns the configuration of the chain with the given identifier, +where `:id` stands for the identififer. + +**Example** + +``` +❯ curl -s -X GET 'http://127.0.0.1:3000/chain/ibc-0' | jq +``` + +```json +{ + "status": "success", + "result": { + "id": "ibc-0", + "rpc_addr": "http://127.0.0.1:26657/", + "websocket_addr": "ws://127.0.0.1:26657/websocket", + "grpc_addr": "http://127.0.0.1:9090/", + "rpc_timeout": "10s", + "account_prefix": "cosmos", + "key_name": "testkey", + "store_prefix": "ibc", + "max_gas": 900000000, + "gas_adjustment": null, + "max_msg_num": 60, + "max_tx_size": 2097152, + "clock_drift": "5s", + "trusting_period": "14days", + "trust_threshold": { + "numerator": "1", + "denominator": "3" + }, + "gas_price": { + "price": 0.001, + "denom": "stake" + }, + "packet_filter": { + "policy": "allowall" + } + } +} +``` + +### GET `/state` + +This endpoint returns the current state of the relayer, +namely which chains it is connected to, as well as a description +of all the workers which are currently active. + +``` +❯ curl -s -X GET 'http://127.0.0.1:3000/state' | jq +``` + +```json +{ + "status": "success", + "result": { + "chains": [ + "ibc-0", + "ibc-1" + ], + "workers": { + "Client": [ + { + "id": 3, + "object": { + "type": "Client", + "dst_chain_id": "ibc-1", + "dst_client_id": "07-tendermint-0", + "src_chain_id": "ibc-0" + } + }, + { + "id": 4, + "object": { + "type": "Client", + "dst_chain_id": "ibc-1", + "dst_client_id": "07-tendermint-1", + "src_chain_id": "ibc-0" + } + }, + { + "id": 1, + "object": { + "type": "Client", + "dst_chain_id": "ibc-0", + "dst_client_id": "07-tendermint-0", + "src_chain_id": "ibc-1" + } + }, + { + "id": 2, + "object": { + "type": "Client", + "dst_chain_id": "ibc-0", + "dst_client_id": "07-tendermint-1", + "src_chain_id": "ibc-1" + } + } + ] + } + } +} +``` + From 7544a218a04c3151708fb72e5183fa1b965830a5 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 23 Aug 2021 13:50:48 +0200 Subject: [PATCH 12/16] Include error source in `ConnectionError::Relayer` --- relayer/src/connection.rs | 2 +- relayer/src/supervisor/spawn.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer/src/connection.rs b/relayer/src/connection.rs index c0da8f50c7..15dc5b45cd 100644 --- a/relayer/src/connection.rs +++ b/relayer/src/connection.rs @@ -37,7 +37,7 @@ define_error! { ConnectionError { Relayer [ RelayerError ] - |_| { "relayer error" }, + |e| { format_args!("relayer error: {}", e.source) }, MissingLocalConnectionId |_| { "failed due to missing local channel id" }, diff --git a/relayer/src/supervisor/spawn.rs b/relayer/src/supervisor/spawn.rs index 23c76ffc6a..d20452c123 100644 --- a/relayer/src/supervisor/spawn.rs +++ b/relayer/src/supervisor/spawn.rs @@ -296,7 +296,7 @@ impl<'a, Chain: ChainHandle + 'static> SpawnContext<'a, Chain> { chain.id(), ), Err(e) => error!( - "skipped workers for connection {} on chain {} due to error {}", + "skipped workers for connection {} on chain {}, reason: {}", chain.id(), connection.connection_id, e From 59b74f781735779def42220b5dfdb233844519d1 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 23 Aug 2021 16:52:12 +0200 Subject: [PATCH 13/16] Add .changelog entry for #1278 --- .../unreleased/improvements/1265-async-tx-confirmation.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changelog/unreleased/improvements/1265-async-tx-confirmation.md diff --git a/.changelog/unreleased/improvements/1265-async-tx-confirmation.md b/.changelog/unreleased/improvements/1265-async-tx-confirmation.md new file mode 100644 index 0000000000..59cacc2c1b --- /dev/null +++ b/.changelog/unreleased/improvements/1265-async-tx-confirmation.md @@ -0,0 +1,5 @@ +- Improve performance and reliability of the relayer by asynchronously waiting for tx confirmations ([#1124], [#1265]) + +[#1124]: https://github.com/informalsystems/ibc-rs/issues/1124 +[#1265]: https://github.com/informalsystems/ibc-rs/issues/1265 + From f5abd2ebfdeab9296d2a40f51634391d5326795d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 23 Aug 2021 17:01:44 +0200 Subject: [PATCH 14/16] Fix ibc-relayer-rest integration tests --- relayer-rest/tests/mock.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/relayer-rest/tests/mock.rs b/relayer-rest/tests/mock.rs index 9a2a69ab00..92b1cd0cfb 100644 --- a/relayer-rest/tests/mock.rs +++ b/relayer-rest/tests/mock.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use ibc::ics24_host::identifier::ChainId; use ibc_relayer::{ @@ -11,11 +11,19 @@ use ibc_relayer::{ use ibc_relayer_rest::{server::spawn, Config}; -pub enum TestResult { +enum TestResult { Success, WrongRequest(Request), } +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "status", content = "result")] +#[serde(rename_all = "lowercase")] +enum JsonResult { + Success(R), + Error(E), +} + fn run_test(port: u16, path: &str, expected: R, handler: F) where R: Serialize, @@ -60,10 +68,9 @@ fn version() { let result = vec![version.clone(), rest_api_version]; - run_test(19101, "/", result, |req| match req { + run_test(19101, "/version", result, |req| match req { Request::Version { reply_to } => { reply_to.send(Ok(version)).unwrap(); - TestResult::Success } req => TestResult::WrongRequest(req), @@ -73,9 +80,9 @@ fn version() { #[test] fn get_chains() { let chain_id = ChainId::from_str("mock-0").unwrap(); - let result: Result<_, ()> = Ok(vec![chain_id.clone()]); + let result: JsonResult<_, ()> = JsonResult::Success(vec![chain_id.clone()]); - run_test(19102, "/chain", result, |req| match req { + run_test(19102, "/chains", result, |req| match req { Request::GetChains { reply_to } => { reply_to.send(Ok(vec![chain_id])).unwrap(); TestResult::Success @@ -106,7 +113,7 @@ trust_threshold = { numerator = '1', denominator = '3' } #[test] fn get_chain() { let config: ChainConfig = toml::de::from_str(MOCK_CHAIN_CONFIG).unwrap(); - let result: Result<_, ()> = Ok(config.clone()); + let result: JsonResult<_, ()> = JsonResult::Success(config.clone()); run_test(19103, "/chain/mock-0", result, |req| match req { Request::GetChain { chain_id, reply_to } if chain_id.to_string().as_str() == "mock-0" => { @@ -120,7 +127,7 @@ fn get_chain() { #[test] fn state() { let state = SupervisorState::new(vec!["mock-0".parse().unwrap()], std::iter::empty()); - let result: Result<_, ()> = Ok(state.clone()); + let result: JsonResult<_, ()> = JsonResult::Success(state.clone()); run_test(19104, "/state", result, |req| match req { Request::State { reply_to } => { From d64cdc5b58cf2ff1c2210bd896dd0684c8a3a080 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 23 Aug 2021 21:51:36 +0200 Subject: [PATCH 15/16] Release changelog for 0.7.0 --- .../bug-fixes/1261-gm-req-detect.md | 0 .../bug-fixes/1285-fix-typeok-bug.md | 0 .../ibc/1257-set-capability-index.md | 0 .../features/1065-keys-delete.md | 0 .../features/1175-update-ci.md | 0 .../features/1287-upgrade-legacy.md | 0 .../features/843-rest-api.md | 0 .../901-conditionally-spawn-worker.md | 0 .../948-upgrade-to-cosmos-sdk-v0.43.md | 0 .../1132-query-channels-filter.md | 0 .../improvements/1191-ica-compat.md | 0 .../improvements/1249-update-modelator.md | 0 .../1265-async-tx-confirmation.md | 0 .../ibc/1297-impl-consensus-state.md | 0 .changelog/v0.7.0/summary.md | 3 + CHANGELOG.md | 64 ++++++++++++++++++- 16 files changed, 66 insertions(+), 1 deletion(-) rename .changelog/{unreleased => v0.7.0}/bug-fixes/1261-gm-req-detect.md (100%) rename .changelog/{unreleased => v0.7.0}/bug-fixes/1285-fix-typeok-bug.md (100%) rename .changelog/{unreleased => v0.7.0}/bug-fixes/ibc/1257-set-capability-index.md (100%) rename .changelog/{unreleased => v0.7.0}/features/1065-keys-delete.md (100%) rename .changelog/{unreleased => v0.7.0}/features/1175-update-ci.md (100%) rename .changelog/{unreleased => v0.7.0}/features/1287-upgrade-legacy.md (100%) rename .changelog/{unreleased => v0.7.0}/features/843-rest-api.md (100%) rename .changelog/{unreleased => v0.7.0}/features/901-conditionally-spawn-worker.md (100%) rename .changelog/{unreleased => v0.7.0}/features/948-upgrade-to-cosmos-sdk-v0.43.md (100%) rename .changelog/{unreleased => v0.7.0}/improvements/1132-query-channels-filter.md (100%) rename .changelog/{unreleased => v0.7.0}/improvements/1191-ica-compat.md (100%) rename .changelog/{unreleased => v0.7.0}/improvements/1249-update-modelator.md (100%) rename .changelog/{unreleased => v0.7.0}/improvements/1265-async-tx-confirmation.md (100%) rename .changelog/{unreleased => v0.7.0}/improvements/ibc/1297-impl-consensus-state.md (100%) create mode 100644 .changelog/v0.7.0/summary.md diff --git a/.changelog/unreleased/bug-fixes/1261-gm-req-detect.md b/.changelog/v0.7.0/bug-fixes/1261-gm-req-detect.md similarity index 100% rename from .changelog/unreleased/bug-fixes/1261-gm-req-detect.md rename to .changelog/v0.7.0/bug-fixes/1261-gm-req-detect.md diff --git a/.changelog/unreleased/bug-fixes/1285-fix-typeok-bug.md b/.changelog/v0.7.0/bug-fixes/1285-fix-typeok-bug.md similarity index 100% rename from .changelog/unreleased/bug-fixes/1285-fix-typeok-bug.md rename to .changelog/v0.7.0/bug-fixes/1285-fix-typeok-bug.md diff --git a/.changelog/unreleased/bug-fixes/ibc/1257-set-capability-index.md b/.changelog/v0.7.0/bug-fixes/ibc/1257-set-capability-index.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc/1257-set-capability-index.md rename to .changelog/v0.7.0/bug-fixes/ibc/1257-set-capability-index.md diff --git a/.changelog/unreleased/features/1065-keys-delete.md b/.changelog/v0.7.0/features/1065-keys-delete.md similarity index 100% rename from .changelog/unreleased/features/1065-keys-delete.md rename to .changelog/v0.7.0/features/1065-keys-delete.md diff --git a/.changelog/unreleased/features/1175-update-ci.md b/.changelog/v0.7.0/features/1175-update-ci.md similarity index 100% rename from .changelog/unreleased/features/1175-update-ci.md rename to .changelog/v0.7.0/features/1175-update-ci.md diff --git a/.changelog/unreleased/features/1287-upgrade-legacy.md b/.changelog/v0.7.0/features/1287-upgrade-legacy.md similarity index 100% rename from .changelog/unreleased/features/1287-upgrade-legacy.md rename to .changelog/v0.7.0/features/1287-upgrade-legacy.md diff --git a/.changelog/unreleased/features/843-rest-api.md b/.changelog/v0.7.0/features/843-rest-api.md similarity index 100% rename from .changelog/unreleased/features/843-rest-api.md rename to .changelog/v0.7.0/features/843-rest-api.md diff --git a/.changelog/unreleased/features/901-conditionally-spawn-worker.md b/.changelog/v0.7.0/features/901-conditionally-spawn-worker.md similarity index 100% rename from .changelog/unreleased/features/901-conditionally-spawn-worker.md rename to .changelog/v0.7.0/features/901-conditionally-spawn-worker.md diff --git a/.changelog/unreleased/features/948-upgrade-to-cosmos-sdk-v0.43.md b/.changelog/v0.7.0/features/948-upgrade-to-cosmos-sdk-v0.43.md similarity index 100% rename from .changelog/unreleased/features/948-upgrade-to-cosmos-sdk-v0.43.md rename to .changelog/v0.7.0/features/948-upgrade-to-cosmos-sdk-v0.43.md diff --git a/.changelog/unreleased/improvements/1132-query-channels-filter.md b/.changelog/v0.7.0/improvements/1132-query-channels-filter.md similarity index 100% rename from .changelog/unreleased/improvements/1132-query-channels-filter.md rename to .changelog/v0.7.0/improvements/1132-query-channels-filter.md diff --git a/.changelog/unreleased/improvements/1191-ica-compat.md b/.changelog/v0.7.0/improvements/1191-ica-compat.md similarity index 100% rename from .changelog/unreleased/improvements/1191-ica-compat.md rename to .changelog/v0.7.0/improvements/1191-ica-compat.md diff --git a/.changelog/unreleased/improvements/1249-update-modelator.md b/.changelog/v0.7.0/improvements/1249-update-modelator.md similarity index 100% rename from .changelog/unreleased/improvements/1249-update-modelator.md rename to .changelog/v0.7.0/improvements/1249-update-modelator.md diff --git a/.changelog/unreleased/improvements/1265-async-tx-confirmation.md b/.changelog/v0.7.0/improvements/1265-async-tx-confirmation.md similarity index 100% rename from .changelog/unreleased/improvements/1265-async-tx-confirmation.md rename to .changelog/v0.7.0/improvements/1265-async-tx-confirmation.md diff --git a/.changelog/unreleased/improvements/ibc/1297-impl-consensus-state.md b/.changelog/v0.7.0/improvements/ibc/1297-impl-consensus-state.md similarity index 100% rename from .changelog/unreleased/improvements/ibc/1297-impl-consensus-state.md rename to .changelog/v0.7.0/improvements/ibc/1297-impl-consensus-state.md diff --git a/.changelog/v0.7.0/summary.md b/.changelog/v0.7.0/summary.md new file mode 100644 index 0000000000..e098cdbc39 --- /dev/null +++ b/.changelog/v0.7.0/summary.md @@ -0,0 +1,3 @@ +This release of Hermes is the first to be compatible with the development version of Cosmos SDK 0.43. +Hermes 0.7.0 also improves the performance and reliability of the relayer, notably by waiting asynchronously for transactions to be confirmed. +Additionnally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. diff --git a/CHANGELOG.md b/CHANGELOG.md index e617a86051..d944aa3b95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,68 @@ # CHANGELOG +## v0.7.0 + +This release of Hermes is the first to be compatible with the development version of Cosmos SDK 0.43. +Hermes 0.7.0 also improves the performance and reliability of the relayer, notably by waiting asynchronously for transactions to be confirmed. +Additionnally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. + +### BUG FIXES + +- General + - [gm] Fix silent exit when requirements are missing + + [#1261]: https://github.com/informalsystems/ibc-rs/issues/1261 + - Fix small typo in IBC.tla specification + + [#1285]: https://github.com/informalsystems/ibc-rs/pull/1285 +- [ibc](modules) + - Set the index of `ibc::ics05_port::capabilities::Capability` ([#1257]) + + [#1257]: https://github.com/informalsystems/ibc-rs/issues/1257 + +### FEATURES + +- Expose the Hermes config and internal state over a REST API ([#843]) + +[#843]: https://github.com/informalsystems/ibc-rs/issues/843 +- Spawn packet workers only when there are outstanding packets or acknowledgements to relay ([#901]) + +[#901]: https://github.com/informalsystems/ibc-rs/issues/901 +- Upgrade to Cosmos SDK proto (v0.43.0) & ibc-go proto (v1.0.0) ([#948]) + +- [#948]: https://github.com/informalsystems/ibc-rs/pull/948 +- Added `keys delete` CLI command ([#1065]) + +[#1065]: https://github.com/informalsystems/ibc-rs/issues/1065 +- Update CI to test with gaiad v5.0.5 ([#1175]) + + +[#1175]: https://github.com/informalsystems/ibc-rs/issues/1175 +- Add `--legacy | -l` flag to support upgrades for chains built with Cosmos SDK < v0.43.0 ([#1287]) + +[#1287]: https://github.com/informalsystems/ibc-rs/issues/1287 + +### IMPROVEMENTS + +- General + - Add optional destination chain and `--verbose` options for `query channels` CLI ([#1132]) + + [#1132]: https://github.com/informalsystems/ibc-rs/issues/1132 + - Improve support for Interchain Accounts (ICS 027) ([#1191]) + + [#1191]: https://github.com/informalsystems/ibc-rs/issues/1191 + - Update Modelator to 0.2.0 ([#1249]) + + [#1249]: https://github.com/informalsystems/ibc-rs/pull/1249 + - Improve performance and reliability of the relayer by asynchronously waiting for tx confirmations ([#1124], [#1265]) + + [#1124]: https://github.com/informalsystems/ibc-rs/issues/1124 + [#1265]: https://github.com/informalsystems/ibc-rs/issues/1265 +- [ibc](modules) + - Implement `ics02_client::client_consensus::ConsensusState` for `AnyConsensusState` ([#1297]) + + [#1297]: https://github.com/informalsystems/ibc-rs/issues/1297 + ## v0.6.2 This minor release of Hermes re-enables the `upgrade client`, `upgrade clients`, @@ -36,7 +99,6 @@ handle errors ([#1158]) [#1245]: https://github.com/informalsystems/ibc-rs/issues/1245 - ## v0.6.1 *July 22nd, 2021* From b0d5075ba2e2e8cd86a1d61dd1bc2c8a4efe70b9 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 23 Aug 2021 21:56:46 +0200 Subject: [PATCH 16/16] Reformat the changelog --- CHANGELOG.md | 65 +++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d944aa3b95..582a9a3e90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,60 +8,57 @@ Additionnally, Hermes now includes a REST server which exposes the relayer's int ### BUG FIXES -- General - - [gm] Fix silent exit when requirements are missing - - [#1261]: https://github.com/informalsystems/ibc-rs/issues/1261 - - Fix small typo in IBC.tla specification - - [#1285]: https://github.com/informalsystems/ibc-rs/pull/1285 - [ibc](modules) - Set the index of `ibc::ics05_port::capabilities::Capability` ([#1257]) - - [#1257]: https://github.com/informalsystems/ibc-rs/issues/1257 -### FEATURES +- [gm](scripts/gm) + - Fix silent exit when requirements are missing -- Expose the Hermes config and internal state over a REST API ([#843]) +[#1257]: https://github.com/informalsystems/ibc-rs/issues/1257 +[#1261]: https://github.com/informalsystems/ibc-rs/issues/1261 -[#843]: https://github.com/informalsystems/ibc-rs/issues/843 -- Spawn packet workers only when there are outstanding packets or acknowledgements to relay ([#901]) - -[#901]: https://github.com/informalsystems/ibc-rs/issues/901 -- Upgrade to Cosmos SDK proto (v0.43.0) & ibc-go proto (v1.0.0) ([#948]) +### FEATURES -- [#948]: https://github.com/informalsystems/ibc-rs/pull/948 -- Added `keys delete` CLI command ([#1065]) +- General + - Update CI to test with gaiad v5.0.5 ([#1175]) -[#1065]: https://github.com/informalsystems/ibc-rs/issues/1065 -- Update CI to test with gaiad v5.0.5 ([#1175]) +- [ibc-relayer-cli](relayer-cli) + - Add `keys delete` CLI command ([#1065]) + - Add `--legacy | -l` flag to support upgrades for chains built with Cosmos SDK < v0.43.0 ([#1287]) +- [ibc-relayer](relayer) + - Expose the Hermes config and internal state over a REST API ([#843]) + - Spawn packet workers only when there are outstanding packets or acknowledgements to relay ([#901]) + - Upgrade to Cosmos SDK proto (v0.43.0) & ibc-go proto (v1.0.0) ([#948]) +[#843]: https://github.com/informalsystems/ibc-rs/issues/843 +[#901]: https://github.com/informalsystems/ibc-rs/issues/901 +[#948]: https://github.com/informalsystems/ibc-rs/pull/948 +[#1065]: https://github.com/informalsystems/ibc-rs/issues/1065 [#1175]: https://github.com/informalsystems/ibc-rs/issues/1175 -- Add `--legacy | -l` flag to support upgrades for chains built with Cosmos SDK < v0.43.0 ([#1287]) - [#1287]: https://github.com/informalsystems/ibc-rs/issues/1287 ### IMPROVEMENTS - General + - Update Modelator to 0.2.0 ([#1249]) + +- [ibc-relayer-cli](relayer-cli) - Add optional destination chain and `--verbose` options for `query channels` CLI ([#1132]) - - [#1132]: https://github.com/informalsystems/ibc-rs/issues/1132 + +- [ibc-relayer](relayer) - Improve support for Interchain Accounts (ICS 027) ([#1191]) - - [#1191]: https://github.com/informalsystems/ibc-rs/issues/1191 - - Update Modelator to 0.2.0 ([#1249]) - - [#1249]: https://github.com/informalsystems/ibc-rs/pull/1249 - Improve performance and reliability of the relayer by asynchronously waiting for tx confirmations ([#1124], [#1265]) - - [#1124]: https://github.com/informalsystems/ibc-rs/issues/1124 - [#1265]: https://github.com/informalsystems/ibc-rs/issues/1265 + - [ibc](modules) - Implement `ics02_client::client_consensus::ConsensusState` for `AnyConsensusState` ([#1297]) - - [#1297]: https://github.com/informalsystems/ibc-rs/issues/1297 + +[#1124]: https://github.com/informalsystems/ibc-rs/issues/1124 +[#1132]: https://github.com/informalsystems/ibc-rs/issues/1132 +[#1191]: https://github.com/informalsystems/ibc-rs/issues/1191 +[#1249]: https://github.com/informalsystems/ibc-rs/pull/1249 +[#1265]: https://github.com/informalsystems/ibc-rs/issues/1265 +[#1297]: https://github.com/informalsystems/ibc-rs/issues/1297 ## v0.6.2