Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(iroh-net): small improvements to dns code #2301

Merged

Conversation

divagant-martian
Copy link
Contributor

@divagant-martian divagant-martian commented May 16, 2024

Description

  • Move helper methods to a trait extension to make them more ergonomic to use.
  • Avoid temporary allocations via collect in dns lookups.
  • Avoid double iterations on lookup results in the relay.
  • Remove unnecessary TryParseIp bound on lookup functions.
  • Modify comments about ipv4/ipv6 lookup to clarify why we avoid the lookup
    strategy that would naturally fit this use.

Breaking Changes

  • iroh_net::dns::lookup_ipv4_ipv6 is removed in favor of iroh_net::dns::ResolverExt::lookup_ipv4_ipv6

Notes & open questions

Was iroh_net::dns::lookup_ipv4_ipv6 meant to be part of the public api? I don't really see why.

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@divagant-martian divagant-martian self-assigned this May 16, 2024
@divagant-martian divagant-martian added this to the v0.17.0 milestone May 16, 2024
@divagant-martian divagant-martian changed the title feat(iroh-net): small improvements to dns behaviour refactor(iroh-net): small improvements to dns behaviour May 16, 2024
@divagant-martian divagant-martian changed the title refactor(iroh-net): small improvements to dns behaviour refactor(iroh-net): small improvements to dns code May 16, 2024
@divagant-martian divagant-martian force-pushed the improve-dns-behaviour branch from 1e67e31 to ae0052c Compare May 16, 2024 15:50
@divagant-martian divagant-martian added this pull request to the merge queue May 16, 2024
Merged via the queue into n0-computer:main with commit b93dd34 May 16, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants