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/utils,p2p: enable discv5 by default #30327

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

lightclient
Copy link
Member

Now that #30302 is in, I think we enable discv5 by default.

Comment on lines +550 to +552
if err := t.handlePacket(from, buf[:nbytes]); err != nil && unhandled == nil {
t.log.Debug("Bad discv4 packet", "addr", from, "err", err)
} else if err != nil && unhandled != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the semantics. Previously, if there was an error, we did the log.Debug unconditioally. Now we only do if it unhandled == nil.

Shouldn't you do something like this?

Suggested change
if err := t.handlePacket(from, buf[:nbytes]); err != nil && unhandled == nil {
t.log.Debug("Bad discv4 packet", "addr", from, "err", err)
} else if err != nil && unhandled != nil {
if err := t.handlePacket(from, buf[:nbytes]); err != nil {
t.log.Debug("Bad discv4 packet", "addr", from, "err", err)
if unhandled != nil {

Copy link
Member Author

@lightclient lightclient Aug 20, 2024

Choose a reason for hiding this comment

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

Right so that was actually the goal. Every discv5 message goes through unhandled, which means every discv5 message causes a "Bad discv4 packet" log to print. That doesn't seem correct.

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.

LGTM if @fjl approves

@fjl fjl changed the title cmd,p2p: enable discv5 by default cmd/utils,p2p: enable discv5 by default Aug 20, 2024
@fjl fjl added this to the 1.14.9 milestone Aug 20, 2024
@fjl fjl merged commit 00294e9 into ethereum:master Aug 20, 2024
3 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.

3 participants