Skip to content

Commit

Permalink
Run replay in spawn_fifo to avoid clogging main runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Dentosal committed Feb 12, 2025
1 parent 0a1b16a commit aaaa57b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/services/producer/src/block_producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ where
) -> anyhow::Result<Vec<StorageReadReplayEvent>> {
let view = self.view_provider.latest_view()?;

let executor = self.executor.clone();
let block = view.get_full_block(&height)?;
Ok(self.executor.storage_read_replay(&block)?)

// use the blocking threadpool to avoid clogging up the main async runtime
tokio_rayon::spawn_fifo(move || Ok(executor.storage_read_replay(&block)?)).await
}
}

Expand Down

0 comments on commit aaaa57b

Please sign in to comment.