Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(networking): relax relay limits #1955

Merged
merged 6 commits into from
Jul 19, 2024
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
8 changes: 7 additions & 1 deletion sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

Expand Down
2 changes: 1 addition & 1 deletion sn_networking/src/relay_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Multiaddr>) -> bool {
Expand Down
Loading