waku-org / nwaku

Waku node and protocol.
Other
202 stars 52 forks source link

chore: don't propagate peers with 127.0.0.1 multiaddresses via Discv5 #3037

Closed gabrielmer closed 2 months ago

gabrielmer commented 2 months ago

Background

Whenever a peer doesn't configure or resolve an external IP, it uses 127.0.0.1 as the IP in its multiaddress. This helps especially for local testing but we should keep it out of Discv5's DHT so it doesn't pollute other nodes routing tables.

Acceptance criteria

gabrielmer commented 2 months ago

It seems that this case is already handled in Discv5 in https://github.com/status-im/nim-eth/blob/4eecab27efb6a743098632024505474d34a65e9b/eth/p2p/discoveryv5/protocol.nim#L463-L470

Nodes which advertise non-reachable addresses are not added to routing tables

gabrielmer commented 2 months ago

Closing as per the last comment, feel free to open in case something is missing