node: spawn block authoring and grandpa voter as blocking tasks (#6446)

* service: add spawner for essential tasks

* node: spawn block authoring and grandpa voter as blocking tasks

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
André Silva
2020-06-21 11:34:38 +01:00
committed by GitHub
parent 36d2eefdc9
commit 7653b5592c
4 changed files with 79 additions and 7 deletions
+3 -3
View File
@@ -217,7 +217,7 @@ macro_rules! new_full {
};
let babe = sc_consensus_babe::start_babe(babe_config)?;
service.spawn_essential_task("babe-proposer", babe);
service.spawn_essential_task_handle().spawn_blocking("babe-proposer", babe);
}
// Spawn authority discovery module.
@@ -250,7 +250,7 @@ macro_rules! new_full {
service.prometheus_registry(),
);
service.spawn_task("authority-discovery", authority_discovery);
service.spawn_task_handle().spawn("authority-discovery", authority_discovery);
}
// if the node isn't actively participating in consensus then it doesn't
@@ -292,7 +292,7 @@ macro_rules! new_full {
// the GRANDPA voter task is considered infallible, i.e.
// if it fails we take down the service with it.
service.spawn_essential_task(
service.spawn_essential_task_handle().spawn_blocking(
"grandpa-voter",
grandpa::run_grandpa_voter(grandpa_config)?
);