Skip to content

Commit ff2e7db

Browse files
authored
Move candidate-validation on blocking tasks (#3122)
Candidate validation has a lot of operations that are cpu bound on its main loop things, like: ``` validation_code.hash() sp_maybe_compressed_blob::decompress( &validation_code.0, VALIDATION_CODE_BOMB_LIMIT, ) sp_maybe_compressed_blob::decompress(&pov.block_data.0, POV_BOMB_LIMIT) let code_hash = sp_crypto_hashing::blake2_256(&code).into(); ``` When you add all that you for large POV and CODE it is going to take in the order of 10s of ms and because these are cpu bound operation it is going to hog the executor thread and negatively affect other subsystems around it, so it is better to just move the subsystem on the blocking pool to make sure such unexpected behaviour is avoided. Note! In practice this subsystem does not have a high number of work to be done, so probably the impact of it is really low, but better safe than sorry. Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
1 parent 85191e9 commit ff2e7db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • polkadot/node/overseer/src

polkadot/node/overseer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ pub async fn forward_events<P: BlockchainEvents<Block>>(client: Arc<P>, mut hand
465465
message_capacity=2048,
466466
)]
467467
pub struct Overseer<SupportsParachains> {
468-
#[subsystem(CandidateValidationMessage, sends: [
468+
#[subsystem(blocking, CandidateValidationMessage, sends: [
469469
RuntimeApiMessage,
470470
])]
471471
candidate_validation: CandidateValidation,

0 commit comments

Comments
 (0)