nox icon indicating copy to clipboard operation
nox copied to clipboard

Builtin peer identify: include external addresses reported by libp2p

Open folex opened this issue 3 years ago • 0 comments

Currently peer identify returns NodeInfo which contains external_addresses field. However, if external addresses aren't configured by node operator, we return []. It's possible to try better.

More specifically, libp2p's Swarm reports addresses observed by other peers, but node currently ignores them. We need to collect these addresses and return them in peer identify together with NodeInfo::external_addresses.

Relevant technical info

  • Addresses are reported via libp2p::NetworkBehehaviour::inject_new_external_addr
  • The only struct that implements libp2p::NetworkBehvaiour manually is ConnectionPoolBehvaiour, so that's probably where we should collect reported addresses

folex avatar Jun 22 '21 17:06 folex