Bump to latest Substrate (#898)

* Flag to force kusama runtime

* Chainspecs for kusama

* Polkadot config for westend

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* network/src/legacy/gossip: Wrap GossipEngine in Arc Mutex & lock it on use

`GossipEngine` in itself has no need to be Send and Sync, given that it
does not rely on separately spawned background tasks anymore.
`RegisteredMessageValidator` needs to be `Send` and `Sync` due to the
inherited trait bounds from implementing `GossipService`. In addition
`RegisteredMessageValidator` derives `Clone`. Thereby `GossipEngine`
needs to be wrapped in an `Arc` and `Mutex` to keep the status quo.

* Needed fixes.

* Fixes

* Fixed build

* Fixed build w benchmarking CLI

* Fixed building tests

* Added --dev shortcut

Co-authored-by: arkpar <arkady.paronyan@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Gavin Wood
2020-03-13 14:43:31 +01:00
committed by GitHub
parent 9bbaf34cde
commit 1ddfb5c4e1
14 changed files with 4659 additions and 4225 deletions
+5 -11
View File
@@ -32,6 +32,7 @@ use log::info;
pub use service::{
AbstractService, Roles, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis, ServiceBuilderCommand,
TFullClient, TLightClient, TFullBackend, TLightBackend, TFullCallExecutor, TLightCallExecutor,
Configuration, ChainSpec,
};
pub use service::config::{DatabaseConfig, PrometheusConfig, full_version_from_strs};
pub use sc_executor::NativeExecutionDispatch;
@@ -43,7 +44,7 @@ pub use consensus_common::SelectChain;
pub use polkadot_primitives::parachain::{CollatorId, ParachainHost};
pub use polkadot_primitives::Block;
pub use sp_runtime::traits::{Block as BlockT, self as runtime_traits, BlakeTwo256};
pub use chain_spec::ChainSpec;
pub use chain_spec::{PolkadotChainSpec, KusamaChainSpec};
#[cfg(not(target_os = "unknown"))]
pub use consensus::run_validation_worker;
pub use codec::Codec;
@@ -51,14 +52,6 @@ pub use polkadot_runtime;
pub use kusama_runtime;
use prometheus_endpoint::Registry;
/// Configuration type that is being used.
///
/// See [`ChainSpec`] for more information why Polkadot `GenesisConfig` is safe here.
pub type Configuration = service::Configuration<
polkadot_runtime::GenesisConfig,
chain_spec::Extensions,
>;
native_executor_instance!(
pub PolkadotExecutor,
polkadot_runtime::api::dispatch,
@@ -121,9 +114,9 @@ pub trait IsKusama {
fn is_kusama(&self) -> bool;
}
impl IsKusama for ChainSpec {
impl IsKusama for &dyn ChainSpec {
fn is_kusama(&self) -> bool {
self.name().starts_with("Kusama")
self.id().starts_with("kusama") || self.id().starts_with("ksm")
}
}
@@ -453,6 +446,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(
sentry_nodes,
service.keystore(),
dht_event_stream,
service.prometheus_registry(),
);
service.spawn_task("authority-discovery", authority_discovery);
}