Update to Substrate master (#311)

* Best effort to bring up to date.

* Fix the executor stuff

* Update verisons.

* Finish fixing

* Final fixes and warnings.

* add some docs and bump Wasm versions

* Fix tests

* Fix final test
This commit is contained in:
Gavin Wood
2019-07-04 17:15:59 +02:00
committed by GitHub
parent 6377974ed7
commit 29ee4e8f3a
24 changed files with 808 additions and 625 deletions
+10 -3
View File
@@ -31,17 +31,20 @@ use client::blockchain::HeaderBackend;
use consensus::SelectChain;
use extrinsic_store::Store as ExtrinsicStore;
use futures::prelude::*;
use log::error;
use primitives::ed25519;
use polkadot_primitives::{Block, BlockId, AuraId};
use polkadot_primitives::parachain::{CandidateReceipt, ParachainHost};
use runtime_primitives::traits::{ProvideRuntimeApi, Header as HeaderT};
use aura::AuraApi;
use tokio::{timer::Interval, runtime::{TaskExecutor, current_thread::Runtime as LocalRuntime}};
use tokio::{timer::Interval, runtime::current_thread::Runtime as LocalRuntime};
use log::{warn, debug};
use super::{Network, Collators};
type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>;
/// Gets a list of the candidates in a block.
pub(crate) fn fetch_candidates<P: BlockBody<Block>>(client: &P, block: &BlockId)
-> ClientResult<Option<impl Iterator<Item=CandidateReceipt>>>
@@ -179,14 +182,18 @@ pub(crate) fn start<C, N, P, SC>(
};
runtime.spawn(notifications);
thread_pool.spawn(prune_old_sessions);
if let Err(_) = thread_pool.execute(Box::new(prune_old_sessions)) {
error!("Failed to spawn old sessions pruning task");
}
let prune_available = prune_unneeded_availability(client, extrinsic_store)
.select(exit.clone())
.then(|_| Ok(()));
// spawn this on the tokio executor since it's fine on a thread pool.
thread_pool.spawn(prune_available);
if let Err(_) = thread_pool.execute(Box::new(prune_available)) {
error!("Failed to spawn available pruning task");
}
if let Err(e) = runtime.block_on(exit) {
debug!("BFT event loop error {:?}", e);