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

eth: report error from setupDiscovery at startup #31233

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Feb 21, 2025

I ran into this while trying to debug a discv5 thing. I tried to disable DNS discovery using --discovery.dns=false, which doesn't work. Annoyingly, geth started anyway and discarded the error silently. I eventually found my mistake, but it took way longer than it should have.

Also including a small change to the error message for invalid DNS URLs here. The user actually needs to see the URL to make sense of the error.

I ran into this while trying to debug a discv5 thing. I tried to disable DNS discovery
using `--discovery.dns=false`, which doesn't work. Annoyingly, geth started anyway and
discarded the error silently. I eventually found my mistake, but it took way longer than
it should have.

Also including a small change to the error message for invalid DNS URLs here. The user
actually needs to see the URL to make sense of the error.
@fjl fjl added this to the 1.15.3 milestone Feb 21, 2025
@@ -368,7 +368,9 @@ func (s *Ethereum) Protocols() []p2p.Protocol {
// Start implements node.Lifecycle, starting all internal goroutines needed by the
// Ethereum protocol implementation.
func (s *Ethereum) Start() error {
s.setupDiscovery()
if err := s.setupDiscovery(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Notably, Geth will stop immediately if an error occurs in the discovery setup, e.g. the provided DNS URL is invalid.

I think it should be the correct behavior. Any invalid DNS url should be detected as early as possible, instead of launching node silently.

@fjl fjl merged commit 9e6f924 into ethereum:master Feb 23, 2025
3 of 4 checks passed
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.

2 participants