libp2p / libp2p/go-libp2p

Send precise set of addresses to peers on identify

Open
#2,423 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/discussion kind/enhancement
Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

When sending addresses to a peer we should only send those addresses that are relevant to the peer and not all of our available addresses.
Only send localhost addresses on connections where the remote address is a localhost address
Only send private addresses on connections where the remote address is a private address
Send public addresses to everyone

For this to be effective we'll have to send different signed peer records to different peers depending on the connection that we have.

This filtering is done on the receive side since https://github.com/libp2p/go-libp2p/pull/2300/files. We should also do this on the sending side and not share the node's private addresses with everyone.

It may be possible to get a more precise set of addresses for a peer with a private remote address by consulting the system routing table. I have not thought through the details of this scheme, but majority of cases will have just one gateway and the above system is a good start.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the identify sending path and comparing it with the receive-side address filtering introduced in pull request #2300. Determine how signed peer records can vary by remote address, then verify that localhost and private addresses are restricted while public addresses remain available to all peers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.