fix: do not bind a mainline DHT socket #2296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
By merging #2188 we unknowingly made
iroh
bind a socket for a mainline DHT.Pkarr includes code for querying records from the bittorent mainline DHT behind a
dht
feature flag, which is disabled iniroh-net
but with #2188 is enabled iniroh-dns-server
, and due to feature unification in cargo workspaces this silently also enabled the feature iniroh-net
.The DHT is not used because we only use the
relay_
methods of the pkarr client in iroh-net. It is binding a socket, but not doing anything else because it has no bootstrap node configured.Still, this is unfortunate - we are shipping code and binding a socket for a feature we don't (yet) use.
From a cursory skim of the source code, this would still be the same with the recently released
pkarr
v2.We should check the docs on feature unification if there is a clean way around that.
For now, this PR makes iroh not bind a socket for an unused mainline DHT client. Instead, we just use reqwest directly, which is the same as what
PkarrClient::relay_put
would do here.Breaking Changes
Notes & open questions
Change checklist