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
+18 -11
View File
@@ -29,13 +29,18 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
let mut config = service::Configuration::from_version(&version);
config.impl_name = "parity-polkadot";
let force_kusama = opt.run.force_kusama;
match opt.subcommand {
None => {
opt.run.init(&version)?;
opt.run.update_config(&mut config, load_spec, &version)?;
opt.run.base.init(&version)?;
opt.run.base.update_config(
&mut config,
|id| load_spec(id, force_kusama),
&version
)?;
let is_kusama = config.chain_spec.as_ref().map_or(false, |s| s.is_kusama());
let is_kusama = config.expect_chain_spec().is_kusama();
info!("{}", version.name);
info!(" version {}", config.full_version());
@@ -69,9 +74,13 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
},
Some(Subcommand::Base(cmd)) => {
cmd.init(&version)?;
cmd.update_config(&mut config, load_spec, &version)?;
cmd.update_config(
&mut config,
|id| load_spec(id, force_kusama),
&version
)?;
let is_kusama = config.chain_spec.as_ref().map_or(false, |s| s.is_kusama());
let is_kusama = config.expect_chain_spec().is_kusama();
if is_kusama {
cmd.run(config, service::new_chain_ops::<
@@ -100,14 +109,12 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
},
Some(Subcommand::Benchmark(cmd)) => {
cmd.init(&version)?;
cmd.update_config(&mut config, load_spec, &version)?;
let is_kusama = config.chain_spec.as_ref().map_or(false, |s| s.is_kusama());
cmd.update_config(&mut config, |id| load_spec(id, force_kusama), &version)?;
let is_kusama = config.expect_chain_spec().is_kusama();
if is_kusama {
cmd.run::<_, _, service::kusama_runtime::Block, service::KusamaExecutor>(config)
cmd.run::<service::kusama_runtime::Block, service::KusamaExecutor>(config)
} else {
cmd.run::<_, _, service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
}
},
}