From 71d23f44c24fc36b9ec5c365c5efa14ca402408e Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Tue, 7 Jan 2020 12:37:40 +0000 Subject: [PATCH 1/4] Clap using cargo.toml version --- client/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main.rs b/client/src/main.rs index 6d73a64713..70075c8eb3 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -10,7 +10,7 @@ mod utils; fn main() { let arg_matches = App::new("Nym Client") - .version("0.1.0") + .version(built_info::PKG_VERSION) .author("Nymtech") .about("Implementation of the Nym Client") .subcommand( From bfad7d10874d8457369e98442494e45941f7234f Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Tue, 7 Jan 2020 12:38:11 +0000 Subject: [PATCH 2/4] Temporarily increased recursion limit --- client/src/lib.rs | 2 ++ client/src/main.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/client/src/lib.rs b/client/src/lib.rs index 5f1dc2a7c5..519c8b5bcb 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,3 +1,5 @@ +#![recursion_limit = "256"] + pub mod clients; pub mod identity; pub mod persistence; diff --git a/client/src/main.rs b/client/src/main.rs index 70075c8eb3..ad038e45b5 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1,3 +1,5 @@ +#![recursion_limit = "256"] + use clap::{App, Arg, ArgMatches, SubCommand}; use std::process; From cf62a7ba12e0fa0f9bfcff2aed545b8a4747ad1b Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Tue, 7 Jan 2020 12:39:18 +0000 Subject: [PATCH 3/4] Killing application on possible yet undetected bug + minor improvements in select! macro loop --- client/src/clients/mod.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/client/src/clients/mod.rs b/client/src/clients/mod.rs index d2da563ec0..df67c001ff 100644 --- a/client/src/clients/mod.rs +++ b/client/src/clients/mod.rs @@ -177,22 +177,30 @@ impl NymClient { ) { loop { println!("[OUT QUEUE] here I will be sending real traffic (or loop cover if nothing is available)"); - select! { + // TODO: consider replacing select macro with our own proper future definition with polling + let traffic_message = select! { real_message = input_rx.next() => { println!("[OUT QUEUE] - we got a real message!"); - let real_message = real_message.expect("The channel must have closed! - if the client hasn't crashed, it should have!"); + if real_message.is_none() { + eprintln!("Unexpected 'None' real message!"); + std::process::exit(1); + } + let real_message = real_message.unwrap(); println!("real: {:?}", real_message); - let encapsulated_message = utils::sphinx::encapsulate_message(real_message.0, real_message.1, &topology); - mix_tx.send(MixMessage(encapsulated_message.0, encapsulated_message.1)).await.unwrap(); + utils::sphinx::encapsulate_message(real_message.0, real_message.1, &topology) }, default => { println!("[OUT QUEUE] - no real message - going to send extra loop cover"); - let cover_message = utils::sphinx::loop_cover_message(our_info.address, our_info.identifier, &topology); - mix_tx.send(MixMessage(cover_message.0, cover_message.1)).await.unwrap(); + utils::sphinx::loop_cover_message(our_info.address, our_info.identifier, &topology) } }; + mix_tx + .send(MixMessage(traffic_message.0, traffic_message.1)) + .await + .unwrap(); + let delay_duration = Duration::from_secs_f64(MESSAGE_SENDING_AVERAGE_DELAY); tokio::time::delay_for(delay_duration).await; } From df23148ccf4d292a63b10c028bcad8aa92276a41 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Tue, 7 Jan 2020 12:39:51 +0000 Subject: [PATCH 4/4] Changes in cargo.lock files --- client/Cargo.lock | 1 - sfw-provider/sfw-provider-requests/Cargo.lock | 1 - 2 files changed, 2 deletions(-) diff --git a/client/Cargo.lock b/client/Cargo.lock index 843b1a0f44..73aaad3b78 100644 --- a/client/Cargo.lock +++ b/client/Cargo.lock @@ -1698,7 +1698,6 @@ dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chacha 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/sfw-provider/sfw-provider-requests/Cargo.lock b/sfw-provider/sfw-provider-requests/Cargo.lock index de92d696c4..a6ad35debe 100644 --- a/sfw-provider/sfw-provider-requests/Cargo.lock +++ b/sfw-provider/sfw-provider-requests/Cargo.lock @@ -351,7 +351,6 @@ dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chacha 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",