-
Notifications
You must be signed in to change notification settings - Fork 645
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
Use maximum allowed response size for request/response protocols #5753
Conversation
5f02c93
to
fae1537
Compare
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.
PRDoc ?
/// limit might have more severe effects. | ||
const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; | ||
/// Same as what we use in substrate networking. | ||
const POV_RESPONSE_SIZE: u64 = 16 * 1024 * 1024; |
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.
I think substrate should export a constant and we should use it here.
Yes, this is worst case scenario, when all blocks you need to recover are full. We'll likely have to raise specs for networking, |
/// limit might have more severe effects. | ||
const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; | ||
/// Same as what we use in substrate networking. | ||
const POV_RESPONSE_SIZE: u64 = MAX_RESPONSE_SIZE; |
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.
Is it safe to not base this value on MAX_POV_SIZE
?
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.
It's okay, I suppose, because we make these changes to bump it.
Did a bit of math in #5334 (comment) . looks like we should be fine. |
Co-authored-by: Andrei Sandu <[email protected]>
Description
Adjust the PoV response size to the default values used in the substrate.
Fixes #5503
Integration
The changes shouldn't impact downstream projects since we are only increasing the limit.
Review Notes
You can't see it from the changes, but it affects all protocols that use the
POV_RESPONSE_SIZE
constant.Increasing timeouts
polkadot-sdk/polkadot/node/network/protocol/src/request_response/mod.rs
Lines 126 to 129 in fae1537
I assume the current PoV request timeout is set to 1.2s to handle 5 consecutive requests during a 6s block. This setting does not relate to the PoV response size. I see no reason to change the current timeouts after adjusting the response size.
However, we should consider networking speed limitations if we want to increase the maximum PoV size to 10 MB. With the number of parallel requests set to 10, validators will need the following networking speeds:
The current required speed of 50 MB/s aligns with the 62.5 MB/s specified in the reference hardware requirements. Increasing the PoV size to 10 MB may require a higher networking speed.