Repository navigation
docs: describe how dial targets race direct and relay paths - #2394
Conversation
The dial_addrs module doc says pkarr records carry the relay URL plus public IPs, and that iroh tries registry and pkarr addresses together. lane_target states why the client keeps its relay hint: the relay and direct addresses race from the first handshake packet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The change is docs-only and each updated statement was verified to match current node_publish_filter, lane_target, and is_publishable behavior.
0 open findings
What changed in this PR
This docs-only PR corrects stale module/function documentation in the node and CLI crates to accurately describe how iroh races direct and relay dial paths. The previous dial_addrs.rs doc claimed a node "publishes only its relay URL through pkarr," which is no longer true now that the node's pkarr publisher uses node_publish_filter (relay URL plus globally routable public IPs). The updated text explains that registry addresses, the pkarr relay hint, and published public IPs all ride the first handshake packet so a reachable node settles on the direct path while a NAT'd node falls back to the relay without waiting for the pkarr lookup.
Changes:
- Rewrites the
dial_addrs.rsmodule doc to reflect that pkarr now supplies both the home relay URL and published public IPs (node_publish_filter), resolved alongside registry addresses. - Expands the
lane_targetdoc infetch.rsto explain why the client keeps its relay hint and how relay vs. direct paths race from the first packet. - Updates
probe_target's doc to cross-referencelane_targetfor the shared first-packet rationale.
| File | Description |
|---|---|
| crates/node/src/dht/dial_addrs.rs | Module doc updated to describe pkarr publishing relay URL + public IPs and concurrent registry/pkarr path racing. |
| crates/cli/src/commands/fetch.rs | lane_target doc expands on first-packet relay/direct racing; probe_target doc points to it. |
I verified the claims against the code: node_publish_filter (crates/node/src/runtime/addr_publish.rs) publishes the relay URL plus every is_publishable (globally routable) IP, matching the new dial_addrs.rs wording; lane_target keeps relays.first() as the relay hint and adds registry multiaddrs as direct hints, matching the new fetch.rs wording. The [lane_target] intra-doc link resolves within the same module. No spelling, accuracy, or linkage issues found.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
dial_addrs.rs: the module doc now says what pkarr records actually carry. Nodes publish their relay URL plus public IPs (node_publish_filter), and iroh tries registry addresses and pkarr addresses together.fetch.rs:lane_targetexplains why the client keeps its relay hint. iroh sends the first handshake packet to every path in the target, so the relay and the direct addresses race from the start. A reachable node ends up on the direct path, and a node behind NAT connects over the relay right away, without waiting for the pkarr lookup.probe_targetpoints to that note.Docs only, no behavior change.
🤖 Generated with Claude Code