Skip to content

Parallel block verification#2015

Merged
nazar-pc merged 1 commit intomainfrom
parallel-block-verification
Sep 29, 2023
Merged

Parallel block verification#2015
nazar-pc merged 1 commit intomainfrom
parallel-block-verification

Conversation

@nazar-pc
Copy link
Copy Markdown
Member

@nazar-pc nazar-pc commented Sep 28, 2023

Now that Substrate was upgraded in #2010 and parallel block verification is available (though upstream PR paritytech/polkadot-sdk#1598 is stuck), this PR takes advantage of it while accounting for two edge-cases: equivocation and runtime API call concurrency.

Code contributor checklist:

@nazar-pc nazar-pc requested a review from rg3l3dr as a code owner September 28, 2023 07:50
Base automatically changed from farmer-thread-pools to main September 28, 2023 09:09
use tokio::sync::Semaphore;

/// This corresponds to default value of `--max-runtime-instances` in Substrate
const BLOCKS_LIST_CHECK_CONCURRENCY: usize = 8;
Copy link
Copy Markdown
Contributor

@vedhavyas vedhavyas Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe MAX_CONCURRENT_BLOCK_VERIFICATIONS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, the verification is running at higher concurrency, this is just for block list check that requires runtime API calls and is bound by number of runtime instances.

@nazar-pc nazar-pc force-pushed the parallel-block-verification branch from 2fe88f1 to f88895e Compare September 28, 2023 22:22
@nazar-pc nazar-pc requested a review from vedhavyas September 28, 2023 22:22
@nazar-pc nazar-pc force-pushed the parallel-block-verification branch from f88895e to 4e3a58d Compare September 29, 2023 00:28
@nazar-pc nazar-pc added the need to audit This change needs to be audited label Sep 29, 2023
@nazar-pc nazar-pc merged commit 26e6a7e into main Sep 29, 2023
@nazar-pc nazar-pc deleted the parallel-block-verification branch September 29, 2023 04:43
@vanhauser-thc vanhauser-thc added audited This change was audited and removed need to audit This change needs to be audited labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audited This change was audited

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants