Check in block authoring that we can author with current authoring version (#4201)

* Check in block authoring that we can author with current authoring version

* Update client/consensus/pow/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Fix compilation
This commit is contained in:
Bastian Köcher
2019-11-29 11:01:11 +01:00
committed by GitHub
parent 0b52f194f5
commit accc678640
18 changed files with 187 additions and 62 deletions
+1
View File
@@ -29,6 +29,7 @@ txpool-api = { package = "sp-transaction-pool-api", path = "../../primitives/tra
network = { package = "substrate-network", path = "../../client/network" }
aura = { package = "substrate-consensus-aura", path = "../../client/consensus/aura" }
aura-primitives = { package = "substrate-consensus-aura-primitives", path = "../../primitives/consensus/aura" }
consensus-common = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
grandpa = { package = "substrate-finality-grandpa", path = "../../client/finality-grandpa" }
grandpa-primitives = { package = "substrate-finality-grandpa-primitives", path = "../../primitives/finality-grandpa" }
substrate-client = { path = "../../client/" }
+5 -1
View File
@@ -111,7 +111,10 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
let select_chain = service.select_chain()
.ok_or(ServiceError::SelectChainRequired)?;
let aura = aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
let can_author_with =
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
let aura = aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _, _>(
aura::SlotDuration::get_or_compute(&*client)?,
client,
select_chain,
@@ -121,6 +124,7 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
inherent_data_providers.clone(),
force_authoring,
service.keystore(),
can_author_with,
)?;
// the AURA authoring task is considered essential, i.e. if it
+1 -1
View File
@@ -61,6 +61,7 @@ substrate-basic-authorship = { path = "../../../client/basic-authorship" }
substrate-service = { path = "../../../client/service", default-features = false }
substrate-telemetry = { package = "substrate-telemetry", path = "../../../client/telemetry" }
authority-discovery = { package = "substrate-authority-discovery", path = "../../../client/authority-discovery"}
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
# frame dependencies
indices = { package = "pallet-indices", path = "../../../frame/indices" }
@@ -99,7 +100,6 @@ rand6 = { package = "rand", version = "0.6", features = ["wasm-bindgen"], option
[dev-dependencies]
keystore = { package = "substrate-keystore", path = "../../../client/keystore" }
babe = { package = "substrate-consensus-babe", path = "../../../client/consensus/babe", features = ["test-helpers"] }
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
service-test = { package = "substrate-service-test", path = "../../../client/service/test" }
futures = "0.3.1"
tempfile = "3.1.0"
+4
View File
@@ -169,6 +169,9 @@ macro_rules! new_full {
let select_chain = service.select_chain()
.ok_or(substrate_service::Error::SelectChainRequired)?;
let can_author_with =
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
let babe_config = babe::BabeParams {
keystore: service.keystore(),
client,
@@ -179,6 +182,7 @@ macro_rules! new_full {
inherent_data_providers: inherent_data_providers.clone(),
force_authoring,
babe_link,
can_author_with,
};
let babe = babe::start_babe(babe_config)?;