paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.8k stars 652 forks source link

Use maximum allowed response size for request/response protocols #5753

Closed AndreiEres closed 1 week ago

AndreiEres commented 1 week ago

Description

Adjust the PoV response size to the default values used in the substrate. Fixes https://github.com/paritytech/polkadot-sdk/issues/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

https://github.com/paritytech/polkadot-sdk/blob/fae15379cba0c876aa16c77e11809c83d1db8f5c/polkadot/node/network/protocol/src/request_response/mod.rs#L126-L129

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.

sandreim commented 1 week ago

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.

Yes, this is worst case scenario, when all blocks you need to recover are full. We'll likely have to raise specs for networking,

sandreim commented 1 week ago

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.

Yes, this is worst case scenario, when all blocks you need to recover are full. We'll likely have to raise specs for networking,

Did a bit of math in https://github.com/paritytech/polkadot-sdk/issues/5334#issuecomment-2361120502 . looks like we should be fine.