Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Addresses passed with --public-addr get purged after a while #7518

Closed
tomaka opened this issue Nov 11, 2020 · 4 comments · Fixed by #7606
Closed

Addresses passed with --public-addr get purged after a while #7518

tomaka opened this issue Nov 11, 2020 · 4 comments · Fixed by #7606
Labels
I3-bug The node fails to follow expected behavior.

Comments

@tomaka
Copy link
Contributor

tomaka commented Nov 11, 2020

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:

for addr in &params.network_config.public_addresses {
Swarm::<B, H>::add_external_address(&mut swarm, addr.clone());
}

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

@tomaka tomaka added the I3-bug The node fails to follow expected behavior. label Nov 11, 2020
@tomaka
Copy link
Contributor Author

tomaka commented Nov 11, 2020

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.

@romanb
Copy link
Contributor

romanb commented Nov 12, 2020

I can look into this on the libp2p side.

@tomaka
Copy link
Contributor Author

tomaka commented Nov 27, 2020

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

@ddorgan
Copy link
Member

ddorgan commented Nov 27, 2020

Good news, thanks @tomaka

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants