From 37940e51a0113c744042390a5226bda78fc1ab0d Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 22 Nov 2026 16:30:45 +0000 Subject: libp2p: dial a relayed peer directly even while another dial is under way upgrade dialled with PeerCondition::NotDialing: while hole punching's dial went, the direct one didn't, and came only once that dial failed, which where packets are dropped is when it times out. Hole punching dials the address the relay saw, which may not answer where the peer's listen addresses do (a host with several, a port mapped otherwise). a_relayed_connection_is_upgraded_where_one_side_can_be_dialled hit that now and then: identify told b where a listens 1 ms after dcutr's dial began, and b didn't dial a within the test's 5 s. Now it dials regardless. Where both dials connect, the slower is closed after DUPLICATE_GRACE, as of any two. The retry on a failed dial goes: nothing waits on another dial any more; the next try comes as before (identify, mDNS, a send to the peer), UPGRADE_RETRY after the last. --- src/transport/libp2p/driver.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/transport/libp2p/driver.rs') diff --git a/src/transport/libp2p/driver.rs b/src/transport/libp2p/driver.rs index 6ef04e7..9f12cea 100644 --- a/src/transport/libp2p/driver.rs +++ b/src/transport/libp2p/driver.rs @@ -297,10 +297,6 @@ pub(super) async fn run( } find_on_dht(&mut swarm, peer); } - // A dial that kept ours from going (`upgrade`) is over. - if let Some(peer) = peer_id { - upgrade(&mut swarm, &book, peer, relaying.local); - } } SwarmEvent::NewListenAddr { address, .. } => { // libp2p listens on every interface it's told to; the ranges left -- cgit v1.3.1