diff options
| author | tv <tv@krebsco.de> | 2026-10-28 20:32:01 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 20:32:01 +0100 |
| commit | 03a64a24a5795051fc24ce999a5b1ac0cf1affe8 (patch) | |
| tree | 2c9112957c12b2260caca9225026b7301ef7b913 /src/transport | |
| parent | 26a9ed2302b87bd3b1dc28ed02022b53c8bbd9ef (diff) | |
libp2p-relay: increase limits
Diffstat (limited to 'src/transport')
| -rw-r--r-- | src/transport/libp2p.rs | 12 |
1 files changed, 9 insertions, 3 deletions
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() }, ) |
