Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions node-template/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
service.keystore(),
)?;

let select = aura.select(service.on_exit()).then(|_| Ok(()));
let aura = aura.select(service.on_exit()).then(|_| Ok(()));

// the AURA authoring task is considered essential, i.e. if it
// fails we take down the service with it.
service.spawn_essential_task(select);
service.spawn_essential_task(aura);
}

let grandpa_config = grandpa::Config {
Expand All @@ -133,12 +133,12 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
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(
grandpa_config,
grandpa_link,
service.network(),
service.on_exit(),
)?));
)?);
},
(true, false) => {
// start the full GRANDPA voter
Expand Down
9 changes: 6 additions & 3 deletions node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ macro_rules! new_full {
service.network(),
dht_event_rx,
);

service.spawn_task(authority_discovery);
}

Expand All @@ -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
Expand All @@ -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(
Expand Down