diff --git a/crates/subspace-farmer/src/plotter/cpu.rs b/crates/subspace-farmer/src/plotter/cpu.rs index 5775d69fe8a..e6ac3ad3fe3 100644 --- a/crates/subspace-farmer/src/plotter/cpu.rs +++ b/crates/subspace-farmer/src/plotter/cpu.rs @@ -327,26 +327,24 @@ where let thread_pools = plotting_thread_pool_manager.get_thread_pools().await; let plotting_fn = || { - tokio::task::block_in_place(|| { - let mut sector = Vec::new(); - - let plotted_sector = encode_sector::( - downloaded_sector, - EncodeSectorOptions { - sector_index, - erasure_coding: &erasure_coding, - pieces_in_sector, - sector_output: &mut sector, - table_generators: &mut (0..record_encoding_concurrency.get()) - .map(|_| PosTable::generator()) - .collect::>(), - abort_early: &abort_early, - global_mutex: &global_mutex, - }, - )?; - - Ok((sector, plotted_sector)) - }) + let mut sector = Vec::new(); + + let plotted_sector = encode_sector::( + downloaded_sector, + EncodeSectorOptions { + sector_index, + erasure_coding: &erasure_coding, + pieces_in_sector, + sector_output: &mut sector, + table_generators: &mut (0..record_encoding_concurrency.get()) + .map(|_| PosTable::generator()) + .collect::>(), + abort_early: &abort_early, + global_mutex: &global_mutex, + }, + )?; + + Ok((sector, plotted_sector)) }; let thread_pool = if replotting { @@ -370,7 +368,8 @@ where let encoding_start = Instant::now(); - let plotting_result = thread_pool.install(plotting_fn); + let plotting_result = + tokio::task::block_in_place(|| thread_pool.install(plotting_fn)); match plotting_result { Ok(plotting_result) => {