-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Do not ban peers for sending multiple valid requests #8325
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.
@@ -212,6 +228,21 @@ impl<B: BlockT> BlockRequestHandler<B> { | |||
max_blocks, | |||
)?; | |||
|
|||
// If any of the blocks contains nay data, we can consider it as successful request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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. |
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. |
Yes. This for example happens for the justification request. |
bot merge force |
Trying merge. |
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.
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.
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!