diff --git a/sn_networking/src/driver.rs b/sn_networking/src/driver.rs index 86dd6a373c..65d8449028 100644 --- a/sn_networking/src/driver.rs +++ b/sn_networking/src/driver.rs @@ -562,7 +562,13 @@ impl NetworkBuilder { .boxed(); let relay_server = { - let relay_server_cfg = relay::Config::default(); + let relay_server_cfg = relay::Config { + max_reservations: 128, // Amount of peers we are relaying for + max_circuits: 1024, // The total amount of relayed connections at any given moment. + max_circuits_per_peer: 256, // Amount of relayed connections per peer (both dst and src) + circuit_src_rate_limiters: vec![], // No extra rate limiting for now + ..Default::default() + }; libp2p::relay::Behaviour::new(peer_id, relay_server_cfg) }; diff --git a/sn_networking/src/relay_manager.rs b/sn_networking/src/relay_manager.rs index 3bdbd9be60..ddd65b3745 100644 --- a/sn_networking/src/relay_manager.rs +++ b/sn_networking/src/relay_manager.rs @@ -14,7 +14,7 @@ use libp2p::{ use rand::Rng; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; -const MAX_CONCURRENT_RELAY_CONNECTIONS: usize = 2; +const MAX_CONCURRENT_RELAY_CONNECTIONS: usize = 4; const MAX_POTENTIAL_CANDIDATES: usize = 1000; pub(crate) fn is_a_relayed_peer(addrs: &HashSet) -> bool {