Skip to content

Commit

Permalink
v0.17.18: Update latest substrate (paritytech#776)
Browse files Browse the repository at this point in the history
* update latest substrate polkadot-master

* fix test compilation

* bump version to 0.7.18

* bump impl_version

* update substrate

* Revert "Instantiate environment with asynchronous API (paritytech#768)"

This reverts commit 989db4b.

* update substrate

* remove unused parameter type

* bump trie-db version for tests

* fix collator test

* update substrate

* remove unnecessary service changes
  • Loading branch information
andresilva authored Jan 17, 2020
1 parent a169ae5 commit fc100e6
Show file tree
Hide file tree
Showing 24 changed files with 656 additions and 595 deletions.
1,152 changes: 600 additions & 552 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.17"
version = "0.7.18"
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-cli"
version = "0.7.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
Expand All @@ -23,7 +23,7 @@ sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polk
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
service = { package = "polkadot-service", path = "../service", default-features = false }

tokio = { version = "0.2", features = ["rt-threaded"], optional = true }
tokio = { version = "0.1.22", optional = true }

wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
Expand Down
30 changes: 22 additions & 8 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ mod chain_spec;
mod browser;

use chain_spec::ChainSpec;
use futures::{Future, future::{select, Either}, channel::oneshot};
use futures::{
Future, FutureExt, TryFutureExt, future::select, channel::oneshot,
};
#[cfg(feature = "cli")]
use tokio::runtime::Runtime;
use log::info;
Expand Down Expand Up @@ -215,22 +217,34 @@ pub fn run_until_exit(
) -> error::Result<()> {
let (exit_send, exit) = oneshot::channel();

let executor = runtime.executor();
let informant = sc_cli::informant::build(&service);
let future = select(exit, informant)
.map(|_| Ok(()))
.compat();

let handle = runtime.spawn(select(exit, informant));
executor.spawn(future);

// we eagerly drop the service so that the internal exit future is fired,
// but we need to keep holding a reference to the global telemetry guard
let _telemetry = service.telemetry();

let service_res = runtime.block_on(select(service, e));
let service_res = {
let service = service
.map_err(|err| error::Error::Service(err));

let select = select(service, e)
.map(|_| Ok(()))
.compat();

runtime.block_on(select)
};

let _ = exit_send.send(());

runtime.block_on(handle);
use futures01::Future;
// TODO [andre]: timeout this future substrate/#1318
let _ = runtime.shutdown_on_idle().wait();

match service_res {
Either::Left((res, _)) => res.map_err(error::Error::Service),
Either::Right((_, _)) => Ok(())
}
service_res
}
4 changes: 2 additions & 2 deletions collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-collator"
version = "0.7.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
description = "Collator node implementation"
edition = "2018"
Expand All @@ -21,7 +21,7 @@ polkadot-network = { path = "../network" }
polkadot-validation = { path = "../validation" }
polkadot-service = { path = "../service" }
log = "0.4.8"
tokio = "0.2"
tokio = "0.1.22"
futures-timer = "1.0"
codec = { package = "parity-scale-codec", version = "1.1.0" }

Expand Down
4 changes: 2 additions & 2 deletions collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ fn run_collator_node<S, E, P, Extrinsic>(
);

let exit = inner_exit_2.clone();
tokio::spawn(future::select(res.boxed(), exit).map(drop));
tokio::spawn(future::select(res.boxed(), exit).map(drop).map(|_| Ok(())).compat());
})
});

Expand All @@ -449,7 +449,7 @@ fn run_collator_node<S, E, P, Extrinsic>(
inner_exit.clone()
).map(drop);

tokio::spawn(future);
tokio::spawn(future.map(|_| Ok(())).compat());
future::ready(())
});

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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
Expand Down
9 changes: 4 additions & 5 deletions network/src/tests/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ use polkadot_primitives::parachain::{
use parking_lot::Mutex;
use sp_blockchain::Result as ClientResult;
use sp_api::{ApiRef, Core, RuntimeVersion, StorageProof, ApiErrorExt, ApiExt, ProvideRuntimeApi};
use sp_runtime::traits::Block as BlockT;
use sp_runtime::traits::{Block as BlockT, HasherFor, NumberFor};
use sp_state_machine::ChangesTrieState;

use std::collections::HashMap;
use std::sync::Arc;
Expand Down Expand Up @@ -225,12 +226,10 @@ impl ApiExt<Block> for RuntimeApi {
None
}

fn into_storage_changes<
T: sp_api::ChangesTrieStorage<sp_api::HasherFor<Block>, sp_api::NumberFor<Block>>
>(
fn into_storage_changes(
&self,
_: &Self::StateBackend,
_: Option<&T>,
_: Option<&ChangesTrieState<HasherFor<Block>, NumberFor<Block>>>,
_: <Block as sp_api::BlockT>::Hash,
) -> std::result::Result<sp_api::StorageChanges<Self::StateBackend, Block>, String>
where Self: Sized
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/src/wasm_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub fn validate_candidate_internal<E: Externalities + 'static>(
) -> Result<ValidationResult, Error> {
let mut ext = ValidationExternalities(ParachainExt::new(externalities));

let res = sc_executor::call_in_wasm::<_, HostFunctions>(
let res = sc_executor::call_in_wasm::<HostFunctions>(
"validate_block",
encoded_call_data,
sc_executor::WasmExecutionMethod::Interpreted,
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.17"
version = "0.7.18"
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions 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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down Expand Up @@ -41,7 +41,7 @@ babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
trie-db = "0.18.0"
trie-db = "0.19.2"
serde_json = "1.0.41"

[features]
Expand Down
4 changes: 2 additions & 2 deletions 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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down Expand Up @@ -69,7 +69,7 @@ libsecp256k1 = "0.3.2"
tiny-keccak = "1.5.0"
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie-db = "0.18.0"
trie-db = "0.19.2"
serde_json = "1.0.41"

[build-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1041,
impl_version: 2,
impl_version: 3,
apis: RUNTIME_API_VERSIONS,
};

Expand Down Expand Up @@ -571,7 +571,6 @@ parameter_types! {
pub const PeriodSpend: Balance = 500 * DOLLARS;
pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS;
pub const ChallengePeriod: BlockNumber = 7 * DAYS;
pub const MaxMembers: u32 = 999;
}

impl society::Trait for Runtime {
Expand Down
4 changes: 2 additions & 2 deletions 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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down Expand Up @@ -66,7 +66,7 @@ libsecp256k1 = "0.3.2"
tiny-keccak = "1.5.0"
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie-db = "0.18.0"
trie-db = "0.19.2"
serde_json = "1.0.41"

[build-dependencies]
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
7 changes: 4 additions & 3 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod chain_spec;
use futures::{
FutureExt, TryFutureExt,
task::{Spawn, SpawnError, FutureObj},
compat::Future01CompatExt,
compat::{Future01CompatExt, Stream01CompatExt},
};
use sc_client::LongestChain;
use std::sync::Arc;
Expand Down Expand Up @@ -455,8 +455,9 @@ 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| async move { match e {
Event::Dht(e) => Some(e),
let network_event_stream = network.event_stream().compat();
let dht_event_stream = network_event_stream.filter_map(|e| async move { match e {
Ok(Event::Dht(e)) => Some(e),
_ => None,
}}).boxed();
let authority_discovery = authority_discovery::AuthorityDiscovery::new(
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.17"
version = "0.7.18"
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.17"
version = "0.7.18"
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.17"
version = "0.7.18"
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.17"
version = "0.7.18"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down

0 comments on commit fc100e6

Please sign in to comment.