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.
This commit is contained in:
Gavin Wood
2019-11-12 02:10:02 +01:00
committed by GitHub
parent 40f1d22cd8
commit cc0e775810
33 changed files with 971 additions and 371 deletions
+861 -296
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,7 +4,7 @@ path = "src/main.rs"
[package] [package]
name = "polkadot" name = "polkadot"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs" build = "build.rs"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "polkadot-availability-store" name = "polkadot-availability-store"
description = "Persistent database for parachain data" description = "Persistent database for parachain data"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+5 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-cli" name = "polkadot-cli"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust." description = "Polkadot node implementation in Rust."
edition = "2018" edition = "2018"
@@ -13,3 +13,7 @@ exit-future = "0.1"
structopt = "0.3.3" structopt = "0.3.3"
cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
service = { package = "polkadot-service", path = "../service" } service = { package = "polkadot-service", path = "../service" }
[features]
default = [ "wasmtime" ]
wasmtime = [ "cli/wasmtime" ]
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-collator" name = "polkadot-collator"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation" description = "Collator node implementation"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-erasure-coding" name = "polkadot-erasure-coding"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-executor" name = "polkadot-executor"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust." description = "Polkadot node implementation in Rust."
edition = "2018" edition = "2018"
+2 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-network" name = "polkadot-network"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol" description = "Polkadot-specific networking protocol"
edition = "2018" edition = "2018"
@@ -23,3 +23,4 @@ substrate-client = { git = "https://github.com/paritytech/substrate", branch = "
[dev-dependencies] [dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
+12 -12
View File
@@ -249,7 +249,7 @@ impl<F, P> ChainContext for (F, P) where
F: Fn(&Hash) -> Option<Known> + Send + Sync, F: Fn(&Hash) -> Option<Known> + Send + Sync,
P: Send + Sync + std::ops::Deref, P: Send + Sync + std::ops::Deref,
P::Target: ProvideRuntimeApi, 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> { fn is_known(&self, block_hash: &Hash) -> Option<Known> {
(self.0)(block_hash) (self.0)(block_hash)
@@ -792,9 +792,9 @@ mod tests {
{ {
let mut message_allowed = validator.message_allowed(); 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));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_b, &encoded)); assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_b, &encoded));
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_c, &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(); 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 validator
@@ -913,7 +913,7 @@ mod tests {
.note_aware_under_leaf(&hash_a, c_hash); .note_aware_under_leaf(&hash_a, c_hash);
{ {
let mut message_allowed = validator.message_allowed(); 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(); }).encode();
let mut allowed = validator.inner.message_allowed(); let mut allowed = validator.inner.message_allowed();
assert!(allowed(&peer_a, 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, &root_a_topic, &message[..])); assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
} }
} }
@@ -1077,8 +1077,8 @@ mod tests {
}).encode(); }).encode();
let mut allowed = validator.inner.message_allowed(); let mut allowed = validator.inner.message_allowed();
assert!(!allowed(&peer_a, 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, &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 // peer A gets updated to the chain head. now we'll attempt to broadcast
@@ -1115,8 +1115,8 @@ mod tests {
}).encode(); }).encode();
let mut allowed = validator.inner.message_allowed(); let mut allowed = validator.inner.message_allowed();
assert!(allowed(&peer_a, 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, &root_a_topic, &message[..])); assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
} }
} }
+1 -1
View File
@@ -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 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, N: NetworkService,
T: Clone + Executor + Send + 'static, T: Clone + Executor + Send + 'static,
E: Future<Item=(),Error=()> + Clone + Send + 'static, E: Future<Item=(),Error=()> + Clone + Send + 'static,
+1 -1
View File
@@ -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!() unimplemented!()
} }
+3 -1
View File
@@ -34,7 +34,7 @@ use polkadot_primitives::parachain::{
}; };
use parking_lot::Mutex; use parking_lot::Mutex;
use substrate_client::error::Result as ClientResult; 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 sr_primitives::traits::{ApiRef, ProvideRuntimeApi};
use std::collections::HashMap; use std::collections::HashMap;
@@ -231,6 +231,8 @@ impl Core<Block> for RuntimeApi {
} }
impl ApiExt<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>( fn map_api_result<F: FnOnce(&Self) -> Result<R, E>, R, E>(
&self, &self,
_: F _: F
+1 -1
View File
@@ -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. /// 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 impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
P: ProvideRuntimeApi + Send + Sync + 'static, 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, E: Clone + Future<Item=(),Error=()> + Send + Sync + 'static,
N: NetworkService, N: NetworkService,
T: Clone + Executor + Send + Sync + 'static, T: Clone + Executor + Send + Sync + 'static,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-parachain" name = "polkadot-parachain"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains" description = "Types and utilities for creating and working with parachains"
edition = "2018" edition = "2018"
+3 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-primitives" name = "polkadot-primitives"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" 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"] } 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" } 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" } 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" } 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" } 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" } runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
@@ -26,7 +26,7 @@ default = ["std"]
std = [ std = [
"parity-scale-codec/std", "parity-scale-codec/std",
"primitives/std", "primitives/std",
"substrate-client/std", "sr-api/std",
"rstd/std", "rstd/std",
"sr-version/std", "sr-version/std",
"runtime_primitives/std", "runtime_primitives/std",
+1 -1
View File
@@ -483,7 +483,7 @@ pub struct Status {
pub fee_schedule: FeeSchedule, pub fee_schedule: FeeSchedule,
} }
substrate_client::decl_runtime_apis! { sr_api::decl_runtime_apis! {
/// The API for querying the state of parachains on-chain. /// The API for querying the state of parachains on-chain.
pub trait ParachainHost { pub trait ParachainHost {
/// Get the current validators. /// Get the current validators.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-rpc" name = "polkadot-rpc"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+7 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-runtime" name = "polkadot-runtime"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" 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" } 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" } 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" } 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" } 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" } 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-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" } 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" } 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" } 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" } authorship = { package = "srml-authorship", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
@@ -85,7 +87,9 @@ std = [
"inherents/std", "inherents/std",
"substrate-primitives/std", "substrate-primitives/std",
"polkadot-parachain/std", "polkadot-parachain/std",
"client/std", "sr-api/std",
"tx-pool-api/std",
"block-builder-api/std",
"offchain-primitives/std", "offchain-primitives/std",
"rstd/std", "rstd/std",
"sr-io/std", "sr-io/std",
+2 -2
View File
@@ -27,7 +27,7 @@ use primitives::{Hash, parachain::{AttestedCandidate, CandidateReceipt, Id as Pa
use sr_primitives::RuntimeDebug; use sr_primitives::RuntimeDebug;
use sr_staking_primitives::SessionIndex; use sr_staking_primitives::SessionIndex;
use inherents::{ProvideInherent, InherentData, RuntimeString, MakeFatalError, InherentIdentifier}; use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier};
use system::ensure_none; use system::ensure_none;
/// Parachain blocks included in a recent relay-chain block. /// Parachain blocks included in a recent relay-chain block.
@@ -178,7 +178,7 @@ pub type InherentType = MoreAttestations;
impl<T: Trait> ProvideInherent for Module<T> { impl<T: Trait> ProvideInherent for Module<T> {
type Call = Call<T>; type Call = Call<T>;
type Error = MakeFatalError<RuntimeString>; type Error = MakeFatalError<inherents::Error>;
const INHERENT_IDENTIFIER: InherentIdentifier = MORE_ATTESTATIONS_IDENTIFIER; const INHERENT_IDENTIFIER: InherentIdentifier = MORE_ATTESTATIONS_IDENTIFIER;
fn create_inherent(data: &InherentData) -> Option<Self::Call> { fn create_inherent(data: &InherentData) -> Option<Self::Call> {
+1 -1
View File
@@ -17,7 +17,7 @@
//! Module to process claims from Ethereum addresses. //! Module to process claims from Ethereum addresses.
use rstd::prelude::*; 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::{decl_event, decl_storage, decl_module};
use srml_support::traits::{Currency, Get}; use srml_support::traits::{Currency, Get};
use system::ensure_none; use system::ensure_none;
+10 -12
View File
@@ -35,10 +35,6 @@ use primitives::{
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment, AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
parachain::{self, ActiveParas}, ValidityError, parachain::{self, ActiveParas}, ValidityError,
}; };
use client::{
block_builder::api::{self as block_builder_api, InherentData, CheckInherentsResult},
runtime_api as client_api, impl_runtime_apis,
};
use sr_primitives::{ use sr_primitives::{
create_runtime_str, generic, impl_opaque_keys, create_runtime_str, generic, impl_opaque_keys,
ApplyResult, Permill, Perbill, RuntimeDebug, ApplyResult, Permill, Perbill, RuntimeDebug,
@@ -99,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"), spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"), impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 1, authoring_version: 1,
spec_version: 1017, spec_version: 1018,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
}; };
@@ -625,8 +621,8 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
/// Executive: handles dispatch to the various modules. /// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>; pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
impl_runtime_apis! { sr_api::impl_runtime_apis! {
impl client_api::Core<Block> for Runtime { impl sr_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion { fn version() -> RuntimeVersion {
VERSION VERSION
} }
@@ -640,7 +636,7 @@ impl_runtime_apis! {
} }
} }
impl client_api::Metadata<Block> for Runtime { impl sr_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata { fn metadata() -> OpaqueMetadata {
Runtime::metadata().into() Runtime::metadata().into()
} }
@@ -655,11 +651,14 @@ impl_runtime_apis! {
Executive::finalize_block() Executive::finalize_block()
} }
fn inherent_extrinsics(data: InherentData) -> Vec<<Block as BlockT>::Extrinsic> { fn inherent_extrinsics(data: inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
data.create_extrinsics() data.create_extrinsics()
} }
fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { fn check_inherents(
block: Block,
data: inherents::InherentData,
) -> inherents::CheckInherentsResult {
data.check_extrinsics(&block) data.check_extrinsics(&block)
} }
@@ -668,7 +667,7 @@ impl_runtime_apis! {
} }
} }
impl client_api::TaggedTransactionQueue<Block> for Runtime { impl tx_pool_api::TaggedTransactionQueue<Block> for Runtime {
fn validate_transaction(tx: <Block as BlockT>::Extrinsic) -> TransactionValidity { fn validate_transaction(tx: <Block as BlockT>::Extrinsic) -> TransactionValidity {
Executive::validate_transaction(tx) Executive::validate_transaction(tx)
} }
@@ -729,7 +728,6 @@ impl_runtime_apis! {
impl substrate_session::SessionKeys<Block> for Runtime { impl substrate_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> { fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
let seed = seed.as_ref().map(|s| rstd::str::from_utf8(&s).expect("Seed is an utf8 string"));
SessionKeys::generate(seed) SessionKeys::generate(seed)
} }
} }
+2 -2
View File
@@ -39,7 +39,7 @@ use srml_support::{
traits::{Currency, Get, WithdrawReason, ExistenceRequirement, Randomness}, traits::{Currency, Get, WithdrawReason, ExistenceRequirement, Randomness},
}; };
use inherents::{ProvideInherent, InherentData, RuntimeString, MakeFatalError, InherentIdentifier}; use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier};
use system::ensure_none; use system::ensure_none;
use crate::attestations::{self, IncludedBlocks}; use crate::attestations::{self, IncludedBlocks};
@@ -874,7 +874,7 @@ pub type InherentType = Vec<AttestedCandidate>;
impl<T: Trait> ProvideInherent for Module<T> { impl<T: Trait> ProvideInherent for Module<T> {
type Call = Call<T>; type Call = Call<T>;
type Error = MakeFatalError<RuntimeString>; type Error = MakeFatalError<inherents::Error>;
const INHERENT_IDENTIFIER: InherentIdentifier = NEW_HEADS_IDENTIFIER; const INHERENT_IDENTIFIER: InherentIdentifier = NEW_HEADS_IDENTIFIER;
fn create_inherent(data: &InherentData) -> Option<Self::Call> { fn create_inherent(data: &InherentData) -> Option<Self::Call> {
+2 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-service" name = "polkadot-service"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
@@ -20,6 +20,7 @@ polkadot-executor = { path = "../executor" }
polkadot-network = { path = "../network" } polkadot-network = { path = "../network" }
polkadot-rpc = { path = "../rpc" } polkadot-rpc = { path = "../rpc" }
sr-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } sr-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
+2 -1
View File
@@ -33,7 +33,8 @@ use log::info;
pub use service::{AbstractService, Roles, PruningMode, TransactionPoolOptions, Error}; pub use service::{AbstractService, Roles, PruningMode, TransactionPoolOptions, Error};
pub use service::{ServiceBuilderExport, ServiceBuilderImport, ServiceBuilderRevert}; pub use service::{ServiceBuilderExport, ServiceBuilderImport, ServiceBuilderRevert};
pub use service::config::{DatabaseConfig, full_version_from_strs}; pub use service::config::{DatabaseConfig, full_version_from_strs};
pub use client::{backend::Backend, runtime_api::{Core as CoreApi, ConstructRuntimeApi}, ExecutionStrategy, CallExecutor}; pub use client::{backend::Backend, ExecutionStrategy, CallExecutor};
pub use sr_api::{Core as CoreApi, ConstructRuntimeApi};
pub use consensus_common::SelectChain; pub use consensus_common::SelectChain;
pub use polkadot_network::{PolkadotProtocol}; pub use polkadot_network::{PolkadotProtocol};
pub use polkadot_primitives::parachain::{CollatorId, ParachainHost}; pub use polkadot_primitives::parachain::{CollatorId, ParachainHost};
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-statement-table" name = "polkadot-statement-table"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+3 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "adder" name = "adder"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition" description = "Test parachain which adds to a number as its state transition"
edition = "2018" edition = "2018"
@@ -13,10 +13,10 @@ tiny-keccak = "1.5.0"
dlmalloc = { version = "0.1.3", features = [ "global" ] } dlmalloc = { version = "0.1.3", features = [ "global" ] }
# We need to make sure the global allocator is disabled until we have support of full substrate externalities # We need to make sure the global allocator is disabled until we have support of full substrate externalities
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = [ "no_global_allocator" ] } runtime-io = { package = "sr-io", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = [ "disable_allocator" ] }
[build-dependencies] [build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.2" } wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.4" }
[features] [features]
default = [ "std" ] default = [ "std" ]
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "halt" name = "halt"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever" description = "Test parachain which executes forever"
edition = "2018" edition = "2018"
+3 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-validation" name = "polkadot-validation"
version = "0.6.10" version = "0.6.16"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
@@ -25,6 +25,8 @@ consensus = { package = "substrate-consensus-common", git = "https://github.com/
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
transaction_pool = { package = "substrate-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } transaction_pool = { package = "substrate-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
block-builder = { package = "substrate-block-builder", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie = { package = "substrate-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } trie = { package = "substrate-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
bitvec = { version = "0.14.0", default-features = false, features = ["alloc"] } bitvec = { version = "0.14.0", default-features = false, features = ["alloc"] }
@@ -26,7 +26,7 @@
use std::{thread, time::{Duration, Instant}, sync::Arc}; use std::{thread, time::{Duration, Instant}, sync::Arc};
use client::{error::Result as ClientResult, BlockchainEvents, BlockBody}; use client::{error::Result as ClientResult, BlockchainEvents, BlockBody};
use client::block_builder::api::BlockBuilder; use block_builder::BlockBuilderApi;
use client::blockchain::HeaderBackend; use client::blockchain::HeaderBackend;
use consensus::SelectChain; use consensus::SelectChain;
use availability_store::Store as AvailabilityStore; use availability_store::Store as AvailabilityStore;
@@ -38,6 +38,7 @@ use polkadot_primitives::parachain::{CandidateReceipt, ParachainHost};
use runtime_primitives::traits::{ProvideRuntimeApi}; use runtime_primitives::traits::{ProvideRuntimeApi};
use babe_primitives::BabeApi; use babe_primitives::BabeApi;
use keystore::KeyStorePtr; use keystore::KeyStorePtr;
use sr_api::ApiExt;
use tokio::{timer::Interval, runtime::current_thread::Runtime as LocalRuntime}; use tokio::{timer::Interval, runtime::current_thread::Runtime as LocalRuntime};
use log::{warn, debug}; use log::{warn, debug};
@@ -123,7 +124,10 @@ pub(crate) fn start<C, N, P, SC>(
<C::Collation as IntoFuture>::Future: Send + 'static, <C::Collation as IntoFuture>::Future: Send + 'static,
P: BlockchainEvents<Block> + BlockBody<Block>, P: BlockchainEvents<Block> + BlockBody<Block>,
P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static, P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + BlockBuilder<Block> + BabeApi<Block>, P::Api: ParachainHost<Block> +
BlockBuilderApi<Block> +
BabeApi<Block> +
ApiExt<Block, Error = client::error::Error>,
N: Network + Send + Sync + 'static, N: Network + Send + Sync + 'static,
N::TableRouter: Send + 'static, N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static, <N::BuildTableRouter as IntoFuture>::Future: Send + 'static,
+8 -3
View File
@@ -98,7 +98,7 @@ impl<C: Collators, P> CollationFetch<C, P> {
} }
impl<C: Collators, P: ProvideRuntimeApi> Future for CollationFetch<C, P> impl<C: Collators, P: ProvideRuntimeApi> Future for CollationFetch<C, P>
where P::Api: ParachainHost<Block>, where P::Api: ParachainHost<Block, Error = client::error::Error>,
{ {
type Item = (Collation, OutgoingMessages); type Item = (Collation, OutgoingMessages);
type Error = C::Error; type Error = C::Error;
@@ -115,7 +115,12 @@ impl<C: Collators, P: ProvideRuntimeApi> Future for CollationFetch<C, P>
futures::try_ready!(poll) futures::try_ready!(poll)
}; };
let res = validate_collation(&*self.client, &self.relay_parent, &collation, self.max_block_data_size); let res = validate_collation(
&*self.client,
&self.relay_parent,
&collation,
self.max_block_data_size,
);
match res { match res {
Ok(e) => { Ok(e) => {
@@ -388,7 +393,7 @@ pub fn validate_collation<P>(
max_block_data_size: Option<u64>, max_block_data_size: Option<u64>,
) -> Result<OutgoingMessages, Error> where ) -> Result<OutgoingMessages, Error> where
P: ProvideRuntimeApi, P: ProvideRuntimeApi,
P::Api: ParachainHost<Block>, P::Api: ParachainHost<Block, Error = client::error::Error>,
{ {
use parachain::{IncomingMessage, ValidationParams}; use parachain::{IncomingMessage, ValidationParams};
+1 -2
View File
@@ -16,7 +16,6 @@
//! Errors that can occur during the validation process. //! Errors that can occur during the validation process.
use runtime_primitives::RuntimeString;
use polkadot_primitives::parachain::ValidatorId; use polkadot_primitives::parachain::ValidatorId;
/// Error type for validation /// Error type for validation
@@ -38,7 +37,7 @@ pub enum Error {
NotValidator(ValidatorId), NotValidator(ValidatorId),
/// Unexpected error checking inherents /// Unexpected error checking inherents
#[display(fmt = "Unexpected error while checking inherents: {}", _0)] #[display(fmt = "Unexpected error while checking inherents: {}", _0)]
InherentError(RuntimeString), InherentError(inherents::Error),
/// Proposer destroyed before finishing proposing or evaluating /// Proposer destroyed before finishing proposing or evaluating
#[display(fmt = "Proposer destroyed before finishing proposing or evaluating")] #[display(fmt = "Proposer destroyed before finishing proposing or evaluating")]
PrematureDestruction, PrematureDestruction,
+24 -10
View File
@@ -34,7 +34,7 @@ use std::{collections::{HashMap, HashSet}, pin::Pin, sync::Arc, time::{self, Dur
use babe_primitives::BabeApi; use babe_primitives::BabeApi;
use client::{BlockchainEvents, BlockBody}; use client::{BlockchainEvents, BlockBody};
use client::blockchain::HeaderBackend; use client::blockchain::HeaderBackend;
use client::block_builder::api::BlockBuilder as BlockBuilderApi; use block_builder::BlockBuilderApi;
use client::error as client_error; use client::error as client_error;
use codec::Encode; use codec::Encode;
use consensus::SelectChain; use consensus::SelectChain;
@@ -60,6 +60,7 @@ use inherents::InherentData;
use runtime_babe::timestamp::TimestampInherentData; use runtime_babe::timestamp::TimestampInherentData;
use log::{info, debug, warn, trace, error}; use log::{info, debug, warn, trace, error};
use keystore::KeyStorePtr; use keystore::KeyStorePtr;
use sr_api::ApiExt;
type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>; type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>;
@@ -249,7 +250,7 @@ impl<C, N, P> ParachainValidation<C, N, P> where
C: Collators + Send + 'static, C: Collators + Send + 'static,
N: Network, N: Network,
P: ProvideRuntimeApi + HeaderBackend<Block> + BlockBody<Block> + Send + Sync + 'static, P: ProvideRuntimeApi + HeaderBackend<Block> + BlockBody<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + BlockBuilderApi<Block>, P::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = client_error::Error>,
<C::Collation as IntoFuture>::Future: Send + 'static, <C::Collation as IntoFuture>::Future: Send + 'static,
N::TableRouter: Send + 'static, N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static, <N::BuildTableRouter as IntoFuture>::Future: Send + 'static,
@@ -433,7 +434,10 @@ impl<C, N, P, SC, TxApi> ProposerFactory<C, N, P, SC, TxApi> where
<C::Collation as IntoFuture>::Future: Send + 'static, <C::Collation as IntoFuture>::Future: Send + 'static,
P: BlockchainEvents<Block> + BlockBody<Block>, P: BlockchainEvents<Block> + BlockBody<Block>,
P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static, P: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + BlockBuilderApi<Block> + BabeApi<Block>, P::Api: ParachainHost<Block> +
BlockBuilderApi<Block> +
BabeApi<Block> +
ApiExt<Block, Error = client_error::Error>,
N: Network + Send + Sync + 'static, N: Network + Send + Sync + 'static,
N::TableRouter: Send + 'static, N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static, <N::BuildTableRouter as IntoFuture>::Future: Send + 'static,
@@ -489,7 +493,10 @@ impl<C, N, P, SC, TxApi> consensus::Environment<Block> for ProposerFactory<C, N,
N: Network, N: Network,
TxApi: PoolChainApi<Block=Block>, TxApi: PoolChainApi<Block=Block>,
P: ProvideRuntimeApi + HeaderBackend<Block> + BlockBody<Block> + Send + Sync + 'static, P: ProvideRuntimeApi + HeaderBackend<Block> + BlockBody<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + BlockBuilderApi<Block> + BabeApi<Block>, P::Api: ParachainHost<Block> +
BlockBuilderApi<Block> +
BabeApi<Block> +
ApiExt<Block, Error = client_error::Error>,
<C::Collation as IntoFuture>::Future: Send + 'static, <C::Collation as IntoFuture>::Future: Send + 'static,
N::TableRouter: Send + 'static, N::TableRouter: Send + 'static,
<N::BuildTableRouter as IntoFuture>::Future: Send + 'static, <N::BuildTableRouter as IntoFuture>::Future: Send + 'static,
@@ -545,7 +552,7 @@ pub struct Proposer<C: Send + Sync, TxApi: PoolChainApi> where
impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where
TxApi: PoolChainApi<Block=Block>, TxApi: PoolChainApi<Block=Block>,
C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync, C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync,
C::Api: ParachainHost<Block> + BlockBuilderApi<Block>, C::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = client_error::Error>,
{ {
type Error = Error; type Error = Error;
type Create = Either<CreateProposal<C, TxApi>, future::Ready<Result<Block, Error>>>; type Create = Either<CreateProposal<C, TxApi>, future::Ready<Result<Block, Error>>>;
@@ -688,10 +695,10 @@ pub struct CreateProposal<C: Send + Sync, TxApi: PoolChainApi> {
impl<C, TxApi> CreateProposal<C, TxApi> where impl<C, TxApi> CreateProposal<C, TxApi> where
TxApi: PoolChainApi<Block=Block>, TxApi: PoolChainApi<Block=Block>,
C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync, C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync,
C::Api: ParachainHost<Block> + BlockBuilderApi<Block>, C::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = client_error::Error>,
{ {
fn propose_with(&mut self, candidates: Vec<AttestedCandidate>) -> Result<Block, Error> { fn propose_with(&mut self, candidates: Vec<AttestedCandidate>) -> Result<Block, Error> {
use client::block_builder::BlockBuilder; use block_builder::BlockBuilder;
use runtime_primitives::traits::{Hash as HashT, BlakeTwo256}; use runtime_primitives::traits::{Hash as HashT, BlakeTwo256};
const MAX_TRANSACTIONS: usize = 40; const MAX_TRANSACTIONS: usize = 40;
@@ -699,11 +706,18 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
let mut inherent_data = self.inherent_data let mut inherent_data = self.inherent_data
.take() .take()
.expect("CreateProposal is not polled after finishing; qed"); .expect("CreateProposal is not polled after finishing; qed");
inherent_data.put_data(polkadot_runtime::NEW_HEADS_IDENTIFIER, &candidates).map_err(Error::InherentError)?; inherent_data.put_data(polkadot_runtime::NEW_HEADS_IDENTIFIER, &candidates)
.map_err(Error::InherentError)?;
let runtime_api = self.client.runtime_api(); let runtime_api = self.client.runtime_api();
let mut block_builder = BlockBuilder::at_block(&self.parent_id, &*self.client, false, self.inherent_digests.clone())?; let mut block_builder = BlockBuilder::new(
&*self.client,
self.client.expect_block_hash_from_id(&self.parent_id)?,
self.client.expect_block_number_from_id(&self.parent_id)?,
false,
self.inherent_digests.clone(),
)?;
{ {
let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?; let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?;
@@ -773,7 +787,7 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
impl<C, TxApi> futures03::Future for CreateProposal<C, TxApi> where impl<C, TxApi> futures03::Future for CreateProposal<C, TxApi> where
TxApi: PoolChainApi<Block=Block>, TxApi: PoolChainApi<Block=Block>,
C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync, C: ProvideRuntimeApi + HeaderBackend<Block> + Send + Sync,
C::Api: ParachainHost<Block> + BlockBuilderApi<Block>, C::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = client_error::Error>,
{ {
type Output = Result<Block, Error>; type Output = Result<Block, Error>;
+1 -1
View File
@@ -276,7 +276,7 @@ impl<Fetch: Future> ParachainWork<Fetch> {
> >
where where
P: Send + Sync + 'static, P: Send + Sync + 'static,
P::Api: ParachainHost<Block>, P::Api: ParachainHost<Block, Error = client::error::Error>,
{ {
let max_block_data_size = self.max_block_data_size; let max_block_data_size = self.max_block_data_size;
let validate = move |id: &_, collation: &_| { let validate = move |id: &_, collation: &_| {