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

Add shouldRejectInvalidTotalPackets test #160

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

jtraglia
Copy link
Contributor

PR Description

Well I misinterpreted the spec and thought the following sentences meant that FindNodeResponseHandler should ignore excess packets, instead of rejecting the response, after the allowed maximum for total.

Implementations may place a limit on the allowed maximum for total. If exceeded, additional responses may be ignored.

I started to "fix" it but then I noticed that it said "additional responses" and not "additional packets". So I decided to add some tests to ensure that functionality works as expected. Also, updated two things in the handler that I thought helped readability. Should we ignore additional responses after a bad response?

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM. I think it would make sense to ignore all packets after one is invalid.

@ajsutton ajsutton merged commit 674b5c0 into Consensys:master Oct 26, 2022
@jtraglia jtraglia deleted the add-invalid-number-packets-test branch October 26, 2022 21:20
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