From 03a64a24a5795051fc24ce999a5b1ac0cf1affe8 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 20:32:01 +0100 Subject: libp2p-relay: increase limits --- src/transport/libp2p.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/transport/libp2p.rs') diff --git a/src/transport/libp2p.rs b/src/transport/libp2p.rs index 008c7ec..9217c79 100644 --- a/src/transport/libp2p.rs +++ b/src/transport/libp2p.rs @@ -105,9 +105,13 @@ const MAX_PEERS: usize = 4096; /// the punching only). const RELAY_CIRCUIT_DURATION: Duration = Duration::from_secs(3600); const RELAY_CIRCUIT_BYTES: u64 = 1 << 30; -/// Circuits through this node at once, and per peer. -const RELAY_CIRCUITS: usize = 64; -const RELAY_CIRCUITS_PER_PEER: usize = 8; +/// Circuits through this node at once, and per peer (either end: a node behind the +/// relay is an end of every circuit to it). libp2p's rate limits on circuits and slots +/// (a burst, then one every minute or two, per peer and per IP address: every node +/// behind one NAT shares one) are left out: they're for public relays serving +/// strangers, and refused circuits used them up too. +const RELAY_CIRCUITS: usize = 1024; +const RELAY_CIRCUITS_PER_PEER: usize = 64; /// A configured relay that couldn't be reached to find out its peer ID is tried again /// after this. const RELAY_RETRY: Duration = Duration::from_secs(30); @@ -952,6 +956,8 @@ impl Behaviour { max_circuits_per_peer: RELAY_CIRCUITS_PER_PEER, max_circuit_duration: RELAY_CIRCUIT_DURATION, max_circuit_bytes: RELAY_CIRCUIT_BYTES, + reservation_rate_limiters: Vec::new(), + circuit_src_rate_limiters: Vec::new(), ..Default::default() }, ) -- cgit v1.3.1