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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

return err
}

// Start the bloom bits servicing goroutines
s.startBloomHandlers(params.BloomBitsBlocks)
Expand Down
2 changes: 1 addition & 1 deletion p2p/dnsdisc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (it *randomIterator) Next() bool {
func (it *randomIterator) addTree(url string) error {
le, err := parseLink(url)
if err != nil {
return fmt.Errorf("invalid enrtree URL: %v", err)
return fmt.Errorf("invalid DNS discovery URL %q: %v", url, err)
}
it.lc.addLink("", le.str)
return nil
Expand Down