Unverified Commit f2d72cd4 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Master backports (#571)

* Update to latest Substrate master (#570)

* Bump substrate/version (#557)

* Bump version and Substrate (#560)

* Bump version and Substrate

* Bump version and Substrate

* Bump versions

* bump substrate to release specific v0.6.15

* Update lock

* Prepare Polkadot update for Substrate runtime interface 2.0 (#563)

* Prepare Polkadot update for Substrate runtime interface 2.0

* bump substrate to release specific v0.6.15

* Switch to `polkadot-master`

* Version bump

* Master backports

* Bump runtime

* Fix tests

* Fix tests

* Another fix.
parent 88b3fbf5
Pipeline #56664 passed with stages
in 25 minutes and 30 seconds
This diff is collapsed.
......@@ -4,7 +4,7 @@ path = "src/main.rs"
[package]
name = "polkadot"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2018"
......
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-cli"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
......@@ -13,3 +13,7 @@ exit-future = "0.1"
structopt = "0.3.3"
cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
service = { package = "polkadot-service", path = "../service" }
[features]
default = [ "wasmtime" ]
wasmtime = [ "cli/wasmtime" ]
[package]
name = "polkadot-collator"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
......
[package]
name = "polkadot-erasure-coding"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-executor"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
......
[package]
name = "polkadot-network"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
......@@ -23,3 +23,4 @@ substrate-client = { git = "https://github.com/paritytech/substrate", branch = "
[dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......@@ -249,7 +249,7 @@ impl<F, P> ChainContext for (F, P) where
F: Fn(&Hash) -> Option<Known> + Send + Sync,
P: Send + Sync + std::ops::Deref,
P::Target: ProvideRuntimeApi,
<P::Target as ProvideRuntimeApi>::Api: ParachainHost<Block>,
<P::Target as ProvideRuntimeApi>::Api: ParachainHost<Block, Error = ClientError>,
{
fn is_known(&self, block_hash: &Hash) -> Option<Known> {
(self.0)(block_hash)
......@@ -792,9 +792,9 @@ mod tests {
{
let mut message_allowed = validator.message_allowed();
assert!(message_allowed(&peer_a, MessageIntent::Broadcast, &topic_a, &encoded));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_b, &encoded));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_c, &encoded));
assert!(message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_b, &encoded));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_c, &encoded));
}
}
......@@ -900,7 +900,7 @@ mod tests {
{
let mut message_allowed = validator.message_allowed();
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_a, &encoded[..]));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded[..]));
}
validator
......@@ -913,7 +913,7 @@ mod tests {
.note_aware_under_leaf(&hash_a, c_hash);
{
let mut message_allowed = validator.message_allowed();
assert!(message_allowed(&peer_a, MessageIntent::Broadcast, &topic_a, &encoded[..]));
assert!(message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded[..]));
}
}
......@@ -1006,8 +1006,8 @@ mod tests {
}).encode();
let mut allowed = validator.inner.message_allowed();
assert!(allowed(&peer_a, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
}
}
......@@ -1077,8 +1077,8 @@ mod tests {
}).encode();
let mut allowed = validator.inner.message_allowed();
assert!(!allowed(&peer_a, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(!allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
}
// peer A gets updated to the chain head. now we'll attempt to broadcast
......@@ -1115,8 +1115,8 @@ mod tests {
}).encode();
let mut allowed = validator.inner.message_allowed();
assert!(allowed(&peer_a, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast, &root_a_topic, &message[..]));
assert!(allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
}
}
......
......@@ -126,7 +126,7 @@ impl<P, E: Clone, N: NetworkService, T: Clone> Clone for Router<P, E, N, T> {
}
impl<P: ProvideRuntimeApi + Send + Sync + 'static, E, N, T> Router<P, E, N, T> where
P::Api: ParachainHost<Block>,
P::Api: ParachainHost<Block, Error = substrate_client::error::Error>,
N: NetworkService,
T: Clone + Executor + Send + 'static,
E: Future<Item=(),Error=()> + Clone + Send + 'static,
......
......@@ -57,7 +57,7 @@ impl Context<Block> for TestContext {
}
}
fn send_consensus(&mut self, _who: PeerId, _consensus: ConsensusMessage) {
fn send_consensus(&mut self, _who: PeerId, _consensus: Vec<ConsensusMessage>) {
unimplemented!()
}
......
......@@ -34,7 +34,7 @@ use polkadot_primitives::parachain::{
};
use parking_lot::Mutex;
use substrate_client::error::Result as ClientResult;
use substrate_client::runtime_api::{Core, RuntimeVersion, StorageProof, ApiExt};
use sr_api::{Core, RuntimeVersion, StorageProof, ApiExt};
use sr_primitives::traits::{ApiRef, ProvideRuntimeApi};
use std::collections::HashMap;
......@@ -231,6 +231,8 @@ impl Core<Block> for RuntimeApi {
}
impl ApiExt<Block> for RuntimeApi {
type Error = substrate_client::error::Error;
fn map_api_result<F: FnOnce(&Self) -> Result<R, E>, R, E>(
&self,
_: F
......
......@@ -205,7 +205,7 @@ impl<P, E, N, T> ValidationNetwork<P, E, N, T> where N: NetworkService {
/// A long-lived network which can create parachain statement routing processes on demand.
impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
P: ProvideRuntimeApi + Send + Sync + 'static,
P::Api: ParachainHost<Block>,
P::Api: ParachainHost<Block, Error = substrate_client::error::Error>,
E: Clone + Future<Item=(),Error=()> + Send + Sync + 'static,
N: NetworkService,
T: Clone + Executor + Send + Sync + 'static,
......
[package]
name = "polkadot-parachain"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
......
[package]
name = "polkadot-primitives"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......@@ -9,7 +9,7 @@ serde = { version = "1.0", optional = true, features = ["derive"] }
parity-scale-codec = { version = "1.0.5", default-features = false, features = ["bit-vec", "derive"] }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
application-crypto = { package = "substrate-application-crypto", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-client = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
......@@ -26,7 +26,7 @@ default = ["std"]
std = [
"parity-scale-codec/std",
"primitives/std",
"substrate-client/std",
"sr-api/std",
"rstd/std",
"sr-version/std",
"runtime_primitives/std",
......
......@@ -483,7 +483,7 @@ pub struct Status {
pub fee_schedule: FeeSchedule,
}
substrate_client::decl_runtime_apis! {
sr_api::decl_runtime_apis! {
/// The API for querying the state of parachains on-chain.
pub trait ParachainHost {
/// Get the current validators.
......
[package]
name = "polkadot-rpc"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-runtime"
version = "0.6.10"
version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......@@ -16,7 +16,7 @@ serde_derive = { version = "1.0", optional = true }
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe-primitives = { package = "substrate-consensus-babe-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
inherents = { package = "substrate-inherents", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
offchain-primitives = { package = "substrate-offchain-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
......@@ -27,6 +27,8 @@ substrate-primitives = { git = "https://github.com/paritytech/substrate", defaul
substrate-serializer = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
version = { package = "sr-version", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
tx-pool-api = { package = "substrate-transaction-pool-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
block-builder-api = { package = "substrate-block-builder-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
authority-discovery = { package = "srml-authority-discovery", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
authorship = { package = "srml-authorship", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
......@@ -85,7 +87,9 @@ std = [
"inherents/std",
"substrate-primitives/std",
"polkadot-parachain/std",
"client/std",
"sr-api/std",
"tx-pool-api/std",
"block-builder-api/std",
"offchain-primitives/std",
"rstd/std",
"sr-io/std",
......
......@@ -27,7 +27,7 @@ use primitives::{Hash, parachain::{AttestedCandidate, CandidateReceipt, Id as Pa
use sr_primitives::RuntimeDebug;
use sr_staking_primitives::SessionIndex;
use inherents::{ProvideInherent, InherentData, RuntimeString, MakeFatalError, InherentIdentifier};
use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier};
use system::ensure_none;
/// Parachain blocks included in a recent relay-chain block.
......@@ -178,7 +178,7 @@ pub type InherentType = MoreAttestations;
impl<T: Trait> ProvideInherent for Module<T> {
type Call = Call<T>;
type Error = MakeFatalError<RuntimeString>;
type Error = MakeFatalError<inherents::Error>;
const INHERENT_IDENTIFIER: InherentIdentifier = MORE_ATTESTATIONS_IDENTIFIER;
fn create_inherent(data: &InherentData) -> Option<Self::Call> {
......
......@@ -17,7 +17,7 @@
//! Module to process claims from Ethereum addresses.
use rstd::prelude::*;
use sr_io::{keccak_256, secp256k1_ecdsa_recover};
use sr_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
use srml_support::{decl_event, decl_storage, decl_module};
use srml_support::traits::{Currency, Get};
use system::ensure_none;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment