Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion PR for #5647 #1035

Merged
merged 11 commits into from
Apr 29, 2020
8 changes: 6 additions & 2 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ macro_rules! new_full_start {
let pool = sc_transaction_pool::BasicPool::new(config, std::sync::Arc::new(pool_api), prometheus_registry);
Ok(pool)
})?
.with_import_queue(|config, client, mut select_chain, _| {
.with_import_queue(|config, client, mut select_chain, _, spawn_task_handle| {
let select_chain = select_chain.take()
.ok_or_else(|| service::Error::SelectChainRequired)?;

Expand All @@ -189,13 +189,15 @@ macro_rules! new_full_start {
client.clone(),
)?;

let spawner = |future| spawn_task_handle.spawn_blocking("import-queue-worker", future);
let import_queue = babe::import_queue(
babe_link.clone(),
block_import.clone(),
Some(Box::new(justification_import)),
None,
client,
inherent_data_providers.clone(),
spawner,
)?;

import_setup = Some((block_import, grandpa_link, babe_link));
Expand Down Expand Up @@ -726,7 +728,7 @@ where
);
Ok(pool)
})?
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _| {
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _, spawn_task_handle| {
let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
Expand All @@ -744,6 +746,7 @@ where
client.clone(),
)?;

let spawner = |future| spawn_task_handle.spawn_blocking("import-queue-worker", future);
// FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`.
let import_queue = babe::import_queue(
babe_link,
Expand All @@ -752,6 +755,7 @@ where
Some(Box::new(finality_proof_import)),
client,
inherent_data_providers.clone(),
spawner,
)?;

Ok((import_queue, finality_proof_request_builder))
Expand Down