feat(dht): tag LAN-scoped addresses and gate same-WAN sharing#105
Closed
mickvandijke wants to merge 2 commits into
Closed
feat(dht): tag LAN-scoped addresses and gate same-WAN sharing#105mickvandijke wants to merge 2 commits into
mickvandijke wants to merge 2 commits into
Conversation
Introduces an `AddressType::Lan` slot that stores a peer's private, link-local, or loopback path alongside its existing relay/direct/ unverified/NATted entries. Same-LAN peers can now retain a fast local path without evicting their WAN path, capped at one extra slot per IP family. Address publication, gossip merges, find-node responses, and dial selection all filter LAN-tagged entries down to receivers we believe share our LAN/WAN, drop relay candidates that resolve to our own observed WAN IP, and rewrite our own LAN IP to loopback for the receiver where appropriate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
AddressType::Lanas a new highest-priority address slot so same-LAN peers retain a fast local path alongside their relay/direct/unverified/NATted entries (one extra slot per IP family, capped at 3).Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --lib(379 passed)🤖 Generated with Claude Code