nox
nox copied to clipboard
Builtin peer identify: include external addresses reported by libp2p
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 isConnectionPoolBehvaiour
, so that's probably where we should collect reported addresses