-
Notifications
You must be signed in to change notification settings - Fork 1.6k
DoS protection on the collator protocol #3446
Conversation
if download takes too long.
after exclusive download time.
/// This is to protect from a single slow collator preventing collations from happening. | ||
/// | ||
/// With a collation size of 5Meg and bandwidth of 500Mbit/s (requirement for Kusama validators), | ||
/// the transfer should be possible within 0.1 seconds. 300 milliseconds should therefore be |
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.
We already knew that these calculations are not correct. Otherwise we would not have required to implement this feature of only uploading one collation at a time.
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.
Yeah it is still guess work. That's why I added debug logs when the timeouts hit, so we can see how it goes in practice. Previously the calculations were wrong, because they did not take into account concurrent fetches and multiple heads at all. This time I made it 3 times what it should take for one head, so even with 3 heads it should finish before the next download starts. Either way, made it more conservative now and picked 400ms ... in the end we have to test in practice. Just had to justify the numbers somehow.
@bkchr if you have any further feedback I can address that |
I'm on holidays, so nothing further from me ;) |
Closes #3384 .
Both validators and collators will try another collator/validator after some time of exclusive bandwidth. This is to prevent a single slow/malicious validator/collator from starving the parachain.