diff --git a/Cargo.lock b/Cargo.lock index 26e5c5b3f9..108ec33301 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2149,7 +2149,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.1", + "tokio-util 0.7.3", "tracing", ] @@ -2879,7 +2879,7 @@ dependencies = [ "log", "nymsphinx", "tokio", - "tokio-util 0.6.9", + "tokio-util 0.7.3", ] [[package]] @@ -2920,7 +2920,7 @@ dependencies = [ "rand 0.8.5", "serde", "tokio", - "tokio-util 0.6.9", + "tokio-util 0.7.3", "url", "validator-client", "version-checker", @@ -3010,7 +3010,7 @@ version = "0.1.0" dependencies = [ "tokio", "tokio-stream", - "tokio-util 0.6.9", + "tokio-util 0.7.3", ] [[package]] @@ -3145,7 +3145,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-tungstenite", - "tokio-util 0.6.9", + "tokio-util 0.7.3", "url", "validator-client", "vergen", @@ -3182,7 +3182,7 @@ dependencies = [ "serde", "serial_test", "tokio", - "tokio-util 0.6.9", + "tokio-util 0.7.3", "toml", "topology", "url", @@ -3430,7 +3430,7 @@ dependencies = [ "bytes", "nymsphinx-params", "nymsphinx-types", - "tokio-util 0.6.9", + "tokio-util 0.7.3", ] [[package]] @@ -4055,7 +4055,7 @@ dependencies = [ "socks5-requests", "tokio", "tokio-test", - "tokio-util 0.6.9", + "tokio-util 0.7.3", ] [[package]] @@ -5761,9 +5761,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.17.0" +version = "1.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "95eec79ea28c00a365f539f1961e9278fbcaf81c0ff6aaf0e93c181352446948" dependencies = [ "bytes", "libc", @@ -5824,9 +5824,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" dependencies = [ "futures-core", "pin-project-lite", @@ -5871,20 +5871,20 @@ dependencies = [ "futures-sink", "log", "pin-project-lite", - "slab", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", + "slab", "tokio", "tracing", ] @@ -5969,7 +5969,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.1", + "tokio-util 0.7.3", "tower-layer", "tower-service", "tracing", diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index 30f88d4c5e..ddd6d14ef9 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -14,7 +14,7 @@ log = "0.4" rand = { version = "0.7.3", features = ["wasm-bindgen"] } serde = { version = "1.0", features = ["derive"] } sled = "0.34" -tokio = { version = "1.4", features = ["macros"] } +tokio = { version = "1.19.1", features = ["macros"] } url = { version ="2.2", features = ["serde"] } # internal diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs index d619cf3f35..f8417b0285 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs @@ -6,7 +6,7 @@ use crate::client::real_messages_control::acknowledgement_control::Retransmissio use futures::channel::mpsc::{self, UnboundedReceiver, UnboundedSender}; use futures::StreamExt; use log::*; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey, TimerError}; +use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey}; use nymsphinx::chunking::fragment::FragmentIdentifier; use nymsphinx::Delay as SphinxDelay; use std::collections::HashMap; @@ -209,16 +209,11 @@ impl ActionController { } // note: when the entry expires it's automatically removed from pending_acks_timers - fn handle_expired_ack_timer( - &mut self, - expired_ack: Result, TimerError>, - ) { + fn handle_expired_ack_timer(&mut self, expired_ack: Expired) { // I'm honestly not sure how to handle it, because getting it means other things in our // system are already misbehaving. If we ever see this panic, then I guess we should worry // about it. Perhaps just reschedule it at later point? - let frag_id = expired_ack - .expect("Tokio timer returned an error!") - .into_inner(); + let frag_id = expired_ack.into_inner(); trace!("{} has expired", frag_id); diff --git a/clients/credential/Cargo.toml b/clients/credential/Cargo.toml index 54fdb0ee21..5d2d4d8142 100644 --- a/clients/credential/Cargo.toml +++ b/clients/credential/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.7.3" serde = { version = "1.0", features = ["derive"] } thiserror = "1.0" url = "2.2" -tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal", "macros"] } # async runtime +tokio = { version = "1.19.1", features = ["rt-multi-thread", "net", "signal", "macros"] } # async runtime coconut-interface = { path = "../../common/coconut-interface" } credentials = { path = "../../common/credentials" } diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index 5c4d0dd6e1..661af318c9 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -27,7 +27,7 @@ pretty_env_logger = "0.4" # for formatting log messages rand = { version = "0.7.3", features = ["wasm-bindgen"] } # rng-related traits + some rng implementation to use serde = { version = "1.0.104", features = ["derive"] } # for config serialization/deserialization sled = "0.34" # for storage of replySURB decryption keys -tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] } # async runtime +tokio = { version = "1.19.1", features = ["rt-multi-thread", "net", "signal"] } # async runtime tokio-tungstenite = "0.14" # websocket ## internal diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index b5316cc6cd..1ac917a7cf 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -20,7 +20,7 @@ pretty_env_logger = "0.4" rand = { version = "0.7.3", features = ["wasm-bindgen"] } serde = { version = "1.0", features = ["derive"] } # for config serialization/deserialization snafu = "0.6" -tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] } +tokio = { version = "1.19.1", features = ["rt-multi-thread", "net", "signal"] } url = "2.2" # internal diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index 004619e4d3..8e22cd012e 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -35,7 +35,7 @@ default-features = false # non-wasm-only dependencies [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio] -version = "1.4" +version = "1.19.1" features = ["macros", "rt", "net", "sync", "time"] [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-tungstenite] diff --git a/common/client-libs/mixnet-client/Cargo.toml b/common/client-libs/mixnet-client/Cargo.toml index 2585440542..c99ddabbbb 100644 --- a/common/client-libs/mixnet-client/Cargo.toml +++ b/common/client-libs/mixnet-client/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" [dependencies] futures = "0.3" log = "0.4.8" -tokio = { version = "1.4", features = ["time", "net", "rt"] } -tokio-util = { version = "0.6", features = ["codec"] } +tokio = { version = "1.19.1", features = ["time", "net", "rt"] } +tokio-util = { version = "0.7.3", features = ["codec"] } # internal nymsphinx = {path = "../../nymsphinx" } diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 6c9fa9faf5..e69699d36b 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -22,7 +22,7 @@ reqwest = { version = "0.11", features = ["json"] } thiserror = "1" log = "0.4" url = { version = "2.2", features = ["serde"] } -tokio = { version = "1.10", features = ["sync", "time"] } +tokio = { version = "1.19.1", features = ["sync", "time"] } futures = "0.3" coconut-interface = { path = "../../coconut-interface" } diff --git a/common/credential-storage/Cargo.toml b/common/credential-storage/Cargo.toml index fe05fb4bd3..70d18c4716 100644 --- a/common/credential-storage/Cargo.toml +++ b/common/credential-storage/Cargo.toml @@ -12,9 +12,9 @@ nymcoconut = { path = "../nymcoconut" } log = "0.4" sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"]} thiserror = "1.0" -tokio = { version = "1.4", features = [ "rt-multi-thread", "net", "signal", "fs" ] } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "net", "signal", "fs" ] } [build-dependencies] sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } -tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] } \ No newline at end of file +tokio = { version = "1.19.1", features = ["rt-multi-thread", "macros"] } \ No newline at end of file diff --git a/common/mixnode-common/Cargo.toml b/common/mixnode-common/Cargo.toml index f5b70e1612..77c25d0455 100644 --- a/common/mixnode-common/Cargo.toml +++ b/common/mixnode-common/Cargo.toml @@ -14,8 +14,8 @@ humantime-serde = "1.0" log = "0.4" rand = "0.8" serde = { version = "1.0", features = ["derive"] } -tokio = { version = "1.4", features = ["time", "macros", "rt", "net", "io-util"] } -tokio-util = { version = "0.6", features = ["codec"] } +tokio = { version = "1.19.1", features = ["time", "macros", "rt", "net", "io-util"] } +tokio-util = { version = "0.7.3", features = ["codec"] } url = "2.2" crypto = { path = "../crypto" } diff --git a/common/nonexhaustive-delayqueue/Cargo.toml b/common/nonexhaustive-delayqueue/Cargo.toml index ea64ddf6c6..778342e578 100644 --- a/common/nonexhaustive-delayqueue/Cargo.toml +++ b/common/nonexhaustive-delayqueue/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tokio = { version = "1.4", features = [] } -tokio-stream = "0.1" # this one seems to be a thing until `Stream` trait is stabilised in stdlib -tokio-util = { version = "0.6", features = ["time"] } +tokio = { version = "1.19.1", features = [] } +tokio-stream = "0.1.9" # this one seems to be a thing until `Stream` trait is stabilised in stdlib +tokio-util = { version = "0.7.3", features = ["time"] } diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index 460fd11390..b697700ec1 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -33,5 +33,5 @@ mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" path = "framing" [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio] -version = "1.4" +version = "1.19.1" features = ["sync"] diff --git a/common/nymsphinx/framing/Cargo.toml b/common/nymsphinx/framing/Cargo.toml index 0cddb5bf22..6921a8cf69 100644 --- a/common/nymsphinx/framing/Cargo.toml +++ b/common/nymsphinx/framing/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] bytes = "1.0" -tokio-util = { version = "0.6", features = ["codec"] } +tokio-util = { version = "0.7.3", features = ["codec"] } nymsphinx-types = { path = "../types" } nymsphinx-params = { path = "../params" } diff --git a/common/socks5/proxy-helpers/Cargo.toml b/common/socks5/proxy-helpers/Cargo.toml index 77c9e4cf7e..71a4cebb23 100644 --- a/common/socks5/proxy-helpers/Cargo.toml +++ b/common/socks5/proxy-helpers/Cargo.toml @@ -8,8 +8,8 @@ edition = "2021" [dependencies] bytes = "1.0" -tokio = { version = "1.4", features = [ "net", "io-util", "sync", "macros", "time", "rt-multi-thread" ] } -tokio-util = { version = "0.6", features = [ "io" ] } # reason for getting this guy is to to able to port to tokio 1.X more quickly by being able to use +tokio = { version = "1.19.1", features = [ "net", "io-util", "sync", "macros", "time", "rt-multi-thread" ] } +tokio-util = { version = "0.7.3", features = [ "io" ] } # reason for getting this guy is to to able to port to tokio 1.X more quickly by being able to use # their `read_buf` [from the util crate] replacement rather than having to rethink/reimplement `AvailableReader` with the new AsyncRead trait definition. # In the long run, the dependency should probably get removed in favour of pure-tokio implementation, but for time being it's fine. futures = "0.3" @@ -18,4 +18,4 @@ socks5-requests = { path = "../requests" } ordered-buffer = { path = "../ordered-buffer" } [dev-dependencies] -tokio-test = "0.4" \ No newline at end of file +tokio-test = "0.4.2" \ No newline at end of file diff --git a/explorer-api/Cargo.toml b/explorer-api/Cargo.toml index a4787ecebc..58096adee4 100644 --- a/explorer-api/Cargo.toml +++ b/explorer-api/Cargo.toml @@ -21,7 +21,7 @@ schemars = { version = "0.8", features = ["preserve_order"] } serde = "1.0.126" serde_json = "1.0.66" thiserror = "1.0.29" -tokio = {version = "1.9.0", features = ["full"] } +tokio = {version = "1.19.1", features = ["full"] } mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } network-defaults = { path = "../common/network-defaults" } diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index e25a803d14..e3ab0f4722 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -31,10 +31,10 @@ serde = { version = "1.0.104", features = ["derive"] } sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } subtle-encoding = { version = "0.5", features = ["bech32-preview"]} thiserror = "1" -tokio = { version = "1.4", features = [ "rt-multi-thread", "net", "signal", "fs" ] } -tokio-stream = { version = "0.1", features = [ "fs" ] } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "net", "signal", "fs" ] } +tokio-stream = { version = "0.1.9", features = [ "fs" ] } tokio-tungstenite = "0.14" -tokio-util = { version = "0.6", features = [ "codec" ] } +tokio-util = { version = "0.7.3", features = [ "codec" ] } url = { version = "2.2", features = [ "serde" ] } web3 = "0.17.0" @@ -59,6 +59,6 @@ coconut = ["coconut-interface", "gateway-requests/coconut", "gateway-client/coco eth = [] [build-dependencies] -tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.19.1", features = ["rt-multi-thread", "macros"] } sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } vergen = { version = "5", default-features = false, features = ["build", "git", "rustc", "cargo"] } diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 9dac6d1953..e7157683a6 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -28,8 +28,8 @@ pretty_env_logger = "0.4.0" rand = "0.7.3" rocket = { version="0.5.0-rc.1", features = ["json"] } serde = { version="1.0", features = ["derive"] } -tokio = { version="1.8", features = ["rt-multi-thread", "net", "signal"] } -tokio-util = { version="0.6.7", features = ["codec"] } +tokio = { version="1.19.1", features = ["rt-multi-thread", "net", "signal"] } +tokio-util = { version="0.7.3", features = ["codec"] } toml = "0.5.8" url = { version = "2.2", features = ["serde"] } lazy_static = "1.4.0" @@ -49,7 +49,7 @@ version-checker = { path="../common/version-checker" } [dev-dependencies] serial_test = "0.5" -tokio = { version="1.8", features = ["rt-multi-thread", "net", "signal", "test-util"] } +tokio = { version="1.19.1", features = ["rt-multi-thread", "net", "signal", "test-util"] } nymsphinx-types = { path = "../common/nymsphinx/types" } nymsphinx-params = { path = "../common/nymsphinx/params" } diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index d2f1ced206..e0aece8fcb 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -4,7 +4,7 @@ use crate::node::node_statistics::UpdateSender; use futures::channel::mpsc; use futures::StreamExt; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, TimerError}; +use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; use nymsphinx::forwarding::packet::MixPacket; use std::io; use tokio::time::Instant; @@ -75,13 +75,8 @@ where } /// Upon packet being finished getting delayed, forward it to the mixnet. - fn handle_done_delaying(&mut self, packet: Option, TimerError>>) { - // those are critical errors that I don't think can be recovered from. - let delayed = packet.expect("the queue has unexpectedly terminated!"); - let delayed_packet = delayed - .expect("Encountered timer issue within the runtime!") - .into_inner(); - + fn handle_done_delaying(&mut self, packet: Expired) { + let delayed_packet = packet.into_inner(); self.forward_packet(delayed_packet) } @@ -105,7 +100,7 @@ where loop { tokio::select! { delayed = self.delay_queue.next() => { - self.handle_done_delaying(delayed); + self.handle_done_delaying(delayed.unwrap()); } new_packet = self.packet_receiver.next() => { // this one is impossible to ever panic - the object itself contains a sender diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 82f6e2d89b..03a23fe886 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -38,7 +38,7 @@ strum = { version = "0.23", features = ["derive"] } tauri = { version = "=1.0.0-rc.2", features = ["clipboard-all", "shell-open", "updater", "window-maximize"] } tendermint-rpc = "0.23.0" thiserror = "1.0" -tokio = { version = "1.10", features = ["sync", "time"] } +tokio = { version = "1.19.1", features = ["sync", "time"] } toml = "0.5.8" url = "2.2" diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index bd266ecd9a..ba83a25179 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -23,7 +23,7 @@ rocket = { version = "0.5.0-rc.1", features = ["json"], optional = true } serde = { version = "1.0", features = ["derive"] } sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate", "chrono"]} thiserror = "1" -tokio = { version = "1.4", features = [ "net", "rt-multi-thread", "macros", "time" ] } +tokio = { version = "1.19.1", features = [ "net", "rt-multi-thread", "macros", "time" ] } tokio-tungstenite = "0.14" @@ -40,7 +40,7 @@ rand = "0.7" [build-dependencies] sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } -tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.19.1", features = ["rt-multi-thread", "macros"] } [features] stats-service = ["rocket"] \ No newline at end of file diff --git a/validator-api/Cargo.toml b/validator-api/Cargo.toml index c33e43b55d..a75534348a 100644 --- a/validator-api/Cargo.toml +++ b/validator-api/Cargo.toml @@ -33,8 +33,8 @@ serde = "1.0" serde_json = "1.0" thiserror = "1" time = { version = "0.3", features = ["serde-human-readable", "parsing"]} -tokio = { version = "1.4", features = ["rt-multi-thread", "macros", "signal", "time"] } -tokio-stream = "0.1.8" +tokio = { version = "1.19.1", features = ["rt-multi-thread", "macros", "signal", "time"] } +tokio-stream = "0.1.9" url = "2.2" anyhow = "1" @@ -72,7 +72,7 @@ coconut = ["coconut-interface", "credentials", "gateway-client/coconut", "creden no-reward = [] [build-dependencies] -tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.19.1", features = ["rt-multi-thread", "macros"] } sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } vergen = { version = "5", default-features = false, features = ["build", "git", "rustc", "cargo"] }