holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.07k stars 87 forks source link

Include peer IDs on the DHT? #4

Open pfrazee opened 6 years ago

pfrazee commented 6 years ago

"Peer IDs" are used solely to deduplicate connections. If they were present on the DHT, we could avoid even attempting to connect to a peer which we've already connected to.

Things to consider:

pfrazee commented 6 years ago

We could use hash(IP + port) for the Peer ID so that they're not choosable.

pfrazee commented 6 years ago

Though- if we're using hash(IP + port) that's information we already know. We already avoid connecting to IP/ports that we're already connected to.

Peer IDs are supposed to be a way to detect when the peer is == when the IP/port is different, eg due to ipv6 vs ipv4 or public vs lan, right?

maxmetagravity commented 5 years ago

i think we can choose that options, default is ID open on DHT

Nuhvi commented 2 years ago

Is this the reason why the @next version removed the deduplication logic from peer-info ?