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

p2p/discover: fix bug in checkNodesEqual #29603

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bugmaker9371
Copy link
Contributor

No description provided.

Comment on lines +202 to +203
} else {
return fmt.Errorf("length dismatch: got %d nodes, want %d nodes", len(got), len(want))
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternative fix: just move the return nil up one line, into the if-clause. Then the non-equal case would just fall through to the code below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@holiman Thanks for reviewing. What you suggest seems more elegant :)

But what more important is that test case TestUDPv5_lookupE2E is defective, UDPv5.Lookup actually could not find all expected nodes. So if we merge this bugfix, this test case will never pass.

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, well done then finding a bug in the testcase!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@holiman I try to fix TestUDPv5_lookupE2E, but it seem hard for me now :)

Maybe you guys could fix it, then this PR could get merged.

@fjl
Copy link
Contributor

fjl commented Apr 24, 2024

Yeah, the test doesn't pass and I need to investigate.

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.

None yet

3 participants