Skip to content

[p2p/lookup] Listen on All IPs for a Peer #2352

@patrick-ogrady

Description

@patrick-ogrady

When a peer updates its IP, we will only accept connections from the latest IP rather than all registered across tracked peer sets:

/// Return all registered IP addresses.
pub fn registered(&self) -> HashSet<IpAddr> {
// Using `.allowed()` here excludes any peers that are still connected but no longer
// part of a peer set (and will be dropped shortly).
self.peers
.values()
.filter(|r| r.allowed(self.allow_private_ips))
.filter_map(|r| r.socket().map(|s| s.ip()))
.collect()
}

We should consider allowing a peer to dial us from any of their tracked IPs (can help with complex end-of-epoch procedures where a peer waits to update their IP until they've exited the epoch ... and generally seems more "correct").

This is not an issue in discovery because we don't filter by IP.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Staged

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions