Update Substrate (#808)

* Update to latest Substrate master

* upgrade decl_storage declaration

* Companion PR to Substrate#4752

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Gavin Wood
2020-01-29 20:46:51 +01:00
committed by GitHub
parent ed8a4c29bb
commit 6c32055fbe
11 changed files with 615 additions and 350 deletions
+15 -12
View File
@@ -18,7 +18,11 @@
pub mod chain_spec;
use futures::{FutureExt, compat::Future01CompatExt};
use futures::{
FutureExt, TryFutureExt,
task::{Spawn, SpawnError, FutureObj},
compat::Future01CompatExt,
};
use sc_client::LongestChain;
use std::sync::Arc;
use std::time::Duration;
@@ -172,9 +176,7 @@ macro_rules! new_full_start {
.with_transaction_pool(|config, client, _fetcher| {
let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
let pool = sc_transaction_pool::BasicPool::new(config, pool_api);
let maintainer = sc_transaction_pool::FullBasicPoolMaintainer::new(pool.pool().clone(), client);
let maintainable_pool = sp_transaction_pool::MaintainableTransactionPool::new(pool, maintainer);
Ok(maintainable_pool)
Ok(pool)
})?
.with_import_queue(|_config, client, mut select_chain, _| {
let select_chain = select_chain.take()
@@ -400,7 +402,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)
max_block_data_size,
}.build();
service.spawn_essential_task(Box::pin(validation_service));
service.spawn_essential_task("validation-service", Box::pin(validation_service));
let proposer = consensus::ProposerFactory::new(
client.clone(),
@@ -435,7 +437,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)
};
let babe = babe::start_babe(babe_config)?;
service.spawn_essential_task(babe);
service.spawn_essential_task("babe", babe);
if authority_discovery_enabled {
let network = service.network();
@@ -451,7 +453,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)
service.keystore(),
dht_event_stream,
);
service.spawn_task(authority_discovery);
service.spawn_task("authority-discovery", authority_discovery);
}
}
@@ -493,7 +495,8 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)
};
service.spawn_essential_task(
grandpa::run_grandpa_voter(grandpa_config)?.compat().map(drop)
"grandpa-voter",
grandpa::run_grandpa_voter(grandpa_config)?
);
} else {
grandpa::setup_disabled_grandpa(
@@ -585,10 +588,10 @@ where
let fetcher = fetcher
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone());
let pool = sc_transaction_pool::BasicPool::new(config, pool_api);
let maintainer = sc_transaction_pool::LightBasicPoolMaintainer::with_defaults(pool.pool().clone(), client, fetcher);
let maintainable_pool = sp_transaction_pool::MaintainableTransactionPool::new(pool, maintainer);
Ok(maintainable_pool)
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
config, pool_api, sc_transaction_pool::RevalidationType::Light,
);
Ok(pool)
})?
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _| {
let fetch_checker = fetcher