This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Do not ban peers for sending multiple valid requests#8325
Merged
2 commits merged intoMar 12, 2021
Merged
Conversation
We introduced banning of peers who spam us with the same request (more than 2 times). However, we missed that it is completely legal to send the same request multiple times as long as we did not provide any answer. An example for that is the justification request. This request is send multiple times until we could fetch the justification from one of our peers. So, the solution to this problem is to tag requests as fulfilled and to start counting these fulfilled requests. If the number is higher than what we allow, the peer should be banned.
arkpar
reviewed
Mar 12, 2021
| max_blocks, | ||
| )?; | ||
|
|
||
| // If any of the blocks contains nay data, we can consider it as successful request. |
Member
There was a problem hiding this comment.
Suggested change
| // If any of the blocks contains nay data, we can consider it as successful request. | |
| // If any of the blocks contains any data, we can consider it as successful request. |
Member
You mean it is legal to send the same request multiple times when we provide an empty answer? The sync protocol requires that each request will either be answered (possible with empty block list), or the connection to be terminated. |
Member
Author
Yes. This for example happens for the justification request. |
arkpar
approved these changes
Mar 12, 2021
andresilva
approved these changes
Mar 12, 2021
Contributor
|
bot merge force |
|
Trying merge. |
KalitaAlexey
pushed a commit
to KalitaAlexey/substrate
that referenced
this pull request
Jul 9, 2021
We introduced banning of peers who spam us with the same request (more than 2 times). However, we missed that it is completely legal to send the same request multiple times as long as we did not provide any answer. An example for that is the justification request. This request is send multiple times until we could fetch the justification from one of our peers. So, the solution to this problem is to tag requests as fulfilled and to start counting these fulfilled requests. If the number is higher than what we allow, the peer should be banned.
jordy25519
pushed a commit
to cennznet/substrate
that referenced
this pull request
Sep 17, 2021
We introduced banning of peers who spam us with the same request (more than 2 times). However, we missed that it is completely legal to send the same request multiple times as long as we did not provide any answer. An example for that is the justification request. This request is send multiple times until we could fetch the justification from one of our peers. So, the solution to this problem is to tag requests as fulfilled and to start counting these fulfilled requests. If the number is higher than what we allow, the peer should be banned.
This was referenced May 15, 2022
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We introduced banning of peers who spam us with the same request (more
than 2 times). However, we missed that it is completely legal to send
the same request multiple times as long as we did not provide any
answer. An example for that is the justification request. This request
is send multiple times until we could fetch the justification from one
of our peers. So, the solution to this problem is to tag requests as
fulfilled and to start counting these fulfilled requests. If the number
is higher than what we allow, the peer should be banned.
Thank you for your Pull Request!