Small slots refactor (#2780)

* Deprecate SlotWorker::on_start

* start_slot_worker no longer needs an Arc

* start_slot_worker now always succeeds

* Removed on_exit parameter from start_*_worker

* Minor doc

* Fix node-template
This commit is contained in:
Pierre Krieger authored and DemiMarie-parity committed 2019-06-05 10:31:20 -04:00
1 parent eaa0ab014a
commit 67bdfc7d8e
5 files changed
+73 -117

No files matched your search

+4 -3
View File
@@ -26,6 +26,7 @@ use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, Nothing
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
use node_executor;
use primitives::{Pair as PairT, ed25519};
use futures::prelude::*;
use node_primitives::Block;
use node_runtime::{GenesisConfig, RuntimeApi};
use substrate_service::{
@@ -92,7 +93,7 @@ construct_service_factory! {
let client = service.client();
let select_chain = service.select_chain()
.ok_or(ServiceError::SelectChainRequired)?;
executor.spawn(start_aura(
let aura = start_aura(
SlotDuration::get_or_compute(&*client)?,
key.clone(),
client,
@@ -100,10 +101,10 @@ construct_service_factory! {
block_import.clone(),
proposer,
service.network(),
service.on_exit(),
service.config.custom.inherent_data_providers.clone(),
service.config.force_authoring,
)?);
)?;
executor.spawn(aura.select(service.on_exit()).then(|_| Ok(())));
info!("Running Grandpa session as Authority {}", key.public());
}