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

Commit

Permalink
Companion of paritytech/substrate#10196, !
Browse files Browse the repository at this point in the history
  • Loading branch information
AurevoirXavier committed Aug 4, 2022
1 parent b4d6b35 commit 1403bf9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
22 changes: 18 additions & 4 deletions node/service/src/service/dvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ where
// Spawn Frontier FeeHistory cache maintenance task.
task_manager.spawn_essential_handle().spawn(
"frontier-fee-history",
// TODO: cc @AsceticBear
Some("frontier-fee-history"),
EthTask::fee_history_task(
client.clone(),
overrides.clone(),
Expand All @@ -106,6 +108,8 @@ where
// Spawn mapping sync worker task.
task_manager.spawn_essential_handle().spawn(
"frontier-mapping-sync-worker",
// TODO: cc @AsceticBear
Some("frontier-mapping-sync"),
MappingSyncWorker::new(
client.import_notification_stream(),
Duration::new(6, 0),
Expand All @@ -124,6 +128,8 @@ where
const FILTER_RETAIN_THRESHOLD: u64 = 100;
task_manager.spawn_essential_handle().spawn(
"frontier-filter-pool",
// TODO: cc @AsceticBear
Some("frontier-filter-pool"),
EthTask::filter_pool_task(client.clone(), filter_pool, FILTER_RETAIN_THRESHOLD),
);
}
Expand Down Expand Up @@ -164,15 +170,23 @@ where
// `trace_filter` cache task. Essential.
// Proxies rpc requests to it's handler.
if let Some(trace_filter_task) = trace_filter_task {
task_manager
.spawn_essential_handle()
.spawn("trace-filter-cache", trace_filter_task);
task_manager.spawn_essential_handle().spawn(
"trace-filter-cache",
// TODO: cc @AsceticBear
Some("trace-filter-cache"),
trace_filter_task,
);
}

// `debug` task if enabled. Essential.
// Proxies rpc requests to it's handler.
if let Some(debug_task) = debug_task {
task_manager.spawn_essential_handle().spawn("ethapi-debug", debug_task);
task_manager.spawn_essential_handle().spawn(
"ethapi-debug",
// TODO: cc @AsceticBear
Some("ethapi-debug"),
debug_task,
);
}

EthRpcRequesters { debug: debug_requester, trace: trace_filter_requester }
Expand Down
13 changes: 8 additions & 5 deletions node/service/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ where
};
let babe = sc_consensus_babe::start_babe(babe_config)?;

task_manager.spawn_essential_handle().spawn_blocking("babe", babe);
task_manager.spawn_essential_handle().spawn_blocking("babe", None, babe);
}

if is_authority && !authority_discovery_disabled {
Expand All @@ -374,9 +374,11 @@ where
prometheus_registry.clone(),
);

task_manager
.spawn_handle()
.spawn("authority-discovery-worker", authority_discovery_worker.run());
task_manager.spawn_handle().spawn(
"authority-discovery-worker",
Some("authority-discovery"),
authority_discovery_worker.run(),
);
}

let keystore = if is_authority { Some(keystore_container.sync_keystore()) } else { None };
Expand Down Expand Up @@ -416,6 +418,7 @@ where

task_manager.spawn_essential_handle().spawn_blocking(
"grandpa-voter",
None,
sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
);
}
Expand Down Expand Up @@ -501,7 +504,7 @@ where
executor,
)?;
let telemetry = telemetry.map(|(worker, telemetry)| {
task_manager.spawn_handle().spawn("telemetry", worker.run());
task_manager.spawn_handle().spawn("telemetry", Some("telemetry"), worker.run());
telemetry
});
let client = Arc::new(client);
Expand Down
12 changes: 10 additions & 2 deletions node/service/src/service/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ pub fn new_full(
},
});
// we spawn the future on a background thread managed by service.
task_manager.spawn_essential_handle().spawn_blocking("manual-seal", authorship_future);
task_manager.spawn_essential_handle().spawn_blocking(
"manual-seal",
None,
authorship_future,
);
} else {
let authorship_future = manual_seal::run_instant_seal(InstantSealParams {
block_import,
Expand All @@ -294,7 +298,11 @@ pub fn new_full(
},
});
// we spawn the future on a background thread managed by service.
task_manager.spawn_essential_handle().spawn_blocking("instant-seal", authorship_future);
task_manager.spawn_essential_handle().spawn_blocking(
"instant-seal",
None,
authorship_future,
);
}

log::info!("Manual Seal Ready");
Expand Down

0 comments on commit 1403bf9

Please sign in to comment.