diff --git a/node-template/src/service.rs b/node-template/src/service.rs index 79343558124f9..c46928c10ef76 100644 --- a/node-template/src/service.rs +++ b/node-template/src/service.rs @@ -115,11 +115,11 @@ pub fn new_full(config: Configuration(config: Configuration { // start the lightweight GRANDPA observer - service.spawn_task(Box::new(grandpa::run_grandpa_observer( + service.spawn_task(grandpa::run_grandpa_observer( grandpa_config, grandpa_link, service.network(), service.on_exit(), - )?)); + )?); }, (true, false) => { // start the full GRANDPA voter diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 983908c07da5e..0f4a098f3d08d 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -175,6 +175,7 @@ macro_rules! new_full { service.network(), dht_event_rx, ); + service.spawn_task(authority_discovery); } @@ -189,12 +190,12 @@ macro_rules! new_full { match (is_authority, disable_grandpa) { (false, false) => { // start the lightweight GRANDPA observer - service.spawn_task(Box::new(grandpa::run_grandpa_observer( + service.spawn_task(grandpa::run_grandpa_observer( config, grandpa_link, service.network(), service.on_exit(), - )?)); + )?); }, (true, false) => { // start the full GRANDPA voter @@ -207,7 +208,9 @@ macro_rules! new_full { telemetry_on_connect: Some(service.telemetry_on_connect_stream()), voting_rule: grandpa::VotingRulesBuilder::default().build(), }; - service.spawn_task(Box::new(grandpa::run_grandpa_voter(grandpa_config)?)); + // the GRANDPA voter task is considered infallible, i.e. + // if it fails we take down the service with it. + service.spawn_essential_task(grandpa::run_grandpa_voter(grandpa_config)?); }, (_, true) => { grandpa::setup_disabled_grandpa(