Skip to content

Commit

Permalink
Bump Substrate & versions (paritytech#747)
Browse files Browse the repository at this point in the history
* Bump versions

* Update for tipping treasury

* Bump substrate

* Fixes

* Put send_consensus back in.

* Fix test

* Fixes

* Fixes

* Fix warning
  • Loading branch information
gavofyork authored Jan 9, 2020
1 parent c003d73 commit f570356
Show file tree
Hide file tree
Showing 26 changed files with 661 additions and 645 deletions.
1,196 changes: 588 additions & 608 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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
build = "build.rs"
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Collator node implementation"
edition = "2018"
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
3 changes: 2 additions & 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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
Expand All @@ -22,6 +22,7 @@ log = "0.4.8"
exit-future = "0.2.0"
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
wasm-timer = "0.2.4"

[dev-dependencies]
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
Expand Down
3 changes: 2 additions & 1 deletion network/src/collator_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use sc_network::PeerId;
use futures::channel::oneshot;

use std::collections::hash_map::{HashMap, Entry};
use std::time::{Duration, Instant};
use std::time::Duration;
use wasm_timer::Instant;

const COLLATION_LIFETIME: Duration = Duration::from_secs(60 * 5);

Expand Down
3 changes: 2 additions & 1 deletion network/src/local_collations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
use polkadot_primitives::{Hash, parachain::{ValidatorId}};
use crate::collator_pool::Role;
use std::collections::{HashMap, HashSet};
use std::time::{Duration, Instant};
use std::time::Duration;
use wasm_timer::Instant;

const LIVE_FOR: Duration = Duration::from_secs(60 * 5);

Expand Down
8 changes: 6 additions & 2 deletions network/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct TestContext {

impl Context<Block> for TestContext {
fn report_peer(&mut self, peer: PeerId, reputation: ReputationChange) {
let reputation = self.reputations.get(&peer).map_or(reputation.value, |v| v + reputation.value);
self.reputations.insert(peer.clone(), reputation);
let reputation = self.reputations.get(&peer).map_or(reputation.value, |v| v + reputation.value);
self.reputations.insert(peer.clone(), reputation);

match reputation {
i if i < -100 => self.disabled.push(peer),
Expand All @@ -57,6 +57,10 @@ impl Context<Block> for TestContext {
}
}

fn send_consensus(&mut self, _who: PeerId, _consensus: Vec<ConsensusMessage>) {
unimplemented!()
}

fn send_chain_specific(&mut self, who: PeerId, message: Vec<u8>) {
self.messages.push((who, message))
}
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
Expand Down
1 change: 1 addition & 0 deletions parachain/src/wasm_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ pub fn validate_candidate_internal<E: Externalities + 'static>(
validation_code,
// TODO: Make sure we don't use more than 1GB: https://github.com/paritytech/polkadot/issues/699
1024,
false,
)?;

ValidationResult::decode(&mut &res[..]).map_err(|_| Error::BadReturn.into())
Expand Down
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.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-rpc"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime-common"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
17 changes: 16 additions & 1 deletion runtime/common/src/crowdfund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,13 @@ mod tests {

use std::{collections::HashMap, cell::RefCell};
use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types};
use frame_support::traits::Contains;
use sp_core::H256;
use primitives::parachain::{Info as ParaInfo, Id as ParaId};
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sp_runtime::{
Perbill, Permill, testing::Header, DispatchResult,
Perbill, Permill, Percent, testing::Header, DispatchResult,
traits::{BlakeTwo256, OnInitialize, OnFinalize, IdentityLookup},
};
use crate::registrar::Registrar;
Expand Down Expand Up @@ -568,6 +569,15 @@ mod tests {
pub const ProposalBondMinimum: u64 = 1;
pub const SpendPeriod: u64 = 2;
pub const Burn: Permill = Permill::from_percent(50);
pub const TipCountdown: u64 = 1;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: u64 = 1;
pub const TipReportDepositPerByte: u64 = 1;
}
pub struct Nobody;
impl Contains<u64> for Nobody {
fn contains(_: &u64) -> bool { false }
fn sorted_members() -> Vec<u64> { vec![] }
}
impl treasury::Trait for Test {
type Currency = balances::Module<Test>;
Expand All @@ -579,6 +589,11 @@ mod tests {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type Tippers = Nobody;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
}

thread_local! {
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kusama-runtime"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
16 changes: 13 additions & 3 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,

use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
ApplyExtrinsicResult, Permill, Perbill, RuntimeDebug,
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
curve::PiecewiseLinear,
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys},
Expand Down Expand Up @@ -77,8 +77,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1037,
impl_version: 2,
spec_version: 1038,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};

Expand Down Expand Up @@ -387,6 +387,11 @@ parameter_types! {
pub const ProposalBondMinimum: Balance = 20 * DOLLARS;
pub const SpendPeriod: BlockNumber = 6 * DAYS;
pub const Burn: Permill = Permill::from_percent(0);

pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 1 * DOLLARS;
pub const TipReportDepositPerByte: Balance = 1 * CENTS;
}

impl treasury::Trait for Runtime {
Expand All @@ -399,6 +404,11 @@ impl treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type Tippers = ElectionsPhragmen;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
}

impl offences::Trait for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
12 changes: 11 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use primitives::{
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
ApplyExtrinsicResult, Permill, Perbill, RuntimeDebug,
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
curve::PiecewiseLinear,
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys},
Expand Down Expand Up @@ -391,6 +391,11 @@ parameter_types! {
pub const ProposalBondMinimum: Balance = 100 * DOLLARS;
pub const SpendPeriod: BlockNumber = 24 * DAYS;
pub const Burn: Permill = Permill::from_percent(1);

pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 1 * DOLLARS;
pub const TipReportDepositPerByte: Balance = 1 * CENTS;
}

impl treasury::Trait for Runtime {
Expand All @@ -403,6 +408,11 @@ impl treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type Tippers = ElectionsPhragmen;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
}

impl offences::Trait for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-service"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
15 changes: 4 additions & 11 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)
Extrinsic: RuntimeExtrinsic,
{
use sc_network::Event;
use futures01::Stream;
use futures::{
compat::Stream01CompatExt,
stream::StreamExt,
};
use futures::stream::StreamExt;

let is_collator = config.custom.collating_for.is_some();
let is_authority = config.roles.is_authority() && !is_collator;
Expand Down Expand Up @@ -436,19 +432,16 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(config: Configuration)

if authority_discovery_enabled {
let network = service.network();
let dht_event_stream = network.event_stream().filter_map(|e| match e {
let dht_event_stream = network.event_stream().filter_map(|e| async move { match e {
Event::Dht(e) => Some(e),
_ => None,
});
let future03_dht_event_stream = dht_event_stream.compat()
.map(|x| x.expect("<mpsc::channel::Receiver as Stream> never returns an error; qed"))
.boxed();
}}).boxed();
let authority_discovery = authority_discovery::AuthorityDiscovery::new(
service.client(),
network,
sentry_nodes,
service.keystore(),
future03_dht_event_stream,
dht_event_stream,
);
let future01_authority_discovery = authority_discovery.map(|x| Ok(x)).compat();

Expand Down
2 changes: 1 addition & 1 deletion statement-table/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-statement-table"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion test-parachains/adder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adder"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion test-parachains/halt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "halt"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
description = "Test parachain which executes forever"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion validation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-validation"
version = "0.7.16"
version = "0.7.17"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down

0 comments on commit f570356

Please sign in to comment.