Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/clients/multi-tcp-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl Client {
message: Vec<u8>,
wait_for_response: bool,
) -> io::Result<()> {
trace!("Sending packet to {:?}", address);
if !self.connections_managers.contains_key(&address) {
debug!(
"There is no existing connection to {:?} - it will be established now",
Expand Down
2 changes: 2 additions & 0 deletions mixnode/src/node/packet_forwarding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use futures::channel::mpsc;
use futures::StreamExt;
use log::*;
use std::net::SocketAddr;
use std::time::Duration;
use tokio::runtime::Handle;
Expand Down Expand Up @@ -50,6 +51,7 @@ impl PacketForwarder {
let sender_channel = self.conn_tx.clone();
handle.spawn(async move {
while let Some((address, packet)) = self.conn_rx.next().await {
trace!("Going to forward packet to {:?}", address);
// as a mix node we don't care about responses, we just want to fire packets
// as quickly as possible
self.tcp_client.send(address, packet, false).await.unwrap(); // if we're not waiting for response, we MUST get an Ok
Expand Down
12 changes: 6 additions & 6 deletions mixnode/src/node/presence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use crate::built_info;
use directory_client::presence::mixnodes::MixNodePresence;
use directory_client::requests::presence_mixnodes_post::PresenceMixNodesPoster;
use directory_client::DirectoryClient;
use log::{debug, error};
use log::{error, trace};
use std::time::Duration;
use tokio::runtime::Handle;
use tokio::task::JoinHandle;

pub struct NotifierConfig {
pub(crate) struct NotifierConfig {
location: String,
directory_server: String,
announce_host: String,
Expand All @@ -31,7 +31,7 @@ pub struct NotifierConfig {
}

impl NotifierConfig {
pub fn new(
pub(crate) fn new(
location: String,
directory_server: String,
announce_host: String,
Expand All @@ -50,14 +50,14 @@ impl NotifierConfig {
}
}

pub struct Notifier {
pub(crate) struct Notifier {
net_client: directory_client::Client,
presence: MixNodePresence,
sending_delay: Duration,
}

impl Notifier {
pub fn new(config: NotifierConfig) -> Notifier {
pub(crate) fn new(config: NotifierConfig) -> Notifier {
let directory_client_cfg = directory_client::Config {
base_url: config.directory_server,
};
Expand All @@ -80,7 +80,7 @@ impl Notifier {
fn notify(&self) {
match self.net_client.presence_mix_nodes_post.post(&self.presence) {
Err(err) => error!("failed to send presence - {:?}", err),
Ok(_) => debug!("sent presence information"),
Ok(_) => trace!("sent presence information"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion nym-client/src/client/topology_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ impl<T: 'static + NymTopology> TopologyRefresher<T> {
pub(crate) fn start(mut self, handle: &Handle) -> JoinHandle<()> {
handle.spawn(async move {
loop {
self.refresh().await;
tokio::time::delay_for(self.refresh_rate).await;
self.refresh().await;
}
})
}
Expand Down
12 changes: 6 additions & 6 deletions nym-client/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const DEFAULT_LISTENING_PORT: u16 = 9001;

// 'DEBUG'
// where applicable, the below are defined in milliseconds
const DEFAULT_LOOP_COVER_STREAM_AVERAGE_DELAY: u64 = 1000;
const DEFAULT_MESSAGE_STREAM_AVERAGE_DELAY: u64 = 500;
const DEFAULT_AVERAGE_PACKET_DELAY: u64 = 200;
const DEFAULT_FETCH_MESSAGES_DELAY: u64 = 1000;
const DEFAULT_TOPOLOGY_REFRESH_RATE: u64 = 10_000;
const DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT: u64 = 5_000;
const DEFAULT_LOOP_COVER_STREAM_AVERAGE_DELAY: u64 = 1000; // 1s
const DEFAULT_MESSAGE_STREAM_AVERAGE_DELAY: u64 = 500; // 0.5s
const DEFAULT_AVERAGE_PACKET_DELAY: u64 = 200; // 0.2s
const DEFAULT_FETCH_MESSAGES_DELAY: u64 = 1000; // 1s
const DEFAULT_TOPOLOGY_REFRESH_RATE: u64 = 30_000; // 30s
const DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT: u64 = 5_000; // 5s
const DEFAULT_PACKET_FORWARDING_INITIAL_BACKOFF: u64 = 10_000; // 10s
const DEFAULT_PACKET_FORWARDING_MAXIMUM_BACKOFF: u64 = 300_000; // 5min
const DEFAULT_INITIAL_CONNECTION_TIMEOUT: u64 = 1_500; // 1.5s
Expand Down
12 changes: 6 additions & 6 deletions sfw-provider/src/provider/presence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ use crate::provider::ClientLedger;
use directory_client::presence::providers::MixProviderPresence;
use directory_client::requests::presence_providers_post::PresenceMixProviderPoster;
use directory_client::DirectoryClient;
use log::{debug, error};
use log::{error, trace};
use std::time::Duration;
use tokio::runtime::Handle;
use tokio::task::JoinHandle;

pub struct NotifierConfig {
pub(crate) struct NotifierConfig {
location: String,
directory_server: String,
mix_announce_host: String,
Expand All @@ -32,7 +32,7 @@ pub struct NotifierConfig {
}

impl NotifierConfig {
pub fn new(
pub(crate) fn new(
location: String,
directory_server: String,
mix_announce_host: String,
Expand All @@ -51,7 +51,7 @@ impl NotifierConfig {
}
}

pub struct Notifier {
pub(crate) struct Notifier {
location: String,
net_client: directory_client::Client,
client_ledger: ClientLedger,
Expand Down Expand Up @@ -91,10 +91,10 @@ impl Notifier {
}
}

pub fn notify(&self, presence: MixProviderPresence) {
pub(crate) fn notify(&self, presence: MixProviderPresence) {
match self.net_client.presence_providers_post.post(&presence) {
Err(err) => error!("failed to send presence - {:?}", err),
Ok(_) => debug!("sent presence information"),
Ok(_) => trace!("sent presence information"),
}
}

Expand Down