-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gossipd: Turn off IP discovery when we already have useable addresses. #5344
gossipd: Turn off IP discovery when we already have useable addresses. #5344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
This is why --enable/disable flags are generally poor design: --ip-discovery= is better, since it can be overridden later in commandline too. |
@m-schmoock we're looking to cut an RC this week, and I'd love to get this added. It looks like this just needs a rebase. |
Ok, I'll try to finish it. It's a little bit more though because we also need to depreciate the '--disable-ip-discovery' flag, update docs and tests etc. |
This commit got reduced to just changing a comment because the stuff it initially did was already merged in before by commit 7ff62b4 So I just kept the changed comment as its more precise. Changelog-None
This will only add the discovered `remote_addr` IPs if no other addresses would be announced. Meaning whenever a public address was found by autobind or an address was specified via commandline or config, IP discovery will be disabled. Addresses: ElementsProject#5305 Note from the author: We could/should also enable IP discovery when we only have a TOR address (but without --always-use-proxy ofc). This will give nodes an option to have a bootstrap way to be reached until IP discovery can do the job in a more stable way. Changelog-Changed: Only use IP discovery as fallback when no addresses would be announced
a10bae9
to
b955b1b
Compare
I just increased the version byte. Didn't recreate and dump a new store. The test still works so I assume no imcompatibilities. Changelog-None
Changelog-None
Note: Needed to fix some outdated gossmap tests that broke CI |
@rustyrussell
enum config_autobool {
AUTOBOOL_AUTO,
AUTOBOOL_ON,
AUTOBOOL_OFF
};
// ... plus the corresponding helpers to register this as an arg...
|
Number 2 is correct. And default to AUTO. |
@rustyrussell |
You need to deprecate it: accept it if deprecated_apis is false with a log_unusual() warning, put it in Changelog, remove it from documentation... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack f02e510
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f02e510
Currently, IP discovery will be active (unless turned off) also when users configure announced addresses manually.
When the manual configuration uses a non-default port, this will lead to the strange behavior of announcing the same address twice. One with the correct and one with the guessed default port.
The idea is that we turn off IP discovery when a usable announcement has been defined via commandline, config or autobind.
Also this PR sets the 'guessed' port depending on what network (Mainnet, Testnet, ...) we are on.
Followup
--disable-ip-discovery
obsolete it and maybe add a--ip-discovery
true
/false
(/auto
) switch to force it on or off or keeping it automatically, if not defined.Note:
We could/should also enable IP discovery when we only have a working TOR address (but without --always-use-proxy ofc). This will give nodes an option to have a bootstrap way to be reachable until IP discovery can do the job in a more stable way.
Keep in mind its easier for most users to punch a hole in a NAT router than to setup TOR correctly.
If/Once we have a
--ip-discovery=true
switch the user can also do that manually if he wants to.Addresses #5305