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

les: prevent double validation #16955

Closed

Conversation

rjl493456442
Copy link
Member

This PR is a complement of the #16776, and #16921 can be fixed by the #16776 too.

Now when a request sent by retrieve manager is soft timeout, it will spawn a new request to another peer. In some corner case, two new arrived data will be validated twice. To avoid this, a new flag delivered is added into the sentRequest

Copy link
Contributor

@zsfelfoldi zsfelfoldi left a comment

Choose a reason for hiding this comment

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

Double validation was a deliberate decision. If a server times out and we send multiple requests then it is still a valuable information for the peer selection logic to know whether they all sent valid answers. Timing out (soft timeout) just reduces the short term priority of the server while not giving a valid answer results in disconnection. I think having useful server connections is worth the extra effort. We should not check unrequested "replies" though (that could be a DoS vector) but there is a check for that.

@rjl493456442
Copy link
Member Author

Thank you! Get your point now and will close this PR.

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