aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 05:00:43 +0100
committertv <tv@krebsco.de>2026-11-01 05:00:43 +0100
commit67a476525bf23fec7aa10a962668cc77cce6c685 (patch)
treea259ef08154e1bc11efee95b22d3f615f564538b /src/transport/libp2p/mod.rs
parentc08574fac02c781b615969943e3d0d95ee402537 (diff)
libp2p: dial newly announced peer addresses
Diffstat (limited to 'src/transport/libp2p/mod.rs')
-rw-r--r--src/transport/libp2p/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/transport/libp2p/mod.rs b/src/transport/libp2p/mod.rs
index 293558b..a4fefc3 100644
--- a/src/transport/libp2p/mod.rs
+++ b/src/transport/libp2p/mod.rs
@@ -32,7 +32,11 @@
//! all but one are closed a few seconds later (`DUPLICATE_GRACE`, `Book::duplicates`),
//! by the side with the smaller peer ID: it keeps the direct one with the shortest round
//! trip (libp2p's ping, on each connection), so a path over the LAN wins over one
-//! through a VPN, whichever opened first.
+//! through a VPN, whichever opened first. A peer connected directly is dialled again
+//! where it might be reached better (`explore`): at addresses it tells of later (a new
+//! interface: identify pushes them at once), and at all of them when this node gains
+//! an interface. Otherwise a connection made over the WLAN would stay there once
+//! ethernet comes.
//!
//! A relay says so where it publishes its addresses: next to each, the same address
//! ending in `/p2p-circuit` (where to reserve a slot), which other nodes find in the
@@ -166,6 +170,8 @@ const RELAY_PAUSE: Duration = Duration::from_secs(600);
/// (`upgrade`): first at once, then after a failure no sooner than this, doubling up to
/// `RELAY_PAUSE`.
const UPGRADE_RETRY: Duration = Duration::from_secs(30);
+/// A directly connected peer's addresses dialled at once for a better path (`explore`).
+const EXPLORED_AT_ONCE: usize = 4;
/// A peer nobody mentioned for this long (the member list, identify, mDNS, a
/// connection) is forgotten, unless connected: mostly old peer IDs of nodes restarted
/// without their libp2p key, whose new ones the member list has since. Members are