Skip to content

feat(nameresolving): bound and expand composed DNS multiaddresses - #3385

Draft
richard-ramos wants to merge 2 commits into
feat/system-resolver-backendfrom
feat/dns-multiaddress-expansion
Draft

richard-ramos wants to merge 2 commits into
feat/system-resolver-backendfrom
feat/dns-multiaddress-expansion

Conversation

@richard-ramos

@richard-ramos richard-ramos commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Resolve DNS components anywhere in a multiaddress while preserving surrounding protocols, including addresses without a transport port. Hostname extraction prefers DNS names beyond prefixes so dialing retains the intended hostname.

Match DNSADDR suffixes exactly, skip malformed TXT records, and deduplicate results. During dialing, prune records for other peers before recursion and compare transport suffixes without the terminal expected peer ID. Intermediate and final records may omit the peer ID.

One expansion routine shares lookup and output budgets across branches, detects cycles, and permits a shorter path to revisit an address previously limited by depth. Tests cover composed addresses, suffix matching, limits, cancellation, and ranked/sequential dialing.

Impact on Library Users

Each resolution call permits at most 32 lookups, four DNSADDR levels, and 100 output addresses. Each response expands at most 16 matching DNSADDR records or examines at most 100 IP records. Malformed records and records rejected by peer or suffix checks do not consume the DNSADDR expansion budget. Results retain answer order; branches beyond the limits are omitted with trace diagnostics.

Stack

3 of 3 — merge in this order:

  1. #3379: system DNS discovery; base master.
  2. #3384: system resolver worker pool and factory; base feat/system-name-resolver.
  3. This PR: bounded multiaddress expansion; base feat/system-resolver-backend.

All three PRs are drafts. Review this diff against its parent branch.

Validation

Before restacking: expansion suite, 14 checks passed; existing name-resolution suite, 11 checks passed. After restacking: dialer suite, 44 checks passed. The rebase preserves expansion behavior and removes the obsolete base resolver lifecycle hooks.

References

Builds on the multiaddress work proposed in #3114. Suffix matching follows the DNSADDR specification.

@richard-ramos

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 6 issue(s) in this PR.

  • ✅ Successfully posted inline: 5 comment(s)
  • ⏭️ Skipped (overlap with history): 1 comment(s)

Model: qwen3.8-max
Review generated in: 47m 1s

Comment thread libp2p/dialer.nim Resolved
Comment thread libp2p/nameresolving/nameresolver.nim Resolved
Comment thread libp2p/nameresolving/nameresolver.nim Resolved
Comment thread libp2p/nameresolving/nameresolver.nim Resolved
Comment thread libp2p/nameresolving/nameresolver.nim Resolved
@richard-ramos
richard-ramos force-pushed the feat/dns-multiaddress-expansion branch 2 times, most recently from 164c574 to 31cec7e Compare November 4, 2026 14:44
@richard-ramos
richard-ramos force-pushed the feat/dns-multiaddress-expansion branch from 31a68f1 to 07dc2d8 Compare November 5, 2026 22:57
@richard-ramos
richard-ramos force-pushed the feat/dns-multiaddress-expansion branch from 07dc2d8 to 8d18ccb Compare November 5, 2026 23:07

This branch has not been deployed

No deployments
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.

1 participant