Skip to content

les: prevent double validation#16955

Closed
rjl493456442 wants to merge 1 commit intoethereum:masterfrom
rjl493456442:prevent_double_validation
Closed

les: prevent double validation#16955
rjl493456442 wants to merge 1 commit intoethereum:masterfrom
rjl493456442:prevent_double_validation

Conversation

@rjl493456442
Copy link
Copy Markdown
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

@rjl493456442 rjl493456442 requested a review from zsfelfoldi as a code owner June 12, 2018 08:51
Copy link
Copy Markdown
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
Copy Markdown
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