Skip to content

refactor: Remove special fast path for hickory resolver#4022

Merged
rklaehn merged 3 commits intomainfrom
remove-hickory-special-case
Mar 13, 2026
Merged

refactor: Remove special fast path for hickory resolver#4022
rklaehn merged 3 commits intomainfrom
remove-hickory-special-case

Conversation

@rklaehn
Copy link
Copy Markdown
Contributor

@rklaehn rklaehn commented Mar 13, 2026

Description

Remove special fast path for hickory resolver

The downside is that we have 1 more box for each lookup_ipv6 or lookup_ipv4, but I doubt that it matters. These are network ops, maybe cache hits, but in any case much more heavyweight than a boxed future.

The upside is that hickory will be easier to feature gate later, which we need for embedded. And it's less code.

Rationale for this: hickory is really nasty on embedded. It requires giant (for embedded) stack sizes and also is a big dep. We need it for address_discovery_dns, but there is an alternative for that: just use pkarr for both put and get.

If we don't have a default dep on hickory we can implement a simple dns resolver that just uses getaddrinfo. It won't work for TXT records, but we don't need them for the core functionality of doing just plain A or AAAA requests to figure out relay ip addrs.

Breaking Changes

None

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

The downside is that we have 1 more box for each lookup_ipv6 or lookup_ipv4,
but I doubt that it matters.

The upside is that hickory will be easier to feature gate later. And it's
less code.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4022/docs/iroh/

Last updated: 2026-03-13T11:43:12Z

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 1c18eef

@rklaehn rklaehn requested a review from Frando March 13, 2026 10:37
@n0bot n0bot bot added this to iroh Mar 13, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Mar 13, 2026
@Frando
Copy link
Copy Markdown
Member

Frando commented Mar 13, 2026

When doing #3473 I had this first too, but @dignifiedquire had perf objections so we added the fast path. Not sure myself if its worth it. But featureflagging the enum variant shouldn't also be too hard. So, fine with me, but let's wait for feedback from dig?

@rklaehn
Copy link
Copy Markdown
Contributor Author

rklaehn commented Mar 13, 2026

When doing #3473 I had this first too, but @dignifiedquire had perf objections so we added the fast path. Not sure myself if its worth it. But featureflagging the enum variant shouldn't also be too hard. So, fine with me, but let's wait for feedback from dig?

Yeah, feature flagging the enum variant is of course possible.

But I somewhat dread that feature flagging too many enum variants will turn the codebase into an effectively readonly maze of feature flags.

And I would be seriously surprised if the boxed future makes a difference. I am the first person to be annoyed about boxed futures, but really only in super hot paths, like the middle of a hash function or a 64 byte write in iroh-blobs. For an entire DNS lookup I would bet that you can't even see the diff in a flamegraph, even if the lookup hits a cache.

@rklaehn rklaehn requested a review from dignifiedquire March 13, 2026 11:52
@dignifiedquire
Copy link
Copy Markdown
Contributor

it’s fine, we‘ll fix perf if it becomes an issue

@rklaehn rklaehn added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 7fc9fb9 Mar 13, 2026
30 checks passed
@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to ✅ Done in iroh Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants