Skip to content

docs: describe how dial targets race direct and relay paths - #2394

Merged
alpergundogdu merged 1 commit into
mainfrom
docs/dial-path-race
Oct 9, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
docs/dial-path-race

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

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_target explains 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_target points to that note.

Docs only, no behavior change.

🤖 Generated with Claude Code

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]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.rs module 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_target doc in fetch.rs to 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-reference lane_target for 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.

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 37ebd49 in the docs/dial-path-race branch remains at 75%, unchanged from commit e7eee84 in the main branch.

Show a line coverage summary of the most impacted files.
File main e7eee84 docs/dial-path-race 37ebd49 +/-
crates/cache/src/engine.rs 91% 91% 0%
crates/client/src/lib.rs 88% 89% +1%

@alpergundogdu
alpergundogdu merged commit ccca0ba into main Oct 9, 2026
31 checks passed
@alpergundogdu
alpergundogdu deleted the docs/dial-path-race branch October 9, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants