From da5d23ccb7976a25feaa959db8a1a0a738890d37 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 2 May 2026 01:39:52 +0000 Subject: [PATCH] Document nostr-nat ephemeral UDP transport MTU choice Adopted ephemeral UDP transports created by adopt_established_traversal() default to UdpConfig::default() (MTU=1280, IPv6 minimum) when the bootstrap runtime hands a socket without an explicit transport_config override. This is by design: NAT-traversal middlebox MTU is unpredictable and the IPv6 minimum is the only value guaranteed by spec to survive arbitrary paths. Add an explanatory comment at the call site so future readers find the rationale without spelunking through ISSUE-2026-0013, and so any future change to the inheritance behavior is a deliberate decision rather than an accidental refactor. No behavior change. --- src/node/lifecycle.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/node/lifecycle.rs b/src/node/lifecycle.rs index df1ba0d..5d1d7b4 100644 --- a/src/node/lifecycle.rs +++ b/src/node/lifecycle.rs @@ -1689,6 +1689,13 @@ impl Node { self.register_identity(peer_node_addr, peer_identity.pubkey_full()); let transport_id = self.allocate_transport_id(); + // Adopted ephemeral UDP transports use UdpConfig::default() when the + // bootstrap runtime doesn't pass an override. Default MTU resolves to + // 1280 (IPv6 minimum), which is the only value guaranteed to survive + // arbitrary NAT-traversal middlebox paths. Inheriting from the named + // [transports.udp] config (Option 3 in ISSUE-2026-0013) would track + // operator config more closely but risks regressions on hostile paths; + // accepted as-is until a concrete use case justifies the change. let mut transport = crate::transport::udp::UdpTransport::new( transport_id, traversal.transport_name.clone(),