diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/mod.rs | 2 | ||||
| -rw-r--r-- | src/transport/libp2p.rs | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 5837d1e..cfe2e7e 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -275,7 +275,7 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ Kind::Flag, "BOOL", Some("false"), - "With the libp2p transport: relay for other nodes of the swarm that can't be dialled (bounded: 64 circuits, 8 per peer, each up to an hour and 1 GiB), and say so in the member list, where nodes that need a relay find it. Needs a listen address others can dial.", + "With the libp2p transport: relay for other nodes of the swarm that can't be dialled (bounded: 1024 circuits, 64 per peer, each up to an hour and 1 GiB), and say so in the member list, where nodes that need a relay find it. Needs a listen address others can dial.", ), option( "libp2p-relays", 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() }, ) |
