Skip to content
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

Clarification on compute time per block for a parachain #302

Closed
rhuttman opened this issue Jan 6, 2022 · 1 comment
Closed

Clarification on compute time per block for a parachain #302

rhuttman opened this issue Jan 6, 2022 · 1 comment

Comments

@rhuttman
Copy link

rhuttman commented Jan 6, 2022

I am trying to figure out how much compute time, and therefore weight, we can expect per block for a parachain. The substrate documentation says the following:

The maximum block weight should be equivalent to one-third of the target block time, allocating one third for block construction, one third for network propagation, and one third for import and verification.

Since the block time for a parachain is 12 seconds, this implies we should get ~4 seconds of compute time per block. While if we take a look at the parachain template from substrate it says:

/// We allow for 0.5 of a second of compute with a 12 second average block time.

Could you please clarify what the expected computed time is for a 12 second block on a parachain, and if the template is correct then why it is so low?

@rhuttman
Copy link
Author

rhuttman commented Jan 7, 2022

answer:

So, that documentation is referring to a standalone Substrate based chain. Parachains are a bit unoptimized right now with the two phase inclusion - the validators have to import/execute the block in two rounds, but still within the Relay Chain's block time of 6 seconds. And there seems to be some overhead with importing the PoV. So paras are limited to 1/4 of the execution time + only every other block, leading to a limit of 0.5 of 12 instead of 2 of 6.

The good news is that it's a big optimization we're working on called Asyncronous Backing. This will not only let paras use the normal 2 sec of execution time, but will also allow a 6s para block time, so an 8x improvement in execution capacity. There is a pretty detailed writeup in the issue on it: paritytech/polkadot#3779

@rhuttman rhuttman closed this as completed Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant