summaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/libp2p.rs')
-rw-r--r--src/transport/libp2p.rs12
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()
},
)