Chore/dependency updates (#549)

* Updated all non-breaking dependencies

* Updated common/crypto dependencies

* Updated all tokio [and associated] dependencies to most recent version

* Bumped version of rand_distr

* Fixed api changes in tests

* Made clippy happier about the acronym

* Fixed the type while trying to make clippy even happier

* nightly cargo fmt
This commit is contained in:
Jędrzej Stuczyński
2021-03-29 15:32:34 +01:00
committed by GitHub
parent cc1b80229c
commit 596bc76cc6
76 changed files with 926 additions and 1383 deletions
@@ -5,6 +5,7 @@ use crate::node::listener::connection_handler::packet_processing::{
MixProcessingResult, PacketProcessor,
};
use crate::node::packet_delayforwarder::PacketDelayForwardSender;
use futures::StreamExt;
use log::*;
use nymsphinx::forwarding::packet::MixPacket;
use nymsphinx::framing::codec::SphinxCodec;
@@ -12,7 +13,6 @@ use nymsphinx::framing::packet::FramedSphinxPacket;
use nymsphinx::Delay as SphinxDelay;
use std::net::SocketAddr;
use tokio::net::TcpStream;
use tokio::stream::StreamExt;
use tokio::time::Instant;
use tokio_util::codec::Framed;
+1 -1
View File
@@ -19,7 +19,7 @@ impl Listener {
}
async fn run(&mut self, connection_handler: ConnectionHandler) {
let mut listener = TcpListener::bind(self.address)
let listener = TcpListener::bind(self.address)
.await
.expect("Failed to create TCP listener");
loop {
+2 -2
View File
@@ -138,11 +138,11 @@ impl MetricsSender {
{
Err(err) => {
error!("failed to send metrics - {:?}", err);
tokio::time::delay_for(METRICS_FAILURE_BACKOFF)
tokio::time::sleep(METRICS_FAILURE_BACKOFF)
}
Ok(new_interval) => {
debug!("sent metrics information");
tokio::time::delay_for(Duration::from_secs(new_interval.next_report_in))
tokio::time::sleep(Duration::from_secs(new_interval.next_report_in))
}
};
+1 -1
View File
@@ -123,7 +123,7 @@ impl MixNode {
pub fn run(&mut self) {
info!("Starting nym mixnode");
let mut runtime = Runtime::new().unwrap();
let runtime = Runtime::new().unwrap();
runtime.block_on(async {
if let Some(duplicate_node_key) = self.check_if_same_ip_node_exists().await {
+4 -4
View File
@@ -3,11 +3,11 @@
use crate::node::metrics::MetricsReporter;
use futures::channel::mpsc;
use futures::StreamExt;
use log::*;
use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue};
use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, TimerError};
use nymsphinx::forwarding::packet::MixPacket;
use tokio::stream::StreamExt;
use tokio::time::{Duration, Error as TimeError, Instant};
use tokio::time::{Duration, Instant};
// Delay + MixPacket vs Instant + MixPacket
@@ -71,7 +71,7 @@ impl DelayForwarder {
}
/// Upon packet being finished getting delayed, forward it to the mixnet.
fn handle_done_delaying(&mut self, packet: Option<Result<Expired<MixPacket>, TimeError>>) {
fn handle_done_delaying(&mut self, packet: Option<Result<Expired<MixPacket>, 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