diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06d808e5fda89..8561cfac8c140 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -219,14 +219,14 @@ check-web-wasm: script: # WASM support is in progress. As more and more crates support WASM, we # should add entries here. See https://github.com/paritytech/substrate/issues/2416 - - time cargo web build -p sr-io - - time cargo web build -p sr-primitives - - time cargo web build -p sr-std - - time cargo web build -p substrate-client - - time cargo web build -p substrate-consensus-aura - - time cargo web build -p substrate-consensus-babe - - time cargo web build -p substrate-consensus-common - - time cargo web build -p substrate-telemetry + - time cargo build --target=wasm32-unknown-unknown -p sr-io + - time cargo build --target=wasm32-unknown-unknown -p sr-primitives + - time cargo build --target=wasm32-unknown-unknown -p sr-std + - time cargo build --target=wasm32-unknown-unknown -p substrate-client + - time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-aura + - time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-babe + - time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-common + - time cargo build --target=wasm32-unknown-unknown -p substrate-telemetry # Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way. - time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown - sccache -s diff --git a/Cargo.lock b/Cargo.lock index 8f815671a77b6..fd488a43b7af7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1258,15 +1258,6 @@ dependencies = [ "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "futures-channel-preview" -version = "0.3.0-alpha.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-core" version = "0.3.1" @@ -1297,26 +1288,11 @@ dependencies = [ "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "futures-executor-preview" -version = "0.3.0-alpha.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-io" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-io-preview" -version = "0.3.0-alpha.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-macro" version = "0.3.1" @@ -1328,29 +1304,11 @@ dependencies = [ "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "futures-preview" -version = "0.3.0-alpha.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-executor-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-sink" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-sink-preview" -version = "0.3.0-alpha.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-task" version = "0.3.1" @@ -1366,6 +1324,11 @@ dependencies = [ "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "futures-timer" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "futures-util" version = "0.3.1" @@ -1390,16 +1353,19 @@ name = "futures-util-preview" version = "0.3.0-alpha.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "futures01" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gcc" version = "0.3.55" @@ -2702,9 +2668,8 @@ dependencies = [ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2898,8 +2863,8 @@ version = "2.0.0" dependencies = [ "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "node-template-runtime 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3261,7 +3226,7 @@ name = "palette-system-rpc" version = "2.0.0" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-derive 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5333,8 +5298,8 @@ version = "2.0.0" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5368,7 +5333,7 @@ dependencies = [ name = "substrate-basic-authorship" version = "2.0.0" dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -5454,10 +5419,9 @@ dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures01 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5487,8 +5451,7 @@ dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -5524,8 +5487,7 @@ dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -5589,7 +5551,7 @@ dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5640,7 +5602,7 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "merlin 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5700,7 +5662,7 @@ name = "substrate-consensus-common" version = "2.0.0" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5719,7 +5681,7 @@ name = "substrate-consensus-pow" version = "2.0.0" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-timestamp 2.0.0", @@ -5747,8 +5709,8 @@ dependencies = [ name = "substrate-consensus-slots" version = "2.0.0" dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5841,7 +5803,7 @@ dependencies = [ "finality-grandpa 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5941,7 +5903,7 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5988,8 +5950,8 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6031,7 +5993,7 @@ dependencies = [ name = "substrate-peerset" version = "2.0.0" dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6109,7 +6071,7 @@ version = "2.0.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6142,7 +6104,7 @@ name = "substrate-rpc-api" version = "2.0.0" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-derive 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6253,7 +6215,7 @@ dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "node-executor 2.0.0", @@ -6303,7 +6265,7 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", @@ -6360,8 +6322,8 @@ version = "2.0.0" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6379,7 +6341,7 @@ dependencies = [ name = "substrate-test-client" version = "2.0.0" dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -6466,7 +6428,7 @@ dependencies = [ "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7839,22 +7801,19 @@ dependencies = [ "checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" "checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" -"checksum futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e5f4df964fa9c1c2f8bddeb5c3611631cacd93baf810fc8bb2fb4b495c263a" "checksum futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" "checksum futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "b35b6263fb1ef523c3056565fa67b1d16f0a8604ff12b11b08c25f28a734c60a" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" -"checksum futures-executor-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "75236e88bd9fe88e5e8bfcd175b665d0528fe03ca4c5207fabc028c8f9d93e98" "checksum futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" -"checksum futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "f4914ae450db1921a56c91bde97a27846287d062087d4a652efc09bb3a01ebda" "checksum futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" -"checksum futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3b1dce2a0267ada5c6ff75a8ba864b4e679a9e2aa44262af7a3b5516d530d76e" "checksum futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" -"checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec" "checksum futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" "checksum futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "878f1d2fc31355fa02ed2372e741b0c17e58373341e6a122569b4623a14a7d33" +"checksum futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" "checksum futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" "checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" +"checksum futures01 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "7ef8cbbf52909170053540c6c05a62433ddb60662dabee714e2a882caa864f22" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" diff --git a/bin/node-template/Cargo.toml b/bin/node-template/Cargo.toml index 99ea7af798f16..ff393730761bb 100644 --- a/bin/node-template/Cargo.toml +++ b/bin/node-template/Cargo.toml @@ -11,11 +11,11 @@ path = "src/main.rs" [dependencies] derive_more = "0.15.0" -futures = "0.1.29" +futures = "0.3.1" +futures01 = { package = "futures", version = "0.1.29" } ctrlc = { version = "3.1.3", features = ["termination"] } log = "0.4.8" tokio = "0.1.22" -exit-future = "0.1.4" parking_lot = "0.9.0" codec = { package = "parity-scale-codec", version = "1.0.0" } trie-root = "0.15.2" diff --git a/bin/node-template/src/cli.rs b/bin/node-template/src/cli.rs index ec463a236b2e0..1171a90654935 100644 --- a/bin/node-template/src/cli.rs +++ b/bin/node-template/src/cli.rs @@ -1,5 +1,5 @@ use crate::service; -use futures::{future, Future, sync::oneshot}; +use futures::{future::{select, Map}, FutureExt, TryFutureExt, channel::oneshot, compat::Future01CompatExt}; use std::cell::RefCell; use tokio::runtime::Runtime; pub use substrate_cli::{VersionInfo, IntoExit, error}; @@ -69,25 +69,37 @@ where T: AbstractService, E: IntoExit, { - let (exit_send, exit) = exit_future::signal(); + let (exit_send, exit) = oneshot::channel(); let informant = informant::build(&service); - runtime.executor().spawn(exit.until(informant).map(|_| ())); + + let future = select(exit, informant) + .map(|_| Ok(())) + .compat(); + + runtime.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 = { - let exit = e.into_exit().map_err(|_| error::Error::Other("Exit future failed.".into())); - let service = service.map_err(|err| error::Error::Service(err)); - let select = service.select(exit).map(|_| ()).map_err(|(err, _)| err); + let exit = e.into_exit(); + let service = service + .map_err(|err| error::Error::Service(err)) + .compat(); + let select = select(service, exit) + .map(|_| Ok(())) + .compat(); runtime.block_on(select) }; - exit_send.fire(); + let _ = exit_send.send(()); // TODO [andre]: timeout this future #1318 + + use futures01::Future; + let _ = runtime.shutdown_on_idle().wait(); service_res @@ -96,7 +108,7 @@ where // handles ctrl-c pub struct Exit; impl IntoExit for Exit { - type Exit = future::MapErr, fn(oneshot::Canceled) -> ()>; + type Exit = Map, fn(Result<(), oneshot::Canceled>) -> ()>; fn into_exit(self) -> Self::Exit { // can't use signal directly here because CtrlC takes only `Fn`. let (exit_send, exit) = oneshot::channel(); @@ -109,6 +121,6 @@ impl IntoExit for Exit { } }).expect("Error setting Ctrl-C handler"); - exit.map_err(drop) + exit.map(drop) } } diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index bb9e868beaae4..a6ba2d6d9ec60 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -25,8 +25,8 @@ crate-type = ["cdylib", "rlib"] # third-party dependencies codec = { package = "parity-scale-codec", version = "1.0.6" } serde = { version = "1.0.102", features = [ "derive" ] } -futures = "0.1.29" -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures01 = { package = "futures", version = "0.1.29" } +futures = { version = "0.3.1", features = ["compat"] } hex-literal = "0.2.1" jsonrpc-core = "14.0.3" log = "0.4.8" @@ -80,7 +80,6 @@ node-executor = { path = "../executor" } # CLI-specific dependencies tokio = { version = "0.1.22", optional = true } -exit-future = { version = "0.1.4", optional = true } substrate-cli = { path = "../../../client/cli", optional = true } transaction-factory = { path = "../../../test/utils/transaction-factory", optional = true } ctrlc = { version = "3.1.3", features = ["termination"], optional = true } @@ -101,7 +100,7 @@ keystore = { package = "substrate-keystore", path = "../../../client/keystore" } babe = { package = "substrate-consensus-babe", path = "../../../client/consensus/babe", features = ["test-helpers"] } consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } service-test = { package = "substrate-service-test", path = "../../../client/service/test" } -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19" } +futures = "0.3.1" tempfile = "3.1.0" [build-dependencies] @@ -128,7 +127,6 @@ cli = [ "substrate-cli", "transaction-factory", "tokio", - "exit-future", "ctrlc", "substrate-service/rocksdb", "node-executor/wasmi-errno", diff --git a/bin/node/cli/bin/main.rs b/bin/node/cli/bin/main.rs index e4415a2a89e66..45cf173efb3e9 100644 --- a/bin/node/cli/bin/main.rs +++ b/bin/node/cli/bin/main.rs @@ -18,8 +18,8 @@ #![warn(missing_docs)] -use futures::sync::oneshot; -use futures::{future, Future}; +use futures::channel::oneshot; +use futures::{future, FutureExt}; use substrate_cli::VersionInfo; use std::cell::RefCell; @@ -27,7 +27,7 @@ use std::cell::RefCell; // handles ctrl-c struct Exit; impl substrate_cli::IntoExit for Exit { - type Exit = future::MapErr, fn(oneshot::Canceled) -> ()>; + type Exit = future::Map, fn(Result<(), oneshot::Canceled>) -> ()>; fn into_exit(self) -> Self::Exit { // can't use signal directly here because CtrlC takes only `Fn`. let (exit_send, exit) = oneshot::channel(); @@ -39,7 +39,7 @@ impl substrate_cli::IntoExit for Exit { } }).expect("Error setting Ctrl-C handler"); - exit.map_err(drop) + exit.map(|_| ()) } } diff --git a/bin/node/cli/src/browser.rs b/bin/node/cli/src/browser.rs index ada8a52e1e8b3..93df41402b9f2 100644 --- a/bin/node/cli/src/browser.rs +++ b/bin/node/cli/src/browser.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use crate::ChainSpec; -use futures::{prelude::*, sync::oneshot, sync::mpsc}; +use futures01::{prelude::*, sync::oneshot, sync::mpsc}; use libp2p::wasm_ext; use log::{debug, info}; use std::sync::Arc; @@ -71,7 +71,7 @@ fn start_inner(wasm_ext: wasm_ext::ffi::Transport) -> Result(); - wasm_bindgen_futures::spawn_local(futures::future::poll_fn(move || { + wasm_bindgen_futures::spawn_local(futures01::future::poll_fn(move || { loop { match rpc_send_rx.poll() { Ok(Async::Ready(Some(message))) => { diff --git a/bin/node/cli/src/cli.rs b/bin/node/cli/src/cli.rs index 4bddb50b4bcac..f648038d82cb5 100644 --- a/bin/node/cli/src/cli.rs +++ b/bin/node/cli/src/cli.rs @@ -185,23 +185,34 @@ where T: AbstractService, E: IntoExit, { - let (exit_send, exit) = exit_future::signal(); + use futures::{FutureExt, TryFutureExt, channel::oneshot, future::select, compat::Future01CompatExt}; + + let (exit_send, exit) = oneshot::channel(); let informant = substrate_cli::informant::build(&service); - runtime.executor().spawn(exit.until(informant).map(|_| ())); + + let future = select(informant, exit) + .map(|_| Ok(())) + .compat(); + + runtime.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 = { - let exit = e.into_exit().map_err(|_| error::Error::Other("Exit future failed.".into())); - let service = service.map_err(|err| error::Error::Service(err)); - let select = service.select(exit).map(|_| ()).map_err(|(err, _)| err); + let exit = e.into_exit(); + let service = service + .map_err(|err| error::Error::Service(err)) + .compat(); + let select = select(service, exit) + .map(|_| Ok(())) + .compat(); runtime.block_on(select) }; - exit_send.fire(); + let _ = exit_send.send(()); // TODO [andre]: timeout this future #1318 let _ = runtime.shutdown_on_idle().wait(); diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs index c627e7774fa08..93422bd3b4eaa 100644 --- a/bin/node/cli/src/service.rs +++ b/bin/node/cli/src/service.rs @@ -110,9 +110,9 @@ macro_rules! new_full_start { /// concrete types instead. macro_rules! new_full { ($config:expr, $with_startup_data: expr) => {{ - use futures::sync::mpsc; + use futures01::sync::mpsc; use network::DhtEvent; - use futures03::{ + use futures::{ compat::Stream01CompatExt, stream::StreamExt, future::{FutureExt, TryFutureExt}, @@ -515,7 +515,7 @@ mod tests { digest.push(::babe_pre_digest(babe_pre_digest)); let mut proposer = proposer_factory.init(&parent_header).unwrap(); - let new_block = futures03::executor::block_on(proposer.propose( + let new_block = futures::executor::block_on(proposer.propose( inherent_data, digest, std::time::Duration::from_secs(1), diff --git a/client/Cargo.toml b/client/Cargo.toml index 194d3689cb9ee..67aef7e631be5 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -13,8 +13,7 @@ kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c derive_more = { version = "0.15.0" } executor = { package = "substrate-executor", path = "executor" } fnv = { version = "1.0.6" } -futures = { version = "0.1.29" } -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } hash-db = { version = "0.15.2" } header-metadata = { package = "substrate-header-metadata", path = "header-metadata" } hex-literal = { version = "0.2.1" } @@ -38,4 +37,3 @@ client-db = { package = "substrate-client-db", path = "./db", features = ["kvdb- test-client = { package = "substrate-test-runtime-client", path = "../test/utils/runtime/client" } kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" } panic-handler = { package = "substrate-panic-handler", path = "../primitives/panic-handler" } - diff --git a/client/api/Cargo.toml b/client/api/Cargo.toml index 9a122ad0f8591..83b4859e93e33 100644 --- a/client/api/Cargo.toml +++ b/client/api/Cargo.toml @@ -11,8 +11,7 @@ consensus = { package = "substrate-consensus-common", path = "../../primitives/c derive_more = { version = "0.15.0" } executor = { package = "substrate-executor", path = "../executor" } fnv = { version = "1.0.6" } -futures = { version = "0.1.29" } -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1" } hash-db = { version = "0.15.2", default-features = false } header-metadata = { package = "substrate-header-metadata", path = "../header-metadata" } hex-literal = { version = "0.2.1" } diff --git a/client/api/src/client.rs b/client/api/src/client.rs index a51fc9f03f875..51d4fb54f02b3 100644 --- a/client/api/src/client.rs +++ b/client/api/src/client.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use std::collections::HashMap; -use futures03::channel::mpsc; +use futures::channel::mpsc; use primitives::storage::StorageKey; use state_machine::ExecutionStrategy; use sr_primitives::{ diff --git a/client/api/src/light.rs b/client/api/src/light.rs index b82f8ba745912..433d1dbec10e6 100644 --- a/client/api/src/light.rs +++ b/client/api/src/light.rs @@ -286,7 +286,7 @@ pub trait RemoteBlockchain: Send + Sync { #[cfg(test)] pub mod tests { - use futures03::future::Ready; + use futures::future::Ready; use parking_lot::Mutex; use crate::error::Error as ClientError; use test_primitives::{Block, Header, Extrinsic}; @@ -298,7 +298,7 @@ pub mod tests { where E: std::convert::From<&'static str>, { - futures03::future::ready(Err("Not implemented on test node".into())) + futures::future::ready(Err("Not implemented on test node".into())) } impl Fetcher for OkCallFetcher { @@ -321,7 +321,7 @@ pub mod tests { } fn remote_call(&self, _request: RemoteCallRequest
) -> Self::RemoteCallResult { - futures03::future::ready(Ok((*self.lock()).clone())) + futures::future::ready(Ok((*self.lock()).clone())) } fn remote_changes(&self, _request: RemoteChangesRequest
) -> Self::RemoteChangesResult { @@ -332,4 +332,4 @@ pub mod tests { not_implemented_in_tests() } } -} \ No newline at end of file +} diff --git a/client/api/src/notifications.rs b/client/api/src/notifications.rs index 37f90dcc0ba64..0ddc4c72cdb55 100644 --- a/client/api/src/notifications.rs +++ b/client/api/src/notifications.rs @@ -22,7 +22,7 @@ use std::{ }; use fnv::{FnvHashSet, FnvHashMap}; -use futures03::channel::mpsc; +use futures::channel::mpsc; use primitives::storage::{StorageKey, StorageData}; use sr_primitives::traits::Block as BlockT; @@ -347,7 +347,7 @@ mod tests { // given let mut notifications = StorageNotifications::::default(); let child_filter = [(StorageKey(vec![4]), None)]; - let mut recv = futures03::executor::block_on_stream( + let mut recv = futures::executor::block_on_stream( notifications.listen(None, Some(&child_filter[..])) ); @@ -382,13 +382,13 @@ mod tests { // given let mut notifications = StorageNotifications::::default(); let child_filter = [(StorageKey(vec![4]), Some(vec![StorageKey(vec![5])]))]; - let mut recv1 = futures03::executor::block_on_stream( + let mut recv1 = futures::executor::block_on_stream( notifications.listen(Some(&[StorageKey(vec![1])]), None) ); - let mut recv2 = futures03::executor::block_on_stream( + let mut recv2 = futures::executor::block_on_stream( notifications.listen(Some(&[StorageKey(vec![2])]), None) ); - let mut recv3 = futures03::executor::block_on_stream( + let mut recv3 = futures::executor::block_on_stream( notifications.listen(Some(&[]), Some(&child_filter)) ); @@ -429,16 +429,16 @@ mod tests { let mut notifications = StorageNotifications::::default(); { let child_filter = [(StorageKey(vec![4]), Some(vec![StorageKey(vec![5])]))]; - let _recv1 = futures03::executor::block_on_stream( + let _recv1 = futures::executor::block_on_stream( notifications.listen(Some(&[StorageKey(vec![1])]), None) ); - let _recv2 = futures03::executor::block_on_stream( + let _recv2 = futures::executor::block_on_stream( notifications.listen(Some(&[StorageKey(vec![2])]), None) ); - let _recv3 = futures03::executor::block_on_stream( + let _recv3 = futures::executor::block_on_stream( notifications.listen(None, None) ); - let _recv4 = futures03::executor::block_on_stream( + let _recv4 = futures::executor::block_on_stream( notifications.listen(None, Some(&child_filter)) ); assert_eq!(notifications.listeners.len(), 2); @@ -465,7 +465,7 @@ mod tests { // given let mut recv = { let mut notifications = StorageNotifications::::default(); - let recv = futures03::executor::block_on_stream(notifications.listen(None, None)); + let recv = futures::executor::block_on_stream(notifications.listen(None, None)); // when let changeset = vec![]; diff --git a/client/authority-discovery/Cargo.toml b/client/authority-discovery/Cargo.toml index e9c918500bb74..c45eb4168468f 100644 --- a/client/authority-discovery/Cargo.toml +++ b/client/authority-discovery/Cargo.toml @@ -14,8 +14,8 @@ bytes = "0.4.12" client-api = { package = "substrate-client-api", path = "../api" } codec = { package = "parity-scale-codec", default-features = false, version = "1.0.3" } derive_more = "0.15.0" -futures-preview = "0.3.0-alpha.19" -futures-timer = "0.4" +futures = "0.3.1" +futures-timer = "2.0" keystore = { package = "substrate-keystore", path = "../keystore" } libp2p = { version = "0.13.0", default-features = false, features = ["secp256k1", "libp2p-websocket"] } log = "0.4.8" diff --git a/client/authority-discovery/src/lib.rs b/client/authority-discovery/src/lib.rs index 57805d0add18b..0c9d8e59ac382 100644 --- a/client/authority-discovery/src/lib.rs +++ b/client/authority-discovery/src/lib.rs @@ -51,9 +51,8 @@ use std::sync::Arc; use std::time::{Duration, Instant}; use futures::task::{Context, Poll}; -use futures::Future; -use futures_timer::Interval; -use futures::prelude::*; +use futures::{Future, FutureExt, Stream, StreamExt}; +use futures_timer::Delay; use authority_discovery_primitives::{AuthorityDiscoveryApi, AuthorityId, AuthoritySignature, AuthorityPair}; use client_api::blockchain::HeaderBackend; @@ -68,6 +67,8 @@ use prost::Message; use sr_primitives::generic::BlockId; use sr_primitives::traits::{Block as BlockT, ProvideRuntimeApi}; +type Interval = Box + Unpin + Send + Sync>; + mod error; /// Dht payload schemas generated from Protobuf definitions via Prost crate in build.rs. mod schema { @@ -129,14 +130,14 @@ where // Kademlia's default time-to-live for Dht records is 36h, republishing records every 24h. Given that a node // could restart at any point in time, one can not depend on the republishing process, thus publishing own // external addresses should happen on an interval < 36h. - let publish_interval = Interval::new_at( + let publish_interval = interval_at( Instant::now() + LIBP2P_KADEMLIA_BOOTSTRAP_TIME, Duration::from_secs(12 * 60 * 60), ); // External addresses of other authorities can change at any given point in time. The interval on which to query // for external addresses of other authorities is a trade off between efficiency and performance. - let query_interval = Interval::new_at( + let query_interval = interval_at( Instant::now() + LIBP2P_KADEMLIA_BOOTSTRAP_TIME, Duration::from_secs(10 * 60), ); @@ -455,6 +456,19 @@ fn hash_authority_id(id: &[u8]) -> Result { .map_err(Error::HashingAuthorityId) } +fn interval_at(start: Instant, duration: Duration) -> Interval { + let stream = futures::stream::unfold((), move |_| { + let wait_time = start.saturating_duration_since(Instant::now()); + + futures::future::join( + Delay::new(wait_time), + Delay::new(duration) + ).map(|_| Some(((), ()))) + }).map(drop); + + Box::new(stream) +} + #[cfg(test)] mod tests { use super::*; diff --git a/client/basic-authorship/Cargo.toml b/client/basic-authorship/Cargo.toml index 3104b70043b0c..4d3309fb2d1d7 100644 --- a/client/basic-authorship/Cargo.toml +++ b/client/basic-authorship/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] log = "0.4.8" -futures-preview = "0.3.0-alpha.19" +futures = "0.3.1" codec = { package = "parity-scale-codec", version = "1.0.0" } sr-primitives = { path = "../../primitives/sr-primitives" } primitives = { package = "substrate-primitives", path = "../../primitives/core" } diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index e156339cdf4d1..366a314c8b6ae 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -17,10 +17,9 @@ ansi_term = "0.12.1" lazy_static = "1.4.0" app_dirs = "1.2.1" tokio = "0.1.22" -futures = "0.1.29" -futures03 = { package = "futures-preview", version = "=0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } +futures01 = "0.1.29" fdlimit = "0.1.1" -exit-future = "0.1.4" serde_json = "1.0.41" panic-handler = { package = "substrate-panic-handler", path = "../../primitives/panic-handler" } client-api = { package = "substrate-client-api", path = "../api" } diff --git a/client/cli/src/informant.rs b/client/cli/src/informant.rs index 4e9572522c331..2f32f95b67f84 100644 --- a/client/cli/src/informant.rs +++ b/client/cli/src/informant.rs @@ -17,8 +17,7 @@ //! Console informant. Prints sync progress and block events. Runs on the calling thread. use client_api::BlockchainEvents; -use futures::{Future, Stream}; -use futures03::{StreamExt as _, TryStreamExt as _}; +use futures::{StreamExt, TryStreamExt, FutureExt, future, compat::Stream01CompatExt}; use log::{info, warn}; use sr_primitives::traits::Header; use service::AbstractService; @@ -27,17 +26,18 @@ use std::time::Duration; mod display; /// Creates an informant in the form of a `Future` that must be polled regularly. -pub fn build(service: &impl AbstractService) -> impl Future { +pub fn build(service: &impl AbstractService) -> impl futures::Future { let client = service.client(); let mut display = display::InformantDisplay::new(); let display_notifications = service .network_status(Duration::from_millis(5000)) - .for_each(move |(net_status, _)| { + .compat() + .try_for_each(move |(net_status, _)| { let info = client.info(); display.display(&info, net_status); - Ok(()) + future::ok(()) }); let client = service.client(); @@ -46,7 +46,7 @@ pub fn build(service: &impl AbstractService) -> impl Future(v)).compat().for_each(move |n| { + let display_block_import = client.import_notification_stream().for_each(move |n| { // detect and log reorganizations. if let Some((ref last_num, ref last_hash)) = last_best { if n.header.parent_hash() != last_hash && n.is_new_best { @@ -74,9 +74,11 @@ pub fn build(service: &impl AbstractService) -> impl Future + Send + 'static; + type Exit: Future + Unpin + Send + 'static; /// Convert into exit signal. fn into_exit(self) -> Self::Exit; } @@ -391,14 +391,16 @@ impl<'a> ParseAndPrepareExport<'a> { // Note: while we would like the user to handle the exit themselves, we handle it here // for backwards compatibility reasons. let (exit_send, exit_recv) = std::sync::mpsc::channel(); - let exit = exit.into_exit(); + let exit = exit.into_exit() + .map(|_| Ok::<_, ()>(())) + .compat(); std::thread::spawn(move || { let _ = exit.wait(); let _ = exit_send.send(()); }); let mut export_fut = builder(config)?.export_blocks(file, from.into(), to.map(Into::into), json); - let fut = futures::future::poll_fn(|| { + let fut = futures01::future::poll_fn(|| { if exit_recv.try_recv().is_ok() { return Ok(Async::Ready(())); } @@ -453,14 +455,16 @@ impl<'a> ParseAndPrepareImport<'a> { // Note: while we would like the user to handle the exit themselves, we handle it here // for backwards compatibility reasons. let (exit_send, exit_recv) = std::sync::mpsc::channel(); - let exit = exit.into_exit(); + let exit = exit.into_exit() + .map(|_| Ok::<_, ()>(())) + .compat(); std::thread::spawn(move || { let _ = exit.wait(); let _ = exit_send.send(()); }); let mut import_fut = builder(config)?.import_blocks(file); - let fut = futures::future::poll_fn(|| { + let fut = futures01::future::poll_fn(|| { if exit_recv.try_recv().is_ok() { return Ok(Async::Ready(())); } diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index 12998608e916c..7ef9b514f0cb0 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -14,9 +14,9 @@ client-api = { package = "substrate-client-api", path = "../../api" } codec = { package = "parity-scale-codec", version = "1.0.0" } consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } derive_more = "0.15.0" -futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] } -futures-timer = "0.4.0" +futures = { version = "0.3.1", features = ["compat"] } futures01 = { package = "futures", version = "0.1" } +futures-timer = "0.4.0" inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" } keystore = { package = "substrate-keystore", path = "../../keystore" } log = "0.4.8" diff --git a/client/consensus/babe/Cargo.toml b/client/consensus/babe/Cargo.toml index 3a903f122824d..c23bd1b84c613 100644 --- a/client/consensus/babe/Cargo.toml +++ b/client/consensus/babe/Cargo.toml @@ -29,7 +29,7 @@ uncles = { package = "substrate-consensus-uncles", path = "../uncles" } slots = { package = "substrate-consensus-slots", path = "../slots" } sr-primitives = { path = "../../../primitives/sr-primitives" } fork-tree = { path = "../../../utils/fork-tree" } -futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } futures01 = { package = "futures", version = "0.1" } futures-timer = "0.4.0" parking_lot = "0.9.0" diff --git a/client/consensus/pow/Cargo.toml b/client/consensus/pow/Cargo.toml index 01c6d22458f8a..455986e2f6e17 100644 --- a/client/consensus/pow/Cargo.toml +++ b/client/consensus/pow/Cargo.toml @@ -15,6 +15,6 @@ inherents = { package = "substrate-inherents", path = "../../../primitives/inher pow-primitives = { package = "substrate-consensus-pow-primitives", path = "../../../primitives/consensus/pow" } consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } log = "0.4.8" -futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } sp-timestamp = { path = "../../../primitives/timestamp" } derive_more = "0.15.0" diff --git a/client/consensus/slots/Cargo.toml b/client/consensus/slots/Cargo.toml index 5e9af2f29a474..6218d965c72a2 100644 --- a/client/consensus/slots/Cargo.toml +++ b/client/consensus/slots/Cargo.toml @@ -14,8 +14,8 @@ sr-primitives = { path = "../../../primitives/sr-primitives" } substrate-telemetry = { path = "../../telemetry" } consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" } -futures-preview = "0.3.0-alpha.19" -futures-timer = "0.4.0" +futures = "0.3.1" +futures-timer = "2.0" parking_lot = "0.9.0" log = "0.4.8" diff --git a/client/consensus/slots/src/lib.rs b/client/consensus/slots/src/lib.rs index 5897f88c77c29..02f6c15b79492 100644 --- a/client/consensus/slots/src/lib.rs +++ b/client/consensus/slots/src/lib.rs @@ -192,12 +192,10 @@ pub trait SimpleSlotWorker { remaining_duration, ).map_err(|e| consensus_common::Error::ClientImport(format!("{:?}", e))), Delay::new(remaining_duration) - .map_err(consensus_common::Error::FaultyTimer) ).map(|v| match v { futures::future::Either::Left((b, _)) => b.map(|b| (b, claim)), - futures::future::Either::Right((Ok(_), _)) => + futures::future::Either::Right(_) => Err(consensus_common::Error::ClientImport("Timeout in the Slots proposer".into())), - futures::future::Either::Right((Err(err), _)) => Err(err), }); let block_import_params_maker = self.block_import_params(); diff --git a/client/consensus/slots/src/slots.rs b/client/consensus/slots/src/slots.rs index 0157bc70355d0..0166d09bb74d2 100644 --- a/client/consensus/slots/src/slots.rs +++ b/client/consensus/slots/src/slots.rs @@ -137,8 +137,7 @@ impl Stream for Slots { if let Some(ref mut inner_delay) = self.inner_delay { match Future::poll(Pin::new(inner_delay), cx) { Poll::Pending => return Poll::Pending, - Poll::Ready(Err(err)) => return Poll::Ready(Some(Err(Error::FaultyTimer(err)))), - Poll::Ready(Ok(())) => {} + Poll::Ready(()) => {} } } diff --git a/client/finality-grandpa/Cargo.toml b/client/finality-grandpa/Cargo.toml index 95652dfddb08c..85c49cf8cee37 100644 --- a/client/finality-grandpa/Cargo.toml +++ b/client/finality-grandpa/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] fork-tree = { path = "../../utils/fork-tree" } futures = "0.1.29" -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures03 = { package = "futures", version = "0.3.1", features = ["compat"] } log = "0.4.8" parking_lot = "0.9.0" tokio-executor = "0.1.8" diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index c92410f02a2c4..2feea5fe9dc7f 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -15,7 +15,7 @@ parking_lot = "0.9.0" bitflags = "1.2.0" fnv = "1.0.6" futures = "0.1.29" -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures03 = { package = "futures", version = "0.3.1", features = ["compat"] } futures-timer = "0.4.0" linked-hash-map = "0.5.2" linked_hash_set = "0.1.3" diff --git a/client/network/src/debug_info.rs b/client/network/src/debug_info.rs index 0283853a5fa14..daf49df637540 100644 --- a/client/network/src/debug_info.rs +++ b/client/network/src/debug_info.rs @@ -27,7 +27,7 @@ use log::{debug, trace, error}; use std::collections::hash_map::Entry; use std::time::{Duration, Instant}; use tokio_io::{AsyncRead, AsyncWrite}; -use futures_timer::Interval; +use crate::utils::interval; /// Time after we disconnect from a node before we purge its information from the cache. const CACHE_EXPIRE: Duration = Duration::from_secs(10 * 60); @@ -76,7 +76,7 @@ impl DebugInfoBehaviour { ping: Ping::new(PingConfig::new()), identify, nodes_info: FnvHashMap::default(), - garbage_collect: Box::new(Interval::new(GARBAGE_COLLECT_INTERVAL).map(|()| Ok(())).compat()), + garbage_collect: Box::new(interval(GARBAGE_COLLECT_INTERVAL).map(|()| Ok(())).compat()), } } diff --git a/client/network/src/lib.rs b/client/network/src/lib.rs index d0977d90c9005..96efd49958763 100644 --- a/client/network/src/lib.rs +++ b/client/network/src/lib.rs @@ -177,6 +177,7 @@ mod on_demand_layer; mod protocol; mod service; mod transport; +mod utils; pub mod config; pub mod error; diff --git a/client/network/src/protocol.rs b/client/network/src/protocol.rs index 780a071505a65..6634ca9c85916 100644 --- a/client/network/src/protocol.rs +++ b/client/network/src/protocol.rs @@ -16,6 +16,7 @@ use crate::{DiscoveryNetBehaviour, config::ProtocolId}; use crate::legacy_proto::{LegacyProto, LegacyProtoOut}; +use crate::utils::interval; use bytes::BytesMut; use futures::prelude::*; use futures03::{StreamExt as _, TryStreamExt as _}; @@ -430,8 +431,8 @@ impl, H: ExHashT> Protocol { let behaviour = LegacyProto::new(protocol_id, versions, peerset); let protocol = Protocol { - tick_timeout: Box::new(futures_timer::Interval::new(TICK_TIMEOUT).map(|v| Ok::<_, ()>(v)).compat()), - propagate_timeout: Box::new(futures_timer::Interval::new(PROPAGATE_TIMEOUT).map(|v| Ok::<_, ()>(v)).compat()), + tick_timeout: Box::new(interval(TICK_TIMEOUT).map(|v| Ok::<_, ()>(v)).compat()), + propagate_timeout: Box::new(interval(PROPAGATE_TIMEOUT).map(|v| Ok::<_, ()>(v)).compat()), config, context_data: ContextData { peers: HashMap::new(), diff --git a/client/network/src/utils.rs b/client/network/src/utils.rs new file mode 100644 index 0000000000000..db8bf2086ff28 --- /dev/null +++ b/client/network/src/utils.rs @@ -0,0 +1,25 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + +use std::time::Duration; +use futures03::{FutureExt, Stream, StreamExt, stream::unfold}; +use futures_timer::Delay; + +pub fn interval(duration: Duration) -> impl Stream + Unpin { + unfold((), move |_| { + Delay::new(duration).map(|_| Some(((), ()))) + }).map(drop) +} diff --git a/client/offchain/Cargo.toml b/client/offchain/Cargo.toml index 29621d8502bc1..de7f052d3b8c9 100644 --- a/client/offchain/Cargo.toml +++ b/client/offchain/Cargo.toml @@ -12,8 +12,8 @@ client-api = { package = "substrate-client-api", path = "../api" } sr-api = { path = "../../primitives/sr-api" } fnv = "1.0.6" futures01 = { package = "futures", version = "0.1" } -futures-preview = "0.3.0-alpha.19" -futures-timer = "0.4.0" +futures = "0.3.1" +futures-timer = "2.0" log = "0.4.8" threadpool = "1.7" num_cpus = "1.10" diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 4bd0f84b5f029..f8eaac0af0cdf 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -10,7 +10,7 @@ client-api = { package = "substrate-client-api", path = "../api" } client = { package = "substrate-client", path = "../" } sr-api = { path = "../../primitives/sr-api" } codec = { package = "parity-scale-codec", version = "1.0.0" } -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } jsonrpc-pubsub = "14.0.3" log = "0.4.8" primitives = { package = "substrate-primitives", path = "../../primitives/core" } @@ -29,7 +29,7 @@ parking_lot = { version = "0.9.0" } [dev-dependencies] assert_matches = "1.3.0" -futures = "0.1.29" +futures01 = { package = "futures", version = "0.1.29" } network = { package = "substrate-network", path = "../network" } rustc-hex = "2.0.1" sr-io = { path = "../../primitives/sr-io" } diff --git a/client/rpc/api/Cargo.toml b/client/rpc/api/Cargo.toml index 053e58d031548..906efeaffb9ac 100644 --- a/client/rpc/api/Cargo.toml +++ b/client/rpc/api/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "1.0.0" } derive_more = "0.15.0" -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures = { version = "0.3.1", features = ["compat"] } jsonrpc-core = "14.0.3" jsonrpc-core-client = "14.0.3" jsonrpc-derive = "14.0.3" diff --git a/client/rpc/api/src/helpers.rs b/client/rpc/api/src/helpers.rs index d500a50a869b4..2735879daf56b 100644 --- a/client/rpc/api/src/helpers.rs +++ b/client/rpc/api/src/helpers.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use jsonrpc_core::futures::prelude::*; -use futures03::{channel::oneshot, compat::Compat}; +use futures::{channel::oneshot, compat::Compat}; /// Wraps around `oneshot::Receiver` and adjusts the error type to produce an internal error if the /// sender gets dropped. diff --git a/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index e0d7cc10d7890..29be7b8d88222 100644 --- a/client/rpc/src/author/mod.rs +++ b/client/rpc/src/author/mod.rs @@ -20,7 +20,7 @@ mod tests; use std::{sync::Arc, convert::TryInto}; -use futures03::future::{FutureExt, TryFutureExt}; +use futures::future::{FutureExt, TryFutureExt}; use log::warn; use client::Client; @@ -30,7 +30,7 @@ use rpc::futures::{ Sink, Future, future::result, }; -use futures03::{StreamExt as _, compat::Compat, future::ready}; +use futures::{StreamExt as _, compat::Compat, future::ready}; use api::Subscriptions; use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; use codec::{Encode, Decode}; diff --git a/client/rpc/src/chain/chain_light.rs b/client/rpc/src/chain/chain_light.rs index 5c2f1f803a438..94afc7a9d347d 100644 --- a/client/rpc/src/chain/chain_light.rs +++ b/client/rpc/src/chain/chain_light.rs @@ -17,7 +17,7 @@ //! Blockchain API backend for light nodes. use std::sync::Arc; -use futures03::{future::ready, FutureExt, TryFutureExt}; +use futures::{future::ready, FutureExt, TryFutureExt}; use rpc::futures::future::{result, Future, Either}; use api::Subscriptions; diff --git a/client/rpc/src/chain/mod.rs b/client/rpc/src/chain/mod.rs index e846f7b59c441..20806c621919d 100644 --- a/client/rpc/src/chain/mod.rs +++ b/client/rpc/src/chain/mod.rs @@ -23,7 +23,7 @@ mod chain_light; mod tests; use std::sync::Arc; -use futures03::{future, StreamExt as _, TryStreamExt as _}; +use futures::{future, StreamExt, TryStreamExt}; use log::warn; use rpc::{ Result as RpcResult, diff --git a/client/rpc/src/state/state_full.rs b/client/rpc/src/state/state_full.rs index 7c4382210ce8f..dcb876c846d85 100644 --- a/client/rpc/src/state/state_full.rs +++ b/client/rpc/src/state/state_full.rs @@ -19,7 +19,7 @@ use std::collections::{BTreeMap, HashMap}; use std::sync::Arc; use std::ops::Range; -use futures03::{future, StreamExt as _, TryStreamExt as _}; +use futures::{future, StreamExt as _, TryStreamExt as _}; use log::warn; use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; use rpc::{ diff --git a/client/rpc/src/state/state_light.rs b/client/rpc/src/state/state_light.rs index 2c8e59c5b6aac..c3155ef4a93ba 100644 --- a/client/rpc/src/state/state_light.rs +++ b/client/rpc/src/state/state_light.rs @@ -21,7 +21,7 @@ use std::{ collections::{HashSet, HashMap, hash_map::Entry}, }; use codec::Decode; -use futures03::{ +use futures::{ future::{ready, Either}, channel::oneshot::{channel, Sender}, FutureExt, TryFutureExt, @@ -753,7 +753,7 @@ mod tests { #[test] fn maybe_share_remote_request_shares_request() { - type UnreachableFuture = futures03::future::Ready>; + type UnreachableFuture = futures::future::Ready>; let shared_requests = SimpleSubscriptions::default(); diff --git a/client/rpc/src/state/tests.rs b/client/rpc/src/state/tests.rs index 2e3690f3058a2..87a4b004667f7 100644 --- a/client/rpc/src/state/tests.rs +++ b/client/rpc/src/state/tests.rs @@ -20,7 +20,7 @@ use self::error::Error; use std::sync::Arc; use assert_matches::assert_matches; -use futures::stream::Stream; +use futures01::stream::Stream; use primitives::storage::well_known_keys; use sr_io::hashing::blake2_256; use test_client::{ diff --git a/client/rpc/src/system/mod.rs b/client/rpc/src/system/mod.rs index 8907151d9ac69..88d2938665528 100644 --- a/client/rpc/src/system/mod.rs +++ b/client/rpc/src/system/mod.rs @@ -19,7 +19,7 @@ #[cfg(test)] mod tests; -use futures03::{channel::{mpsc, oneshot}, compat::Compat}; +use futures::{channel::{mpsc, oneshot}, compat::Compat}; use api::Receiver; use sr_primitives::traits::{self, Header as HeaderT}; use self::error::Result; diff --git a/client/rpc/src/system/tests.rs b/client/rpc/src/system/tests.rs index 1c532be372660..b4b3e67cee878 100644 --- a/client/rpc/src/system/tests.rs +++ b/client/rpc/src/system/tests.rs @@ -20,7 +20,7 @@ use network::{self, PeerId}; use network::config::Roles; use test_client::runtime::Block; use assert_matches::assert_matches; -use futures03::{prelude::*, channel::mpsc}; +use futures::{prelude::*, channel::mpsc}; use std::thread; struct Status { @@ -46,7 +46,7 @@ fn api>>(sync: T) -> System { let should_have_peers = !status.is_dev; let (tx, rx) = mpsc::unbounded(); thread::spawn(move || { - futures03::executor::block_on(rx.for_each(move |request| { + futures::executor::block_on(rx.for_each(move |request| { match request { Request::Health(sender) => { let _ = sender.send(Health { @@ -231,4 +231,4 @@ fn system_node_roles() { wait_receiver(api(None).system_node_roles()), vec![NodeRole::Authority] ); -} \ No newline at end of file +} diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index f7ede13471383..0c7636cefac7f 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -16,7 +16,7 @@ wasmtime = [ [dependencies] derive_more = "0.15.0" futures = "0.1.29" -futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] } +futures03 = { package = "futures", version = "0.3.1", features = ["compat"] } parking_lot = "0.9.0" lazy_static = "1.4.0" log = "0.4.8" diff --git a/client/service/test/Cargo.toml b/client/service/test/Cargo.toml index 82b39ce767e38..365fd87bfec86 100644 --- a/client/service/test/Cargo.toml +++ b/client/service/test/Cargo.toml @@ -11,7 +11,7 @@ futures = "0.1.29" log = "0.4.8" env_logger = "0.7.0" fdlimit = "0.1.1" -futures03 = { package = "futures-preview", version = "=0.3.0-alpha.19", features = ["compat"] } +futures03 = { package = "futures", version = "0.3.1", features = ["compat"] } service = { package = "substrate-service", path = "../../service", default-features = false } network = { package = "substrate-network", path = "../../network" } consensus = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } diff --git a/client/src/client.rs b/client/src/client.rs index def038fb3e022..f0ba9a501243b 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -21,7 +21,7 @@ use std::{ panic::UnwindSafe, result, cell::RefCell, }; use log::{info, trace, warn}; -use futures03::channel::mpsc; +use futures::channel::mpsc; use parking_lot::{Mutex, RwLock}; use codec::{Encode, Decode}; use hash_db::{Hasher, Prefix}; diff --git a/client/src/light/blockchain.rs b/client/src/light/blockchain.rs index aa1866ae4d789..b9003c6a292be 100644 --- a/client/src/light/blockchain.rs +++ b/client/src/light/blockchain.rs @@ -177,7 +177,7 @@ pub fn future_header>( fetcher: &F, id: BlockId, ) -> impl Future, ClientError>> { - use futures03::future::{ready, Either, FutureExt}; + use futures::future::{ready, Either, FutureExt}; match blockchain.header(id) { Ok(LocalOrRemote::Remote(request)) => Either::Left( diff --git a/client/telemetry/Cargo.toml b/client/telemetry/Cargo.toml index 82096a2cbf788..07a296b02f8e0 100644 --- a/client/telemetry/Cargo.toml +++ b/client/telemetry/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" bytes = "0.4.12" parking_lot = "0.9.0" futures01 = { package = "futures", version = "0.1" } -futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] } -futures-timer = "0.4.0" +futures = { version = "0.3.1", features = ["compat"] } +futures-timer = "2.0.0" libp2p = { version = "0.13.0", default-features = false, features = ["libp2p-websocket"] } log = "0.4.8" rand = "0.7.2" diff --git a/client/telemetry/src/worker/node.rs b/client/telemetry/src/worker/node.rs index 0f606e4063802..6d9c6c241b669 100644 --- a/client/telemetry/src/worker/node.rs +++ b/client/telemetry/src/worker/node.rs @@ -254,11 +254,7 @@ where TTrans::Output: Sink if let Some(timeout) = self.timeout.as_mut() { match Future::poll(Pin::new(timeout), cx) { Poll::Pending => {}, - Poll::Ready(Err(err)) => { - self.timeout = None; - warn!(target: "telemetry", "Connection timeout error for {} {:?}", my_addr, err); - } - Poll::Ready(Ok(_)) => { + Poll::Ready(()) => { self.timeout = None; return Poll::Ready(Err(ConnectionError::Timeout)) } diff --git a/client/transaction-pool/Cargo.toml b/client/transaction-pool/Cargo.toml index 1060dcd2a3ed3..60bf0c005c7d9 100644 --- a/client/transaction-pool/Cargo.toml +++ b/client/transaction-pool/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "1.0.0" } derive_more = "0.15.0" -futures = { version = "0.3.0", features = ["thread-pool"] } +futures = { version = "0.3.1", features = ["thread-pool"] } log = "0.4.8" parking_lot = "0.9.0" primitives = { package = "substrate-primitives", path = "../../primitives/core" } diff --git a/client/transaction-pool/graph/Cargo.toml b/client/transaction-pool/graph/Cargo.toml index 93068c514add0..c81e59e17fe4c 100644 --- a/client/transaction-pool/graph/Cargo.toml +++ b/client/transaction-pool/graph/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] derive_more = "0.15.0" -futures-preview = "0.3.0-alpha.19" +futures = "0.3.1" log = "0.4.8" parking_lot = "0.9.0" serde = { version = "1.0.101", features = ["derive"] } diff --git a/palette/system/rpc/Cargo.toml b/palette/system/rpc/Cargo.toml index 1f43db9ea2c68..eff399bbedbad 100644 --- a/palette/system/rpc/Cargo.toml +++ b/palette/system/rpc/Cargo.toml @@ -20,4 +20,4 @@ transaction_pool = { package = "substrate-transaction-pool", path = "../../../cl [dev-dependencies] test-client = { package = "substrate-test-runtime-client", path = "../../../test/utils/runtime/client" } env_logger = "0.7.0" -futures03 = { package = "futures-preview", version = "=0.3.0-alpha.19" } +futures = "0.3.1" diff --git a/palette/system/rpc/src/lib.rs b/palette/system/rpc/src/lib.rs index 5bce6aaa439f0..62b88c2f15f83 100644 --- a/palette/system/rpc/src/lib.rs +++ b/palette/system/rpc/src/lib.rs @@ -119,7 +119,7 @@ where mod tests { use super::*; - use futures03::executor::block_on; + use futures::executor::block_on; use test_client::{ runtime::Transfer, AccountKeyring, diff --git a/primitives/consensus/common/Cargo.toml b/primitives/consensus/common/Cargo.toml index 6901bf09b70dc..11a266ac9dc10 100644 --- a/primitives/consensus/common/Cargo.toml +++ b/primitives/consensus/common/Cargo.toml @@ -11,7 +11,7 @@ libp2p = { version = "0.13.0", default-features = false } log = "0.4.8" primitives = { package = "substrate-primitives", path= "../../core" } inherents = { package = "substrate-inherents", path = "../../inherents" } -futures-preview = "0.3.0-alpha.19" +futures = { version = "0.3.1", features = ["thread-pool"] } futures-timer = "0.4.0" rstd = { package = "sr-std", path = "../../sr-std" } runtime_version = { package = "sr-version", path = "../../sr-version" } diff --git a/primitives/peerset/Cargo.toml b/primitives/peerset/Cargo.toml index c64c5e499c149..16a71b5f6d6b5 100644 --- a/primitives/peerset/Cargo.toml +++ b/primitives/peerset/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -futures-preview = "0.3.0-alpha.19" +futures = "0.3.1" libp2p = { version = "0.13.0", default-features = false } log = "0.4.8" serde_json = "1.0.41" diff --git a/test/utils/client/Cargo.toml b/test/utils/client/Cargo.toml index a000d8186f8e6..d0ba0eca7ca19 100644 --- a/test/utils/client/Cargo.toml +++ b/test/utils/client/Cargo.toml @@ -10,7 +10,7 @@ client = { package = "substrate-client", path = "../../../client/" } client-db = { package = "substrate-client-db", path = "../../../client//db", features = ["test-helpers"] } consensus = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" } executor = { package = "substrate-executor", path = "../../../client/executor" } -futures-preview = "0.3.0-alpha.19" +futures = "0.3.1" hash-db = "0.15.2" keyring = { package = "substrate-keyring", path = "../../../primitives/keyring" } codec = { package = "parity-scale-codec", version = "1.0.0" }