From f82ee44f7080353251a739c5e660b1e092d5fc28 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 29 Jul 2026 23:22:52 +0000 Subject: [PATCH] Log the transport id and local address when adopting a traversal socket The "Adopted NAT traversal socket" line carried only the peer npub, which left two questions unanswerable from a capture. An operator cannot join a host socket table against our adoption events without the local address, so there was no way to confirm which socket a stuck connected-UDP activation was contending with. And an adopted transport inherits accept_connections from the configured UDP transport, so it can admit peers beyond the one it was punched for: without the transport id, several peers sharing one adopted transport and several separate adopted transports produce identical log output. Both fields already existed on BootstrapHandoffResult, so this only binds the value the match arm was discarding. --- src/node/lifecycle.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/node/lifecycle.rs b/src/node/lifecycle.rs index be9a4d5..a4d44b2 100644 --- a/src/node/lifecycle.rs +++ b/src/node/lifecycle.rs @@ -759,8 +759,20 @@ impl Node { } } match self.adopt_established_traversal(traversal).await { - Ok(_) => { - info!(peer_npub = %peer_npub, "Adopted NAT traversal socket"); + Ok(handoff) => { + // `local_addr` lets an operator join a host socket + // table (ss/netstat) against our adoption events. + // `transport_id` separates several peers sharing one + // adopted transport from several adopted transports: + // an adopted transport inherits `accept_connections`, + // so it can admit peers beyond the one it was punched + // for, and the two cases are otherwise identical here. + info!( + peer_npub = %peer_npub, + transport_id = %handoff.transport_id, + local_addr = %handoff.local_addr, + "Adopted NAT traversal socket" + ); } Err(err) => { warn!(peer_npub = %peer_npub, error = %err, "Failed to adopt NAT traversal");