Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'parity/master' into ashley-overseer-gos…
Browse files Browse the repository at this point in the history
…sip-testing
  • Loading branch information
expenses committed Jun 2, 2020
2 parents f111fae + 0ceb54e commit c42511d
Show file tree
Hide file tree
Showing 49 changed files with 13,194 additions and 1,187 deletions.
974 changes: 510 additions & 464 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ path = "src/main.rs"

[package]
name = "polkadot"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion availability-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-cli"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node"
edition = "2018"
Expand Down
17 changes: 16 additions & 1 deletion cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ use sc_executor::NativeExecutionDispatch;
use sc_cli::{SubstrateCli, Result};
use crate::cli::{Cli, Subcommand};

fn get_exec_name() -> Option<String> {
std::env::current_exe()
.ok()
.and_then(|pb| pb.file_name().map(|s| s.to_os_string()))
.and_then(|s| s.into_string().ok())
}

impl SubstrateCli for Cli {
fn impl_name() -> &'static str { "Parity Polkadot" }

Expand All @@ -36,15 +43,23 @@ impl SubstrateCli for Cli {
fn executable_name() -> &'static str { "polkadot" }

fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
let id = if id == "" {
let n = get_exec_name().unwrap_or_default();
["polkadot", "kusama", "westend"].iter()
.cloned()
.find(|&chain| n.starts_with(chain))
.unwrap_or("polkadot")
} else { id };
Ok(match id {
"polkadot-dev" | "dev" => Box::new(service::chain_spec::polkadot_development_config()),
"polkadot-local" => Box::new(service::chain_spec::polkadot_local_testnet_config()),
"polkadot-staging" => Box::new(service::chain_spec::polkadot_staging_testnet_config()),
"kusama-dev" => Box::new(service::chain_spec::kusama_development_config()),
"kusama-local" => Box::new(service::chain_spec::kusama_local_testnet_config()),
"kusama-staging" => Box::new(service::chain_spec::kusama_staging_testnet_config()),
"polkadot" => Box::new(service::chain_spec::polkadot_config()?),
"westend" => Box::new(service::chain_spec::westend_config()?),
"kusama" | "" => Box::new(service::chain_spec::kusama_config()?),
"kusama" => Box::new(service::chain_spec::kusama_config()?),
"westend-dev" => Box::new(service::chain_spec::westend_development_config()),
"westend-local" => Box::new(service::chain_spec::westend_local_testnet_config()),
"westend-staging" => Box::new(service::chain_spec::westend_staging_testnet_config()),
Expand Down
2 changes: 1 addition & 1 deletion collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-collator"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
Expand Down
3 changes: 2 additions & 1 deletion collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use std::pin::Pin;
use futures::{future, Future, Stream, FutureExt, TryFutureExt, StreamExt, task::Spawn};
use log::warn;
use sc_client_api::{StateBackend, BlockchainEvents};
use sp_blockchain::HeaderBackend;
use sp_core::Pair;
use polkadot_primitives::{
BlockId, Hash, Block,
Expand Down Expand Up @@ -128,7 +129,7 @@ pub trait BuildParachainContext {
network: impl Network + Clone + 'static,
) -> Result<Self::ParachainContext, ()>
where
Client: ProvideRuntimeApi<Block> + Send + Sync + BlockchainEvents<Block> + 'static,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockchainEvents<Block> + Send + Sync + 'static,
Client::Api: RuntimeApiCollection<Extrinsic>,
<Client::Api as ApiExt<Block>>::StateBackend: StateBackend<HashFor<Block>>,
Extrinsic: codec::Codec + Send + Sync + 'static,
Expand Down
2 changes: 1 addition & 1 deletion erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-erasure-coding"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-network"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
Expand Down
11 changes: 9 additions & 2 deletions network/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,10 @@ impl ProtocolHandler {
}

fn on_connect(&mut self, peer: PeerId, role: ObservedRole) {
let claimed_validator = matches!(role, ObservedRole::OurSentry | ObservedRole::OurGuardedAuthority | ObservedRole::Authority);
let claimed_validator = matches!(
role,
ObservedRole::OurSentry | ObservedRole::OurGuardedAuthority | ObservedRole::Authority
);

self.peers.insert(peer.clone(), PeerData {
claimed_validator,
Expand Down Expand Up @@ -976,7 +979,11 @@ impl<Api, Sp, Gossip> Worker<Api, Sp, Gossip> where
);
}
ServiceToWorkerMsg::AwaitCollation(relay_parent, para_id, sender) => {
debug!(target: "p_net", "Attempting to get collation for parachain {:?} on relay parent {:?}", para_id, relay_parent);
debug!(
target: "p_net", "Attempting to get collation for parachain {:?} on relay parent {:?}",
para_id,
relay_parent,
);
self.protocol_handler.await_collation(relay_parent, para_id, sender)
}
ServiceToWorkerMsg::NoteBadCollator(collator) => {
Expand Down
2 changes: 1 addition & 1 deletion network/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-network-test"
version = "0.8.0"
version = "0.8.2"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-parachain"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachain-adder"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
.with_wasm_builder_from_crates("1.0.10")
.with_wasm_builder_from_crates("1.0.11")
.export_heap_base()
.build()
}
2 changes: 1 addition & 1 deletion parachain/test-parachains/code-upgrader/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
.with_wasm_builder_from_crates("1.0.10")
.with_wasm_builder_from_crates("1.0.11")
.export_heap_base()
.build()
}
2 changes: 1 addition & 1 deletion parachain/test-parachains/halt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachain-halt"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/halt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
.with_wasm_builder_from_crates("1.0.10")
.with_wasm_builder_from_crates("1.0.11")
.export_heap_base()
.build()
}
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-primitives"
version = "0.7.34-dev"
version = "0.8.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
Loading

0 comments on commit c42511d

Please sign in to comment.