Substrate: Addresses passed with `--public-addr` get purged after a while

Created on 11 Nov 2020  路  4Comments  路  Source: paritytech/substrate

The --public-addr CLI option gives the possibility for the user to pass to the node its external IP addresses.

The way it's implemented is that at startup we call libp2p::Swarm::add_external_address:

https://github.com/paritytech/substrate/blob/3654d1ac2aa075cca1faa9f00580e1b9e3556041/client/network/src/service.rs#L381-L383

This, in turn, adds the address to the registry.

However, nodes continue to discover their (probably invalid) external IP address from other nodes.
Because of the way libp2p's Registry is implemented, the addresses passed with --public-addr will eventually get purged. This is obviously not supposed to happen.

The detection is automatically done in libp2p-identify, so Substrate can't disable it.

There seems to be lacking a way in libp2p to implement something like --public-addr.

cc @mxinden @romanb

I2-bug 馃悳

All 4 comments

For some history: --public-addr was implemented a long time ago when addresses stayed in the libp2p Registry forever.
But we then changed its behaviour to purge old addresses, and didn't think of --public-addr.

I can look into this on the libp2p side.

@ddorgan The problem with nodes behind nginx not receiving incoming connections should now be fixed.

Good news, thanks @tomaka

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gavofyork picture gavofyork  路  4Comments

qalqi picture qalqi  路  3Comments

expenses picture expenses  路  5Comments

xlc picture xlc  路  5Comments

Mischi picture Mischi  路  5Comments