diff --git a/CHANGELOG.md b/CHANGELOG.md index 840c740d4b..93218c0d16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ Special thanks to external contributors for this release: @CharlyCst ([#347]). ### FEATURES -- Update to tendermint-rs version `0.17-RC2` ([#368]) +- Update Tokio to version 0.3 ([#402]) +- Update to tendermint-rs version `0.17-RC3` ([#403]) - [changelog] Added "unreleased" section in `CHANGELOG.MD` to help streamline releases ([#274]) - [relayer] Integrate relayer spike into relayer crate ([#335]) - [modules] @@ -45,6 +46,8 @@ Special thanks to external contributors for this release: @CharlyCst ([#347]). [#373]: https://github.com/informalsystems/ibc-rs/issues/373 [#374]: https://github.com/informalsystems/ibc-rs/issues/374 [#389]: https://github.com/informalsystems/ibc-rs/issues/389 +[#402]: https://github.com/informalsystems/ibc-rs/issues/402 +[#403]: https://github.com/informalsystems/ibc-rs/issues/403 [proto-compiler]: https://github.com/informalsystems/ibc-rs/tree/master/proto-compiler ### IMPROVEMENTS diff --git a/modules/Cargo.toml b/modules/Cargo.toml index 5aeee146a5..9efae2ed78 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -55,6 +55,6 @@ version = "0.17.0-rc2" optional = true [dev-dependencies] -tokio = { version = "0.2", features = ["macros"] } +tokio = { version = "0.3", features = ["macros"] } subtle-encoding = { version = "0.5" } tendermint-testgen = { version = "0.17.0-rc2" } # Needed for generating (synthetic) light blocks. diff --git a/relayer-cli/Cargo.toml b/relayer-cli/Cargo.toml index 72abc0b171..c12179171c 100644 --- a/relayer-cli/Cargo.toml +++ b/relayer-cli/Cargo.toml @@ -9,12 +9,11 @@ authors = [ [dependencies] relayer = { path = "../relayer" } ibc = { path = "../modules" } -abscissa_tokio = "0.5.1" anomaly = "0.2.0" gumdrop = "0.7" serde = { version = "1", features = ["serde_derive"] } thiserror = "1" -tokio = { version = "0.2.13", features = ["rt-util", "sync"] } +tokio = { version = "0.3", features = ["rt", "rt-multi-thread", "time", "stream", "sync"] } tracing = "0.1.13" tracing-subscriber = "0.2.3" futures = "0.3.5" diff --git a/relayer-cli/src/application.rs b/relayer-cli/src/application.rs index 9d7ff6ac43..25cbc278e8 100644 --- a/relayer-cli/src/application.rs +++ b/relayer-cli/src/application.rs @@ -82,11 +82,7 @@ impl Application for CliApp { /// beyond the default ones provided by the framework, this is the place /// to do so. fn register_components(&mut self, command: &Self::Cmd) -> Result<(), FrameworkError> { - use abscissa_tokio::TokioComponent; - - let mut components = self.framework_components(command)?; - components.push(Box::new(TokioComponent::new()?)); - + let components = self.framework_components(command)?; self.state.components.register(components) } diff --git a/relayer-cli/src/commands/listen.rs b/relayer-cli/src/commands/listen.rs index e9b668e987..857daf630c 100644 --- a/relayer-cli/src/commands/listen.rs +++ b/relayer-cli/src/commands/listen.rs @@ -4,7 +4,7 @@ use abscissa_core::{ application::fatal_error, error::BoxError, tracing::debug, Command, Options, Runnable, }; -use crate::{application::APPLICATION, prelude::*, tasks::event_listener}; +use crate::{prelude::*, tasks::event_listener}; #[derive(Command, Debug, Options)] pub struct ListenCmd {} @@ -20,11 +20,12 @@ impl ListenCmd { impl Runnable for ListenCmd { fn run(&self) { - abscissa_tokio::run(&APPLICATION, async move { + let rt = tokio::runtime::Runtime::new().unwrap(); + + rt.block_on(async move { self.cmd() .await .unwrap_or_else(|e| fatal_error(app_reader().deref(), &*e)); - }) - .unwrap(); + }); } } diff --git a/relayer-cli/src/commands/start.rs b/relayer-cli/src/commands/start.rs index 2d65f50bc4..75f2417998 100644 --- a/relayer-cli/src/commands/start.rs +++ b/relayer-cli/src/commands/start.rs @@ -6,7 +6,7 @@ use abscissa_core::{ use relayer::{chain::CosmosSDKChain, config::Config}; -use crate::{application::APPLICATION, prelude::*, tasks}; +use crate::{prelude::*, tasks}; #[derive(Command, Debug, Options)] pub struct StartCmd { @@ -23,12 +23,13 @@ impl StartCmd { impl Runnable for StartCmd { fn run(&self) { - abscissa_tokio::run(&APPLICATION, async move { + let rt = tokio::runtime::Runtime::new().unwrap(); + + rt.block_on(async move { self.cmd() .await .unwrap_or_else(|e| fatal_error(app_reader().deref(), &*e)); - }) - .unwrap(); + }); } } diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index b060c44432..a104ce7d74 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -19,7 +19,7 @@ sled = { version = "0.34.4", features = ["no_metrics", "no_logs"] } thiserror = "1.0.11" toml = "0.5" tracing = "0.1.13" -tokio = "0.2" +tokio = { version = "0.3", features = ["macros"] } serde_json = { version = "1" } bytes = "0.6.0" prost = "0.6.1" diff --git a/relayer/src/util/block_on.rs b/relayer/src/util/block_on.rs index aed8c9f98e..93459ece34 100644 --- a/relayer/src/util/block_on.rs +++ b/relayer/src/util/block_on.rs @@ -4,8 +4,7 @@ use futures::Future; /// Spawns a new tokio runtime and use it to block on the given future. pub fn block_on(future: F) -> F::Output { - tokio::runtime::Builder::new() - .basic_scheduler() + tokio::runtime::Builder::new_current_thread() .enable_all() .build() .unwrap()