Skip to content
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

cmd/geth: enable DNS discovery by default #20660

Merged
merged 10 commits into from
Feb 13, 2020

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Feb 12, 2020

This change adds auto-configuration of DNS discovery URLs for supported networks.
Users can override the enrtree:// entry points using the --discovery-urls flag (suggestions for
better names are welcome). Package eth applies this setting by injecting nodes from the given DNS roots as dial candidates.

The change works as-is, but will work a lot better in combination with #20592 because nodes found through DNS will be dialed faster.

The default lists live on the ethdisco.net domain and their content is tracked
at https://github.com/ethereum/discv4-dns-lists

@fjl fjl added this to the 1.9.11 milestone Feb 12, 2020
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it out (without the new dialler) -- seems to work great!

@@ -658,6 +658,10 @@ var (
Name: "netrestrict",
Usage: "Restricts network communication to the given IP networks (CIDR masks)",
}
DiscoveryURLFlag = cli.StringSliceFlag{
Name: "discovery-urls",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to use discovery.urls -- in case we want any more flags surrounding discovery later on

@@ -82,6 +86,8 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.RPCGasCap = c.RPCGasCap
enc.Checkpoint = c.Checkpoint
enc.CheckpointOracle = c.CheckpointOracle
enc.OverrideIstanbul = c.OverrideIstanbul
enc.OverrideMuirGlacier = c.OverrideMuirGlacier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can recall, we don't toml:ize the overrides, because they should only be applied when explicitly called for, not "accidentally" remembered by a config file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case you need to add toml:"-" next time. I will send a PR to remove them after this PR since they're not needed anymore either way (comment says "delete after the fork").

@karalabe karalabe merged commit 38d1b0c into ethereum:master Feb 13, 2020
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this pull request Mar 10, 2021
* node: expose config in service context

* eth: integrate p2p/dnsdisc

* cmd/geth: add some DNS flags

* eth: remove DNS URLs

* cmd/utils: configure DNS names for testnets

* params: update DNS URLs

* cmd/geth: configure mainnet DNS

* cmd/utils: rename DNS flag and fix flag processing

* cmd/utils: remove debug print

* node: fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants