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
@@ -142,7 +142,7 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
// the AURA authoring task is considered essential, i.e. if it
// fails we take down the service with it.
service.spawn_essential_task("aura", aura);
service.spawn_essential_task_handle().spawn_blocking("aura", aura);
}
// if the node isn't actively participating in consensus then it doesn't
@@ -184,7 +184,7 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
// 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",
sc_finality_grandpa::run_grandpa_voter(grandpa_config)?
);