From 68ca8df22f2ef425990c7df410b63fa78d02c86f Mon Sep 17 00:00:00 2001 From: Nick Sanders Date: Mon, 22 Oct 2018 00:40:50 -0700 Subject: [PATCH] Replace `tokio_core` with `tokio` (`ring` -> 0.13) (#9657) * Replace `tokio_core` with `tokio`. * Remove `tokio-core` and replace with `tokio` in - `ethcore/stratum` - `secret_store` - `util/fetch` - `util/reactor` * Bump hyper to 0.12 in - `miner` - `util/fake-fetch` - `util/fetch` - `secret_store` * Bump `jsonrpc-***` to 0.9 in - `parity` - `ethcore/stratum` - `ipfs` - `rpc` - `rpc_client` - `whisper` * Bump `ring` to 0.13 * Use a more graceful shutdown process in `secret_store` tests. * Convert some mutexes to rwlocks in `secret_store`. * Consolidate Tokio Runtime use, remove `CpuPool`. * Rename and move the `tokio_reactor` crate (`util/reactor`) to `tokio_runtime` (`util/runtime`). * Rename `EventLoop` to `Runtime`. - Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`. - Add the `Runtime::with_thread_count` method. - Rename `Remote` to `Executor`. * Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor instead. * Other changes related to `CpuPool` removal: - Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument. - Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument. --- Cargo.lock | 1179 +++++++++-------- Cargo.toml | 10 +- ethcore/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 2 +- ethcore/private-tx/src/encryptor.rs | 4 +- ethcore/stratum/Cargo.toml | 8 +- ethcore/stratum/src/lib.rs | 71 +- ethkey/Cargo.toml | 2 +- ethstore/Cargo.toml | 2 +- hash-fetch/Cargo.toml | 4 +- hash-fetch/src/client.rs | 29 +- hash-fetch/src/lib.rs | 5 +- ipfs/Cargo.toml | 8 +- ipfs/src/error.rs | 61 +- ipfs/src/lib.rs | 84 +- miner/Cargo.toml | 7 +- miner/src/gas_price_calibrator.rs | 4 +- miner/src/lib.rs | 2 +- miner/src/work_notify.rs | 19 +- parity/lib.rs | 3 +- parity/light_helpers/queue_cull.rs | 8 +- parity/params.rs | 4 +- parity/rpc.rs | 17 +- parity/rpc_apis.rs | 31 +- parity/run.rs | 44 +- price-info/Cargo.toml | 3 +- price-info/src/lib.rs | 35 +- rpc/Cargo.toml | 21 +- rpc/src/http_common.rs | 12 +- rpc/src/lib.rs | 12 +- rpc/src/tests/helpers.rs | 10 +- rpc/src/tests/rpc.rs | 11 +- rpc/src/tests/ws.rs | 3 +- rpc/src/v1/extractors.rs | 15 +- rpc/src/v1/helpers/nonce.rs | 62 +- rpc/src/v1/helpers/subscription_manager.rs | 12 +- rpc/src/v1/impls/eth_pubsub.rs | 30 +- rpc/src/v1/impls/light/parity_set.rs | 7 +- rpc/src/v1/impls/parity_set.rs | 6 +- rpc/src/v1/impls/pubsub.rs | 16 +- rpc/src/v1/impls/signer.rs | 6 +- rpc/src/v1/impls/signing.rs | 20 +- rpc/src/v1/informant.rs | 34 +- rpc/src/v1/tests/eth.rs | 6 +- rpc/src/v1/tests/mocked/eth.rs | 6 +- rpc/src/v1/tests/mocked/eth_pubsub.rs | 18 +- rpc/src/v1/tests/mocked/parity_set.rs | 4 +- rpc/src/v1/tests/mocked/personal.rs | 6 +- rpc/src/v1/tests/mocked/pubsub.rs | 6 +- rpc/src/v1/tests/mocked/signer.rs | 10 +- rpc/src/v1/tests/mocked/signing.rs | 14 +- rpc_client/Cargo.toml | 4 +- rpc_client/src/client.rs | 2 +- secret_store/Cargo.toml | 9 +- secret_store/src/key_server.rs | 12 +- .../client_sessions/generation_session.rs | 15 +- .../src/key_server_cluster/cluster.rs | 404 +++--- .../src/key_server_cluster/io/deadline.rs | 50 +- .../io/shared_tcp_stream.rs | 2 +- .../net/accept_connection.rs | 11 +- .../src/key_server_cluster/net/connect.rs | 11 +- secret_store/src/lib.rs | 3 - secret_store/src/listener/http_listener.rs | 186 ++- util/fake-fetch/Cargo.toml | 2 +- util/fake-fetch/src/lib.rs | 9 +- util/fetch/Cargo.toml | 8 +- util/fetch/src/client.rs | 453 ++++--- util/fetch/src/lib.rs | 4 +- util/network-devp2p/Cargo.toml | 2 +- util/network/Cargo.toml | 2 +- util/reactor/src/lib.rs | 238 ---- util/{reactor => runtime}/Cargo.toml | 6 +- util/runtime/src/lib.rs | 256 ++++ whisper/Cargo.toml | 8 +- whisper/cli/Cargo.toml | 6 +- 75 files changed, 2027 insertions(+), 1671 deletions(-) delete mode 100644 util/reactor/src/lib.rs rename util/{reactor => runtime}/Cargo.toml (68%) create mode 100644 util/runtime/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 1e7256ba2..99edb6de0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,7 +3,7 @@ name = "aho-corasick" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -16,7 +16,7 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -30,6 +30,11 @@ dependencies = [ "xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arrayref" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "arrayvec" version = "0.4.7" @@ -55,7 +60,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -67,7 +72,7 @@ dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -86,20 +91,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "base64" -version = "0.6.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "base64" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -109,7 +105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -140,6 +136,15 @@ name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "block-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "blooms-db" version = "0.1.0" @@ -161,6 +166,11 @@ dependencies = [ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "byte-tools" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "1.2.6" @@ -196,7 +206,7 @@ version = "0.1.0" dependencies = [ "ethjson 0.1.0", "serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -205,18 +215,18 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cid" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "multibase 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "multihash 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -243,7 +253,7 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.33" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -251,13 +261,13 @@ dependencies = [ [[package]] name = "combine" -version = "3.5.2" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -350,10 +360,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ct-logs" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "sct 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -379,6 +389,14 @@ name = "difference" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "digest" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dir" version = "0.1.2" @@ -396,8 +414,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -428,15 +446,7 @@ dependencies = [ "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "error-chain" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -459,15 +469,15 @@ dependencies = [ [[package]] name = "ethabi" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -481,11 +491,11 @@ name = "ethabi-derive" version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -511,7 +521,7 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -526,7 +536,7 @@ dependencies = [ "common-types 0.1.0", "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", @@ -561,7 +571,7 @@ dependencies = [ "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-machine 0.1.0", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -623,7 +633,7 @@ dependencies = [ "ethcore-transaction 0.1.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -641,8 +651,8 @@ dependencies = [ "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -677,14 +687,13 @@ dependencies = [ "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-reactor 0.1.0", + "parity-runtime 0.1.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -705,7 +714,7 @@ dependencies = [ "ethkey 0.3.0", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -730,7 +739,7 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -738,9 +747,9 @@ dependencies = [ "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -751,7 +760,7 @@ name = "ethcore-private-tx" version = "1.0.0" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", @@ -763,12 +772,12 @@ dependencies = [ "ethjson 0.1.0", "ethkey 0.3.0", "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", @@ -776,9 +785,9 @@ dependencies = [ "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -789,7 +798,7 @@ name = "ethcore-secretstore" version = "1.0.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", @@ -798,27 +807,24 @@ dependencies = [ "ethcore-transaction 0.1.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -849,14 +855,14 @@ dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-logger 1.12.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-tcp-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-tcp-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -916,7 +922,7 @@ dependencies = [ "ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -925,7 +931,7 @@ name = "ethereum-types-serialize" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -934,9 +940,9 @@ version = "0.1.0" dependencies = [ "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -950,13 +956,13 @@ dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mem 0.1.0", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -970,8 +976,8 @@ dependencies = [ "panic_hook 0.1.0", "parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -986,14 +992,14 @@ dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1011,8 +1017,8 @@ dependencies = [ "panic_hook 0.1.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1048,9 +1054,9 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", ] @@ -1060,8 +1066,8 @@ name = "fake-fetch" version = "0.0.1" dependencies = [ "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1072,6 +1078,11 @@ dependencies = [ "ethkey 0.3.0", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fastmap" version = "0.1.0" @@ -1093,12 +1104,12 @@ name = "fetch" version = "0.1.0" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1131,7 +1142,7 @@ dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1150,7 +1161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1158,15 +1169,23 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gcc" -version = "0.3.54" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "generic-array" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getopts" version = "0.2.18" @@ -1177,14 +1196,31 @@ dependencies = [ [[package]] name = "globset" -version = "0.2.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "h2" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (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.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1218,7 +1254,7 @@ name = "heapsize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1249,12 +1285,22 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "httparse" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1270,42 +1316,67 @@ name = "hyper" version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "hyper-rustls" -version = "0.11.0" +name = "hyper" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ct-logs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-rustls" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ct-logs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1323,7 +1394,7 @@ name = "igd" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1334,6 +1405,11 @@ dependencies = [ "xmltree 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "indexmap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "integer-encoding" version = "1.0.5" @@ -1377,7 +1453,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "combine 3.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "combine 3.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1411,97 +1487,101 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "8.0.1" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-http-server" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-server-utils 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-ipc-server" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-server-utils 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-tokio-ipc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-macros" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-pubsub" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-server-utils" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "globset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-tcp-server" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-server-utils 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-ws-server" -version = "8.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11#6b972b5fd34ada4a7de6aed1a8c92475a907732d" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2#207a277b098943864ecaf22dbab7a5e309866d6b" dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-server-utils 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.7.5 (git+https://github.com/tomusdrw/ws-rs)", ] @@ -1577,12 +1657,12 @@ name = "lazy_static" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lazycell" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1596,7 +1676,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1640,7 +1720,7 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1686,10 +1766,12 @@ version = "0.1.0" [[package]] name = "memchr" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1698,7 +1780,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1743,10 +1825,10 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1754,7 +1836,7 @@ name = "mime_guess" version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "mime 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1769,7 +1851,7 @@ dependencies = [ "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazycell 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1781,12 +1863,12 @@ dependencies = [ [[package]] name = "mio-named-pipes" version = "0.1.6" -source = "git+https://github.com/alexcrichton/mio-named-pipes#2072ae0de5b3632dbb065fcd9c8be6c6a2fc39ae" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1816,7 +1898,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1829,10 +1911,11 @@ dependencies = [ [[package]] name = "multihash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ring 0.12.1 (git+https://github.com/paritytech/ring)", + "sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1848,14 +1931,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "node-filter" version = "1.12.0" dependencies = [ - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", @@ -1883,7 +1966,7 @@ dependencies = [ "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1892,7 +1975,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1902,7 +1985,7 @@ name = "num-integer" version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1911,7 +1994,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1919,12 +2002,12 @@ name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1940,7 +2023,7 @@ name = "number_prefix" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1959,7 +2042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ordered-float" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2002,11 +2085,11 @@ dependencies = [ [[package]] name = "parity-crypto" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.12.1 (git+https://github.com/paritytech/ring)", + "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2039,11 +2122,10 @@ dependencies = [ "ethkey 0.3.0", "fake-fetch 0.0.1", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2059,9 +2141,9 @@ dependencies = [ "parity-ipfs-api 1.12.0", "parity-local-store 0.1.0", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-reactor 0.1.0", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", + "parity-runtime 0.1.0", "parity-updater 1.12.0", "parity-version 2.2.0", "parity-whisper 0.1.0", @@ -2075,35 +2157,33 @@ dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-hash-fetch" version = "1.12.0" dependencies = [ - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fake-fetch 0.0.1", "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-reactor 0.1.0", + "parity-runtime 0.1.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", @@ -2114,15 +2194,15 @@ dependencies = [ name = "parity-ipfs-api" version = "1.12.0" dependencies = [ - "cid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "multihash 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2137,9 +2217,9 @@ dependencies = [ "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2154,14 +2234,6 @@ name = "parity-path" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "parity-reactor" -version = "0.1.0" -dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parity-rocksdb" version = "0.5.0" @@ -2177,7 +2249,7 @@ name = "parity-rocksdb-sys" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2188,7 +2260,7 @@ name = "parity-rpc" version = "1.12.0" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "cid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore 1.12.0", "ethcore-devtools 1.12.0", @@ -2208,25 +2280,24 @@ dependencies = [ "fake-hardware-wallet 0.0.1", "fastmap 0.1.0", "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "hardware-wallet 1.12.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-ipc-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-ipc-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", - "multihash 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-reactor 0.1.0", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-runtime 0.1.0", "parity-updater 1.12.0", "parity-version 2.2.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2236,9 +2307,9 @@ dependencies = [ "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2252,19 +2323,27 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parity-runtime" +version = "0.1.0" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity-snappy" version = "0.1.0" @@ -2279,33 +2358,32 @@ name = "parity-snappy-sys" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-tokio-ipc" -version = "0.1.5" -source = "git+https://github.com/nikvolf/parity-tokio-ipc#c0f80b40399d7f08ef1e6869569640eb28645f56" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-named-pipes 0.1.0 (git+https://github.com/nikvolf/tokio-named-pipes)", - "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-named-pipes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-updater" version = "1.12.0" dependencies = [ - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", @@ -2334,7 +2412,7 @@ dependencies = [ "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2356,19 +2434,19 @@ dependencies = [ "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mem 0.1.0", - "ordered-float 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2389,7 +2467,7 @@ name = "parking_lot" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2405,7 +2483,7 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2506,12 +2584,11 @@ version = "1.12.0" dependencies = [ "fake-fetch 0.0.1", "fetch 0.1.0", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-runtime 0.1.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2558,7 +2635,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2586,9 +2663,9 @@ dependencies = [ "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", "wasm 0.1.0", ] @@ -2613,7 +2690,7 @@ name = "quote" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2633,7 +2710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2644,13 +2721,21 @@ dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.2.1" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2693,7 +2778,7 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2705,7 +2790,7 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2731,10 +2816,10 @@ dependencies = [ name = "registrar" version = "0.0.1" dependencies = [ - "ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2743,7 +2828,7 @@ name = "relay" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2751,20 +2836,18 @@ name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ring" -version = "0.12.1" -source = "git+https://github.com/paritytech/ring#bae475e9f7ea7dd4ae671bef4b576089a9b06731" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2801,10 +2884,10 @@ dependencies = [ name = "rlp_derive" version = "0.1.0" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2822,7 +2905,7 @@ dependencies = [ name = "rpc-cli" version = "1.4.0" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", "rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2838,7 +2921,7 @@ name = "rust-crypto" version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2875,15 +2958,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.11.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.12.1 (git+https://github.com/paritytech/ring)", - "sct 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2893,7 +2976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "safemem" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2916,11 +2999,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sct" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ring 0.12.1 (git+https://github.com/paritytech/ring)", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2938,17 +3021,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.78" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.78" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2956,17 +3039,17 @@ name = "serde_ignored" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.27" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2974,6 +3057,22 @@ name = "sha1" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sha1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sha2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "shell32-sys" version = "0.1.2" @@ -3017,11 +3116,6 @@ name = "slab" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "smallvec" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "smallvec" version = "0.6.5" @@ -3038,7 +3132,7 @@ dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3057,6 +3151,11 @@ dependencies = [ name = "stop-guard" version = "0.1.0" +[[package]] +name = "string" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "strsim" version = "0.6.0" @@ -3069,19 +3168,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.4" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "take" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "target_info" version = "0.1.0" @@ -3096,18 +3190,6 @@ dependencies = [ "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tempfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "term_size" version = "0.3.1" @@ -3120,7 +3202,7 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3159,7 +3241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3185,7 +3267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3206,32 +3288,33 @@ dependencies = [ [[package]] name = "tokio" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-codec" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3240,33 +3323,33 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-current-thread" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-executor" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3274,65 +3357,48 @@ name = "tokio-fs" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-io" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-named-pipes" version = "0.1.0" -source = "git+https://github.com/nikvolf/tokio-named-pipes#0b9b728eaeb0a6673c287ac7692be398fd651752" -dependencies = [ - "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-proto" -version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-reactor" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3340,7 +3406,7 @@ name = "tokio-retry" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3348,13 +3414,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.4.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3362,34 +3427,34 @@ name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-tcp" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-threadpool" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3397,19 +3462,19 @@ name = "tokio-timer" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-timer" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3418,52 +3483,36 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-uds" -version = "0.1.7" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-uds" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3532,6 +3581,16 @@ name = "try-lock" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typenum" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ucd-util" version = "0.1.1" @@ -3557,15 +3616,15 @@ name = "unicase" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicase" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3606,7 +3665,7 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3644,7 +3703,7 @@ dependencies = [ [[package]] name = "version_check" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3674,7 +3733,7 @@ version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3683,11 +3742,21 @@ name = "want" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wasm" version = "0.1.0" @@ -3716,20 +3785,20 @@ dependencies = [ [[package]] name = "webpki" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ring 0.12.1 (git+https://github.com/paritytech/ring)", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "webpki-roots" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3740,14 +3809,14 @@ dependencies = [ "ethcore-logger 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", - "jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", "parity-whisper 0.1.0", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3757,7 +3826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3779,7 +3848,7 @@ name = "winapi-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3792,7 +3861,7 @@ name = "wincolor" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3803,7 +3872,7 @@ source = "git+https://github.com/tomusdrw/ws-rs#f12d19c4c19422fc79af28a3181f598b dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3847,6 +3916,7 @@ dependencies = [ "checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)" = "" +"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" @@ -3854,26 +3924,27 @@ dependencies = [ "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" "checksum base-x 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5cda5d0f5584d129112ad8bf4775b9fd2b9f1e30738c7b1a25314ba2244d6a51" -"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" -"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" "checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "" +"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" "checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" -"checksum cid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d85ee025368e69063c420cbb2ed9f852cb03a5e69b73be021e65726ce03585b6" +"checksum cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0e37fba0087d9f3f4e269827a55dc511abf3e440cc097a0c154ff4e6584f988" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "704fbf3bb5149daab0afb255dbea24a1f08d2f4099cedb9baab6d470d4c5eefb" -"checksum combine 3.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54cedd8056314afe0d844a37a207007edf8a45f2cc452fd77629cd63c221740e" +"checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" +"checksum combine 3.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc1d011beeed29187b8db2ac3925c8dd4d3e87db463dc9d2d2833985388fc5bc" "checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" "checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" @@ -3883,24 +3954,25 @@ dependencies = [ "checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" "checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" -"checksum ct-logs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61cd11fb222fecf889f4531855c614548e92e8bd2eb178e35296885df5ee9a7c" +"checksum ct-logs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95a4bf5107667e12bf6ce31a3a5066d67acc88942b6742117a41198734aaccaa" "checksum ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)" = "" "checksum daemonize 0.2.3 (git+https://github.com/paritytech/daemonize)" = "" "checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" +"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d8acd393692c503b168471874953a2531df0e9ab77d0b6bbc582395743300a4a" "checksum edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd26878c3d921f89797a4e1a1711919f999a9f6946bb6f5a4ffda126d297b7e" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" -"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" -"checksum ethabi 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "36c7bf66bd7ff02c3bc512a276a0f95300e3abb87060704fddf588ae11b86d99" +"checksum ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eb362fde43ed0b50b258bb0c72b72b3dccfd29f8de9506295eaf9251c49ca31" "checksum ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "795e25fd868e12a59ca235dbe1f6cc8f1eba8f67d6a39438b29535e0126e0c27" "checksum ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "66a587250c8190be9d6ae28d67b8957ed97cb9eee2e272173a20593ab054a075" "checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" "checksum ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "35b3c5a18bc5e73a32a110ac743ec04b02bbbcd3b71d3118d40a6113d509378a" "checksum ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac59a21a9ce98e188f3dace9eb67a6c4a3c67ec7fbc7218cb827852679dc002" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" @@ -3908,11 +3980,13 @@ dependencies = [ "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "0c84b40c7e2de99ffd70602db314a7a8c26b2b3d830e6f7f7a142a8860ab3ca4" +"checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" +"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797" -"checksum globset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "464627f948c3190ae3d04b1bc6d7dca2f785bda0ac01278e6db129ad383dbeb6" +"checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" +"checksum h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c" "checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" "checksum hashdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d91261ee336dd046ac7df28306cb297b7a7228bd1ae25e9a57f4ed5e0ab628c7" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" @@ -3920,12 +3994,15 @@ dependencies = [ "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" "checksum hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)" = "" "checksum home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "80dff82fb58cfbbc617fb9a9184b010be0529201553cda50ad04372bc2333aff" -"checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540" +"checksum http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "24f58e8c2d8e886055c3ead7b28793e1455270b5fb39650984c224bc538ba581" +"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" "checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" -"checksum hyper-rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d6cdc1751771a14b8175764394f025e309a28c825ed9eaf97fa62bb831dc8c5" +"checksum hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)" = "78d50abbd1790e0f4c74cb1d4a2211b439bac661d54107ad5564c55e77906762" +"checksum hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68f2aa6b1681795bf4da8063f718cd23145aa0c9a5143d9787b345aa60d38ee4" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a254e265e8810deb357a9de757f784787ec415d056ededf410c0aa460afee9e" +"checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" @@ -3934,14 +4011,14 @@ dependencies = [ "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1ecfa3b81afc64d9a6539c4eece96ac9a93c551c713a313800dade8e33d7b5c1" "checksum jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -"checksum jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-ipc-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-server-utils 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-tcp-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" -"checksum jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.11)" = "" +"checksum jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-ipc-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-tcp-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" +"checksum jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)" = "" "checksum keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "253bbe643c32c816bf58fa5a88248fafedeebb139705ad17a62add3517854a86" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" @@ -3949,7 +4026,7 @@ dependencies = [ "checksum kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "06cf755dc587839ba34d3cbe3f12b6ad55850fbcdfe67336157a021a1a5c43ae" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" -"checksum lazycell 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e26d4c411b39f0afcf2ba6fe502be90e6c9b299c952dbd86124782520a13cffd" +"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" "checksum libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)" = "" @@ -3957,25 +4034,25 @@ dependencies = [ "checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939" "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" "checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" -"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54" +"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a3b4142ab8738a78c51896f704f83c11df047ff1bda9a92a661aa6361552d93d" +"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum memorydb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e143fbad9f90d2158bca3c4b09015276a6de6f085a77088943901cb26828780f" -"checksum mime 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "4b082692d3f6cf41b453af73839ce3dfc212c4411cbb2441dff80a716e38bd79" +"checksum mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "0a907b83e7b9e987032439a387e187119cddafc92d5c2aaeb1d92580a793f630" "checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" -"checksum mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)" = "" +"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" "checksum multibase 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9c35dac080fd6e16a99924c8dfdef0af89d797dd851adab25feaffacf7850d6" -"checksum multihash 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d49add5f49eb08bfc4d01ff286b84a48f53d45314f165c2d6efe477222d24f3" +"checksum multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c62469025f45dee2464ef9fc845f4683c543993792c1993e7d903c17a4546b74" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" @@ -3984,22 +4061,22 @@ dependencies = [ "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" +"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" "checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb" -"checksum ordered-float 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7004d4db808c6db5a9f54ec5c85918ad01a1ef9b35bf4dfa1e2ccba28de0c1b4" +"checksum ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7eb5259643245d3f292c7a146b2df53bba24d7eab159410e648eb73dc164669d" "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" -"checksum parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c1117f6574377d21309bfa1f7d69ff734120685d92b02c3f362b122585758840" +"checksum parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8adf489acb31f1922db0ce43803b6f48a425241a8473611be3cc625a8e4a4c47" "checksum parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5962540f99d3895d9addf535f37ab1397886bc2c68e59efd040ef458e5f8c3f7" "checksum parity-rocksdb 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd55d2d6d6000ec99f021cf52c9acc7d2a402e14f95ced4c5de230696fabe00b" "checksum parity-rocksdb-sys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e59eda423021494a6cf1be74f6989add403f53157409993f794e17b123cab51" "checksum parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c5f9d149b13134b8b354d93a92830efcbee6fe5b73a2e6e540fe70d4dd8a63" "checksum parity-snappy-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c2086caac40c79289cb70d7e1c64f5888e1c53f5d38399d3e95101493739f423" -"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "" +"checksum parity-tokio-ipc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb002c2d3539ccd3b82bd915ec060028d4ab350ad203dbffa20028c1e483af5b" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf13102febd98f4ad416a526b42deb82daf482626ba6ab10d0ebf8f45327514c" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" @@ -4018,7 +4095,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" -"checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901" +"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52fbc45bf6709565e44ef31847eb7407b3c3c80af811ee884a04da071dcca12b" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "90d2b3c5bf24275fc77db6b14ec00a7a085d8ff9d1c4215fb6f6263e8d7b01bc" @@ -4027,7 +4104,8 @@ dependencies = [ "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" -"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" +"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" "checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" @@ -4038,7 +4116,7 @@ dependencies = [ "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum ring 0.12.1 (git+https://github.com/paritytech/ring)" = "" +"checksum ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe642b9dd1ba0038d78c4a3999d1ee56178b4d415c1e1fbaba83b06dce012f0" "checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" @@ -4049,20 +4127,22 @@ dependencies = [ "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc9f2e05fd6a3ce1530cd5dbcc553d2f94d7749fe3e4f5b443668eddd842889e" +"checksum rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" +"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" "checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum sct 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1137b767bbe1c4d30656993bdd97422ed41255d9400b105d735f8c7d9e800632" +"checksum sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb8f61f9e6eadd062a71c380043d28036304a4706b3c4dd001ff3387ed00745a" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)" = "92ec94e2754699adddbbc4f555791bd3acc2a2f5574cba16c93a4a9cf4a04415" -"checksum serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)" = "0fb622d85245add5327d4f08b2d24fd51fa5d35fe1bba19ee79a1f211e9ac0ff" +"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" +"checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" "checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142" -"checksum serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "59790990c5115d16027f00913e2e66de23a51f70422e549d2ad68c8c5f268f1c" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" +"checksum sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "171698ce4ec7cbb93babeb3190021b4d72e96ccb98e33d277ae4ea959d6f2d9e" +"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" "checksum siphasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "833011ca526bd88f16778d32c699d325a9ad302fa06381cd66f7be63351d3f6d" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" @@ -4070,19 +4150,17 @@ dependencies = [ "checksum slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6dbdd334bd28d328dad1c41b0ea662517883d8880d8533895ef96c8003dec9c4" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" -"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9056ebe7f2d6a38bc63171816fd1d3430da5a43896de21676dc5c0a4b8274a11" -"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" +"checksum syn 0.15.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b036b7b35e846707c0e55c2c9441fa47867c0f87fca416921db3261b1d8c741a" "checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11ce2fe9db64b842314052e2421ac61a73ce41b898dc8e3750398b219c5fc1e0" "checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" -"checksum termcolor 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ff3bac0e465b59f194e7037ed404b0326e56ff234d767edc4c5cc9cd49e7a2c7" +"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" @@ -4092,27 +4170,25 @@ dependencies = [ "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fbb6a6e9db2702097bfdfddcb09841211ad423b86c75b5ddaca1d62842ac492c" -"checksum tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "881e9645b81c2ce95fcb799ded2c29ffb9f25ef5bef909089a420e5961dd8ccb" +"checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" +"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" -"checksum tokio-current-thread 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fdfb899688ac16f618076bd09215edbfda0fd5dfecb375b6942636cb31fa8a7" -"checksum tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "84823b932d566bc3c6aa644df4ca36cb38593c50b7db06011fd4e12e31e4047e" +"checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" +"checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" "checksum tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5cbe4ca6e71cb0b62a66e4e6f53a8c06a6eefe46cc5f665ad6f274c9906f135" -"checksum tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6cc2de7725863c86ac71b0b9068476fec50834f055a243558ef1655bbd34cb" -"checksum tokio-named-pipes 0.1.0 (git+https://github.com/nikvolf/tokio-named-pipes)" = "" -"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" -"checksum tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4bfbaf9f260635649ec26b6fb4aded03887295ffcd999f6e43fd2c4758f758ea" +"checksum tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "8b8a85fffbec3c5ab1ab62324570230dcd37ee5996a7859da5caf7b9d45e3e8c" +"checksum tokio-named-pipes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" +"checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" "checksum tokio-retry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f05746ae87dca83a2016b4f5dba5b237b897dd12fd324f60afe282112f16969a" -"checksum tokio-rustls 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9263e472d976e4345e50c6cce4cfe6b17c71593ea593cce1df26f1efd36debb" +"checksum tokio-rustls 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "208d62fa3e015426e3c64039d9d20adf054a3c9b4d9445560f1c41c75bef3eab" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" -"checksum tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4c329b47f071eb8a746040465fa751bd95e4716e98daef6a9b4e434c17d565" -"checksum tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a5758cecb6e0633cea5d563ac07c975e04961690b946b04fd84e7d6445a8f6af" +"checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" +"checksum tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bbd8a8b911301c60cbfaa2a6588fb210e5c1038375b8bdecc47aa09a94c3c05f" "checksum tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc" -"checksum tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d03fa701f9578a01b7014f106b47f0a363b4727a7f3f75d666e312ab7acbbf1c" +"checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" "checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" -"checksum tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9" -"checksum tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "424c1ed15a0132251813ccea50640b224c809d6ceafb88154c1a8775873a0e89" -"checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" +"checksum tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22e3aa6d1fcc19e635418dc0a30ab5bd65d347973d6f43f1a37bf8d9d1335fc9" +"checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65" "checksum trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe82f2f0bf1991e163e757baf044282823155dd326e70f44ce2186c3c320cc9" "checksum transaction-pool 1.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e5866e5126b14358f1d7af4bf51a0be677a363799b90e655edcec8254edef1d2" "checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e" @@ -4120,30 +4196,33 @@ dependencies = [ "checksum trie-standardmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e26f52976a57a0859616d6fcec87092ac35d08eabbd78dc3dabee93b480ea5f" "checksum triehash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9cb3a626dd9a19a1b5f84087143b19409db793d902c5ddee4b6212020713f1" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a" +"checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" +"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" "checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6" "checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c3365f36c57e5df714a34be40902b27a992eeddb9996eca52d0584611cf885d" -"checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "af464bc7be7b785c7ac72e266a6b67c4c9070155606f51655a650a6686204e35" "checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" +"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" "checksum wasmi 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b4a6d379e9332b1b1f52c5a87f2481c85c7c931d8ec411963dfb8f26b1ec1e3" -"checksum webpki 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e1622384bcb5458c6a3e3fa572f53ea8fef1cc85e535a2983dea87e9154fac2" -"checksum webpki-roots 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "155d4060e5befdf3a6076bd28c22513473d9900b763c9e4521acc6f78a75415c" +"checksum webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "17d7967316d8411ca3b01821ee6c332bde138ba4363becdb492f12e514daa17f" +"checksum webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85d1f408918fd590908a70d36b7ac388db2edc221470333e4d6e5b598e44cabf" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" +"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab" diff --git a/Cargo.toml b/Cargo.toml index 618e41d6f..d5283e8ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,10 +28,9 @@ serde = "1.0" serde_json = "1.0" serde_derive = "1.0" futures = "0.1" -futures-cpupool = "0.1" fdlimit = "0.1" ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" } -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } ethcore = { path = "ethcore", features = ["parity"] } parity-bytes = "0.1" ethcore-io = { path = "util/io" } @@ -51,7 +50,7 @@ rpc-cli = { path = "rpc_cli" } parity-hash-fetch = { path = "hash-fetch" } parity-ipfs-api = { path = "ipfs" } parity-local-store = { path = "local-store" } -parity-reactor = { path = "util/reactor" } +parity-runtime = { path = "util/runtime" } parity-rpc = { path = "rpc" } parity-rpc-client = { path = "rpc_client" } parity-updater = { path = "updater" } @@ -137,7 +136,4 @@ members = [ "util/keccak-hasher", "util/patricia-trie-ethereum", "util/fastmap", -] - -[patch.crates-io] -ring = { git = "https://github.com/paritytech/ring" } +] \ No newline at end of file diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 93762b4c4..31e8da942 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -20,7 +20,7 @@ hashdb = "0.3.0" memorydb = "0.3.0" patricia-trie = "0.3.0" patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } -parity-crypto = "0.1" +parity-crypto = "0.2" error-chain = { version = "0.12", default-features = false } ethcore-io = { path = "../util/io" } ethcore-logger = { path = "../logger" } diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 3fdf461e0..d8705b4b6 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -12,7 +12,7 @@ ethabi-derive = "6.0" ethabi-contract = "6.0" ethcore = { path = ".." } parity-bytes = "0.1" -parity-crypto = "0.1" +parity-crypto = "0.2" ethcore-io = { path = "../../util/io" } ethcore-logger = { path = "../../logger" } ethcore-miner = { path = "../../miner" } diff --git a/ethcore/private-tx/src/encryptor.rs b/ethcore/private-tx/src/encryptor.rs index c1d3d3fb8..e0beb0e65 100644 --- a/ethcore/private-tx/src/encryptor.rs +++ b/ethcore/private-tx/src/encryptor.rs @@ -125,9 +125,9 @@ impl SecretStoreEncryptor { // send HTTP request let method = if use_post { - Method::Post + Method::POST } else { - Method::Get + Method::GET }; let url = Url::from_str(&url).map_err(|e| ErrorKind::Encrypt(e.to_string()))?; diff --git a/ethcore/stratum/Cargo.toml b/ethcore/stratum/Cargo.toml index 638800b4d..36f4955ef 100644 --- a/ethcore/stratum/Cargo.toml +++ b/ethcore/stratum/Cargo.toml @@ -8,14 +8,14 @@ authors = ["Parity Technologies "] [dependencies] ethereum-types = "0.4" keccak-hash = "0.1" -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } log = "0.4" parking_lot = "0.6" [dev-dependencies] env_logger = "0.5" -tokio-core = "0.1" +tokio = "0.1" tokio-io = "0.1" ethcore-logger = { path = "../../logger" } diff --git a/ethcore/stratum/src/lib.rs b/ethcore/stratum/src/lib.rs index 0e9de9b43..7a8234ced 100644 --- a/ethcore/stratum/src/lib.rs +++ b/ethcore/stratum/src/lib.rs @@ -25,7 +25,7 @@ extern crate parking_lot; #[macro_use] extern crate log; -#[cfg(test)] extern crate tokio_core; +#[cfg(test)] extern crate tokio; #[cfg(test)] extern crate tokio_io; #[cfg(test)] extern crate ethcore_logger; @@ -323,12 +323,10 @@ impl MetaExtractor for PeerMetaExtractor { #[cfg(test)] mod tests { use super::*; - use std::net::SocketAddr; + use std::net::{SocketAddr, Shutdown}; use std::sync::Arc; - use tokio_core::reactor::{Core, Timeout}; - use tokio_core::net::TcpStream; - use tokio_io::io; + use tokio::{io, runtime::Runtime, timer::timeout::{self, Timeout}, net::TcpStream}; use jsonrpc_core::futures::{Future, future}; use ethcore_logger::init_log; @@ -342,23 +340,23 @@ mod tests { } fn dummy_request(addr: &SocketAddr, data: &str) -> Vec { - let mut core = Core::new().expect("Tokio Core should be created with no errors"); - let mut buffer = vec![0u8; 2048]; + let mut runtime = Runtime::new().expect("Tokio Runtime should be created with no errors"); let mut data_vec = data.as_bytes().to_vec(); data_vec.extend(b"\n"); - let stream = TcpStream::connect(addr, &core.handle()) - .and_then(|stream| { - io::write_all(stream, &data_vec) + let stream = TcpStream::connect(addr) + .and_then(move |stream| { + io::write_all(stream, data_vec) }) .and_then(|(stream, _)| { - io::read(stream, &mut buffer) + stream.shutdown(Shutdown::Write).unwrap(); + io::read_to_end(stream, Vec::with_capacity(2048)) }) - .and_then(|(_, read_buf, len)| { - future::ok(read_buf[0..len].to_vec()) + .and_then(|(_stream, read_buf)| { + future::ok(read_buf) }); - let result = core.run(stream).expect("Core should run with no errors"); + let result = runtime.block_on(stream).expect("Runtime should run with no errors"); result } @@ -417,7 +415,7 @@ mod tests { } #[test] - fn receives_initial_paylaod() { + fn receives_initial_payload() { let addr = "127.0.0.1:19975".parse().unwrap(); let _stratum = Stratum::start(&addr, DummyManager::new(), None).expect("There should be no error starting stratum"); let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 2}"#; @@ -460,40 +458,43 @@ mod tests { .to_vec(); auth_request.extend(b"\n"); - let mut core = Core::new().expect("Tokio Core should be created with no errors"); - let timeout1 = Timeout::new(::std::time::Duration::from_millis(100), &core.handle()) - .expect("There should be a timeout produced in message test"); - let timeout2 = Timeout::new(::std::time::Duration::from_millis(100), &core.handle()) - .expect("There should be a timeout produced in message test"); - let mut buffer = vec![0u8; 2048]; - let mut buffer2 = vec![0u8; 2048]; - let stream = TcpStream::connect(&addr, &core.handle()) - .and_then(|stream| { - io::write_all(stream, &auth_request) + let auth_response = "{\"jsonrpc\":\"2.0\",\"result\":true,\"id\":1}\n"; + + let mut runtime = Runtime::new().expect("Tokio Runtime should be created with no errors"); + let read_buf0 = vec![0u8; auth_response.len()]; + let read_buf1 = Vec::with_capacity(2048); + let stream = TcpStream::connect(&addr) + .and_then(move |stream| { + io::write_all(stream, auth_request) }) .and_then(|(stream, _)| { - io::read(stream, &mut buffer) + io::read_exact(stream, read_buf0) }) - .and_then(|(stream, _, _)| { + .map_err(|err| panic!("{:?}", err)) + .and_then(move |(stream, read_buf0)| { + assert_eq!(String::from_utf8(read_buf0).unwrap(), auth_response); trace!(target: "stratum", "Received authorization confirmation"); - timeout1.join(future::ok(stream)) + Timeout::new(future::ok(stream), ::std::time::Duration::from_millis(100)) }) - .and_then(|(_, stream)| { + .map_err(|err: timeout::Error<()>| panic!("Timeout: {:?}", err)) + .and_then(move |stream| { trace!(target: "stratum", "Pusing work to peers"); stratum.push_work_all(r#"{ "00040008", "100500" }"#.to_owned()) .expect("Pushing work should produce no errors"); - timeout2.join(future::ok(stream)) + Timeout::new(future::ok(stream), ::std::time::Duration::from_millis(100)) }) - .and_then(|(_, stream)| { + .map_err(|err: timeout::Error<()>| panic!("Timeout: {:?}", err)) + .and_then(|stream| { trace!(target: "stratum", "Ready to read work from server"); - io::read(stream, &mut buffer2) + stream.shutdown(Shutdown::Write).unwrap(); + io::read_to_end(stream, read_buf1) }) - .and_then(|(_, read_buf, len)| { + .and_then(|(_, read_buf1)| { trace!(target: "stratum", "Received work from server"); - future::ok(read_buf[0..len].to_vec()) + future::ok(read_buf1) }); let response = String::from_utf8( - core.run(stream).expect("Core should run with no errors") + runtime.block_on(stream).expect("Runtime should run with no errors") ).expect("Response should be utf-8"); assert_eq!( diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 140bcb174..536e5b47d 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] byteorder = "1.0" edit-distance = "2.0" -parity-crypto = "0.1" +parity-crypto = "0.2" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } ethereum-types = "0.4" lazy_static = "1.0" diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index 7393baf2c..a7760262f 100644 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -16,7 +16,7 @@ tiny-keccak = "1.4" time = "0.1.34" itertools = "0.5" parking_lot = "0.6" -parity-crypto = "0.1" +parity-crypto = "0.2" ethereum-types = "0.4" dir = { path = "../util/dir" } smallvec = "0.6" diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 683fc3b4b..848d53fb1 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -8,7 +8,6 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -futures-cpupool = "0.1" log = "0.4" mime = "0.3" mime_guess = "2.0.0-alpha.2" @@ -17,7 +16,7 @@ rustc-hex = "1.0" fetch = { path = "../util/fetch" } parity-bytes = "0.1" ethereum-types = "0.4" -parity-reactor = { path = "../util/reactor" } +parity-runtime = { path = "../util/runtime" } keccak-hash = "0.1" registrar = { path = "../registrar" } @@ -26,6 +25,5 @@ ethabi-derive = "6.0" ethabi-contract = "6.0" [dev-dependencies] -hyper = "0.11" parking_lot = "0.6" fake-fetch = { path = "../util/fake-fetch" } diff --git a/hash-fetch/src/client.rs b/hash-fetch/src/client.rs index ebdab681a..b9d42696e 100644 --- a/hash-fetch/src/client.rs +++ b/hash-fetch/src/client.rs @@ -23,9 +23,8 @@ use std::path::PathBuf; use hash::keccak_buffer; use fetch::{self, Fetch}; -use futures_cpupool::CpuPool; use futures::{Future, IntoFuture}; -use parity_reactor::Remote; +use parity_runtime::Executor; use urlhint::{URLHintContract, URLHint, URLHintResult}; use registrar::{RegistrarClient, Asynchronous}; use ethereum_types::H256; @@ -109,21 +108,19 @@ fn validate_hash(path: PathBuf, hash: H256, body: fetch::BodyReader) -> Result

{ - pool: CpuPool, contract: URLHintContract, fetch: F, - remote: Remote, + executor: Executor, random_path: Arc PathBuf + Sync + Send>, } impl Client { /// Creates new instance of the `Client` given on-chain contract client, fetch service and task runner. - pub fn with_fetch(contract: Arc>, pool: CpuPool, fetch: F, remote: Remote) -> Self { + pub fn with_fetch(contract: Arc>, fetch: F, executor: Executor) -> Self { Client { - pool, contract: URLHintContract::new(contract), fetch: fetch, - remote: remote, + executor: executor, random_path: Arc::new(random_temp_path), } } @@ -135,7 +132,6 @@ impl HashFetch for Client { let random_path = self.random_path.clone(); let remote_fetch = self.fetch.clone(); - let pool = self.pool.clone(); let future = self.contract.resolve(hash) .map_err(|e| { warn!("Error resolving URL: {}", e); Error::NoResolution }) .and_then(|maybe_url| maybe_url.ok_or(Error::NoResolution)) @@ -162,7 +158,7 @@ impl HashFetch for Client { Ok(response) } }) - .and_then(move |response| pool.spawn_fn(move || { + .and_then(move |response| { debug!(target: "fetch", "Content fetched, validating hash ({:?})", hash); let path = random_path(); let res = validate_hash(path.clone(), hash, fetch::BodyReader::new(response)); @@ -172,10 +168,10 @@ impl HashFetch for Client { let _ = fs::remove_file(&path); } res - })) + }) .then(move |res| { on_done(res); Ok(()) as Result<(), ()> }); - self.remote.spawn(future); + self.executor.spawn(future); } } @@ -197,8 +193,7 @@ mod tests { use rustc_hex::FromHex; use std::sync::{Arc, mpsc}; use parking_lot::Mutex; - use futures_cpupool::CpuPool; - use parity_reactor::Remote; + use parity_runtime::Executor; use urlhint::tests::{FakeRegistrar, URLHINT}; use super::{Error, Client, HashFetch, random_temp_path}; @@ -216,7 +211,7 @@ mod tests { // given let contract = Arc::new(FakeRegistrar::new()); let fetch = FakeFetch::new(None::); - let client = Client::with_fetch(contract.clone(), CpuPool::new(1), fetch, Remote::new_sync()); + let client = Client::with_fetch(contract.clone(), fetch, Executor::new_sync()); // when let (tx, rx) = mpsc::channel(); @@ -234,7 +229,7 @@ mod tests { // given let registrar = Arc::new(registrar()); let fetch = FakeFetch::new(None::); - let client = Client::with_fetch(registrar.clone(), CpuPool::new(1), fetch, Remote::new_sync()); + let client = Client::with_fetch(registrar.clone(), fetch, Executor::new_sync()); // when let (tx, rx) = mpsc::channel(); @@ -252,7 +247,7 @@ mod tests { // given let registrar = Arc::new(registrar()); let fetch = FakeFetch::new(Some(1)); - let mut client = Client::with_fetch(registrar.clone(), CpuPool::new(1), fetch, Remote::new_sync()); + let mut client = Client::with_fetch(registrar.clone(), fetch, Executor::new_sync()); let path = random_temp_path(); let path2 = path.clone(); client.random_path = Arc::new(move || path2.clone()); @@ -275,7 +270,7 @@ mod tests { // given let registrar = Arc::new(registrar()); let fetch = FakeFetch::new(Some(1)); - let client = Client::with_fetch(registrar.clone(), CpuPool::new(1), fetch, Remote::new_sync()); + let client = Client::with_fetch(registrar.clone(), fetch, Executor::new_sync()); // when let (tx, rx) = mpsc::channel(); diff --git a/hash-fetch/src/lib.rs b/hash-fetch/src/lib.rs index 9ed8c59fd..97ef6d91d 100644 --- a/hash-fetch/src/lib.rs +++ b/hash-fetch/src/lib.rs @@ -25,11 +25,10 @@ extern crate ethabi; extern crate parity_bytes as bytes; extern crate ethereum_types; extern crate futures; -extern crate futures_cpupool; extern crate keccak_hash as hash; extern crate mime; extern crate mime_guess; -extern crate parity_reactor; +extern crate parity_runtime; extern crate rand; extern crate rustc_hex; extern crate registrar; @@ -43,8 +42,6 @@ extern crate ethabi_contract; #[cfg(test)] extern crate parking_lot; #[cfg(test)] -extern crate hyper; -#[cfg(test)] extern crate fake_fetch; mod client; diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index f7d92c10c..23ada21ea 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -9,11 +9,11 @@ authors = ["Parity Technologies "] ethcore = { path = "../ethcore" } parity-bytes = "0.1" ethereum-types = "0.4" -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } rlp = { version = "0.3.0", features = ["ethereum"] } -cid = "0.2" -multihash = "0.7" +cid = "0.3" +multihash = "0.8" unicase = "2.0" [dev-dependencies] diff --git a/ipfs/src/error.rs b/ipfs/src/error.rs index 1ff282955..60b2d564f 100644 --- a/ipfs/src/error.rs +++ b/ipfs/src/error.rs @@ -30,6 +30,42 @@ pub enum ServerError { InvalidInterface } + +/// Handle IO errors (ports taken when starting the server). +impl From<::std::io::Error> for ServerError { + fn from(err: ::std::io::Error) -> ServerError { + ServerError::IoError(err) + } +} + +impl From for ServerError { + fn from(err: http::hyper::error::Error) -> ServerError { + ServerError::Other(err) + } +} + +impl From for String { + fn from(err: ServerError) -> String { + match err { + ServerError::IoError(err) => err.to_string(), + ServerError::Other(err) => err.to_string(), + ServerError::InvalidInterface => "Invalid --ipfs-api-interface parameter".into(), + } + } +} + +impl ::std::fmt::Display for ServerError { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + ServerError::IoError(err) => write!(f, "Io Error: {}", err), + ServerError::Other(err) => write!(f, "Other error: {}", err), + ServerError::InvalidInterface => write!(f, "Invalid interface"), + } + } +} + +impl ::std::error::Error for ServerError {} + #[derive(Debug, PartialEq)] pub enum Error { CidParsingFailed, @@ -71,27 +107,4 @@ impl From for Error { fn from(_: multihash::Error) -> Error { Error::CidParsingFailed } -} - -/// Handle IO errors (ports taken when starting the server). -impl From<::std::io::Error> for ServerError { - fn from(err: ::std::io::Error) -> ServerError { - ServerError::IoError(err) - } -} - -impl From for ServerError { - fn from(err: http::hyper::error::Error) -> ServerError { - ServerError::Other(err) - } -} - -impl From for String { - fn from(err: ServerError) -> String { - match err { - ServerError::IoError(err) => err.to_string(), - ServerError::Other(err) => err.to_string(), - ServerError::InvalidInterface => "Invalid --ipfs-api-interface parameter".into(), - } - } -} +} \ No newline at end of file diff --git a/ipfs/src/lib.rs b/ipfs/src/lib.rs index ac0871b64..e3974c2c5 100644 --- a/ipfs/src/lib.rs +++ b/ipfs/src/lib.rs @@ -35,10 +35,9 @@ use std::net::{SocketAddr, IpAddr}; use core::futures::future::{self, FutureResult}; use core::futures::{self, Future}; use ethcore::client::BlockChainClient; -use http::hyper::header::{self, Vary, ContentType}; -use http::hyper::{Method, StatusCode}; -use http::hyper::{self, server}; -use unicase::Ascii; +use http::hyper::{self, server, Method, StatusCode, Body, + header::{self, HeaderValue}, +}; use error::ServerError; use route::Out; @@ -67,9 +66,9 @@ impl IpfsHandler { client: client, } } - pub fn on_request(&self, req: hyper::Request) -> (Option, Out) { + pub fn on_request(&self, req: hyper::Request) -> (Option, Out) { match *req.method() { - Method::Get | Method::Post => {}, + Method::GET | Method::POST => {}, _ => return (None, Out::Bad("Invalid Request")), } @@ -77,8 +76,8 @@ impl IpfsHandler { return (None, Out::Bad("Disallowed Host header")); } - let cors_header = http::cors_header(&req, &self.cors_domains); - if cors_header == http::CorsHeader::Invalid { + let cors_header = http::cors_allow_origin(&req, &self.cors_domains); + if cors_header == http::AllowCors::Invalid { return (None, Out::Bad("Disallowed Origin header")); } @@ -88,39 +87,39 @@ impl IpfsHandler { } } -impl server::Service for IpfsHandler { - type Request = hyper::Request; - type Response = hyper::Response; +impl hyper::service::Service for IpfsHandler { + type ReqBody = Body; + type ResBody = Body; type Error = hyper::Error; - type Future = FutureResult; + type Future = FutureResult, Self::Error>; - fn call(&self, request: Self::Request) -> Self::Future { + fn call(&mut self, request: hyper::Request) -> Self::Future { let (cors_header, out) = self.on_request(request); let mut res = match out { Out::OctetStream(bytes) => { - hyper::Response::new() - .with_status(StatusCode::Ok) - .with_header(ContentType::octet_stream()) - .with_body(bytes) + hyper::Response::builder() + .status(StatusCode::OK) + .header("content-type", HeaderValue::from_static("application/octet-stream")) + .body(bytes.into()) }, Out::NotFound(reason) => { - hyper::Response::new() - .with_status(StatusCode::NotFound) - .with_header(ContentType::plaintext()) - .with_body(reason) + hyper::Response::builder() + .status(StatusCode::NOT_FOUND) + .header("content-type", HeaderValue::from_static("text/plain; charset=utf-8")) + .body(reason.into()) }, Out::Bad(reason) => { - hyper::Response::new() - .with_status(StatusCode::BadRequest) - .with_header(ContentType::plaintext()) - .with_body(reason) + hyper::Response::builder() + .status(StatusCode::BAD_REQUEST) + .header("content-type", HeaderValue::from_static("text/plain; charset=utf-8")) + .body(reason.into()) } - }; + }.expect("Response builder: Parsing 'content-type' header name will not fail; qed"); if let Some(cors_header) = cors_header { - res.headers_mut().set(cors_header); - res.headers_mut().set(Vary::Items(vec![Ascii::new("Origin".into())])); + res.headers_mut().append(header::ACCESS_CONTROL_ALLOW_ORIGIN, cors_header); + res.headers_mut().append(header::VARY, HeaderValue::from_static("origin")); } future::ok(res) @@ -164,23 +163,32 @@ pub fn start_server( let hosts: DomainsValidation<_> = hosts.map(move |hosts| include_current_interface(hosts, interface, port)).into(); let (close, shutdown_signal) = futures::sync::oneshot::channel::<()>(); - let (tx, rx) = mpsc::sync_channel(1); + let (tx, rx) = mpsc::sync_channel::>(1); let thread = thread::spawn(move || { let send = |res| tx.send(res).expect("rx end is never dropped; qed"); - let server = match server::Http::new().bind(&addr, move || { - Ok(IpfsHandler::new(cors.clone(), hosts.clone(), client.clone())) - }) { - Ok(server) => { - send(Ok(())); - server - }, + + let server_bldr = match server::Server::try_bind(&addr) { + Ok(s) => s, Err(err) => { - send(Err(err)); + send(Err(ServerError::from(err))); return; } }; - let _ = server.run_until(shutdown_signal.map_err(|_| {})); + let new_service = move || { + Ok::<_, ServerError>( + IpfsHandler::new(cors.clone(), hosts.clone(), client.clone()) + ) + }; + + let server = server_bldr + .serve(new_service) + .map_err(|_| ()) + .select(shutdown_signal.map_err(|_| ())) + .then(|_| Ok(())); + + hyper::rt::run(server); + send(Ok(())); }); // Wait for server to start successfuly. diff --git a/miner/Cargo.toml b/miner/Cargo.toml index f94d086e5..b3e0daaa1 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -10,8 +10,7 @@ authors = ["Parity Technologies "] # Only work_notify, consider a separate crate ethash = { path = "../ethash", optional = true } fetch = { path = "../util/fetch", optional = true } -hyper = { version = "0.11", optional = true } -parity-reactor = { path = "../util/reactor", optional = true } +hyper = { version = "0.12", optional = true } url = { version = "1", optional = true } # Miner @@ -20,7 +19,7 @@ error-chain = "0.12" ethcore-transaction = { path = "../ethcore/transaction" } ethereum-types = "0.4" futures = "0.1" -futures-cpupool = "0.1" +parity-runtime = { path = "../util/runtime" } heapsize = "0.4" keccak-hash = "0.1" linked-hash-map = "0.5" @@ -37,4 +36,4 @@ ethkey = { path = "../ethkey" } rustc-hex = "1.0" [features] -work-notify = ["ethash", "fetch", "hyper", "parity-reactor", "url"] +work-notify = ["ethash", "fetch", "hyper", "url"] diff --git a/miner/src/gas_price_calibrator.rs b/miner/src/gas_price_calibrator.rs index d2978220a..db22e07b1 100644 --- a/miner/src/gas_price_calibrator.rs +++ b/miner/src/gas_price_calibrator.rs @@ -20,7 +20,7 @@ use std::time::{Instant, Duration}; use ansi_term::Colour; use ethereum_types::U256; -use futures_cpupool::CpuPool; +use parity_runtime::Executor; use price_info::{Client as PriceInfoClient, PriceInfo}; use price_info::fetch::Client as FetchClient; @@ -43,7 +43,7 @@ pub struct GasPriceCalibrator { impl GasPriceCalibrator { /// Create a new gas price calibrator. - pub fn new(options: GasPriceCalibratorOptions, fetch: FetchClient, p: CpuPool) -> GasPriceCalibrator { + pub fn new(options: GasPriceCalibratorOptions, fetch: FetchClient, p: Executor) -> GasPriceCalibrator { GasPriceCalibrator { options: options, next_calibration: Instant::now(), diff --git a/miner/src/lib.rs b/miner/src/lib.rs index e1ae0a9e0..2288d1db1 100644 --- a/miner/src/lib.rs +++ b/miner/src/lib.rs @@ -23,7 +23,7 @@ extern crate ansi_term; extern crate ethcore_transaction as transaction; extern crate ethereum_types; extern crate futures; -extern crate futures_cpupool; +extern crate parity_runtime; extern crate heapsize; extern crate keccak_hash as hash; extern crate linked_hash_map; diff --git a/miner/src/work_notify.rs b/miner/src/work_notify.rs index 522901982..e23db64bf 100644 --- a/miner/src/work_notify.rs +++ b/miner/src/work_notify.rs @@ -18,18 +18,19 @@ extern crate ethash; extern crate fetch; -extern crate parity_reactor; +extern crate parity_runtime; extern crate url; extern crate hyper; use self::fetch::{Fetch, Request, Client as FetchClient, Method}; -use self::parity_reactor::Remote; +use self::parity_runtime::Executor; use self::ethash::SeedHashCompute; use self::url::Url; -use self::hyper::header::ContentType; +use self::hyper::header::{self, HeaderValue}; use ethereum_types::{H256, U256}; use parking_lot::Mutex; + use futures::Future; /// Trait for notifying about new mining work @@ -42,13 +43,13 @@ pub trait NotifyWork : Send + Sync { pub struct WorkPoster { urls: Vec, client: FetchClient, - remote: Remote, + executor: Executor, seed_compute: Mutex, } impl WorkPoster { /// Create new `WorkPoster`. - pub fn new(urls: &[String], fetch: FetchClient, remote: Remote) -> Self { + pub fn new(urls: &[String], fetch: FetchClient, executor: Executor) -> Self { let urls = urls.into_iter().filter_map(|u| { match Url::parse(u) { Ok(url) => Some(url), @@ -60,7 +61,7 @@ impl WorkPoster { }).collect(); WorkPoster { client: fetch, - remote: remote, + executor: executor, urls: urls, seed_compute: Mutex::new(SeedHashCompute::default()), } @@ -80,9 +81,9 @@ impl NotifyWork for WorkPoster { for u in &self.urls { let u = u.clone(); - self.remote.spawn(self.client.fetch( - Request::new(u.clone(), Method::Post) - .with_header(ContentType::json()) + self.executor.spawn(self.client.fetch( + Request::new(u.clone(), Method::POST) + .with_header(header::CONTENT_TYPE, HeaderValue::from_static("application/json")) .with_body(body.clone()), Default::default() ).map_err(move |e| { warn!("Error sending HTTP notification to {} : {}, retrying", u, e); diff --git a/parity/lib.rs b/parity/lib.rs index aaa82242c..c885b43bb 100644 --- a/parity/lib.rs +++ b/parity/lib.rs @@ -25,7 +25,6 @@ extern crate clap; extern crate dir; extern crate env_logger; extern crate futures; -extern crate futures_cpupool; extern crate atty; extern crate jsonrpc_core; extern crate num_cpus; @@ -60,7 +59,7 @@ extern crate kvdb; extern crate parity_hash_fetch as hash_fetch; extern crate parity_ipfs_api; extern crate parity_local_store as local_store; -extern crate parity_reactor; +extern crate parity_runtime; extern crate parity_rpc; extern crate parity_updater as updater; extern crate parity_version; diff --git a/parity/light_helpers/queue_cull.rs b/parity/light_helpers/queue_cull.rs index 03ec2efe7..ee0566075 100644 --- a/parity/light_helpers/queue_cull.rs +++ b/parity/light_helpers/queue_cull.rs @@ -29,7 +29,7 @@ use light::TransactionQueue; use futures::{future, Future}; -use parity_reactor::Remote; +use parity_runtime::Executor; use parking_lot::RwLock; @@ -50,8 +50,8 @@ pub struct QueueCull { pub on_demand: Arc, /// The transaction queue. pub txq: Arc>, - /// Event loop remote. - pub remote: Remote, + /// Event loop executor. + pub executor: Executor, } impl IoHandler for QueueCull { @@ -70,7 +70,7 @@ impl IoHandler for QueueCull let start_nonce = self.client.engine().account_start_nonce(best_header.number()); info!(target: "cull", "Attempting to cull queued transactions from {} senders.", senders.len()); - self.remote.spawn_with_timeout(move |_| { + self.executor.spawn_with_timeout(move || { let maybe_fetching = sync.with_context(move |ctx| { // fetch the nonce of each sender in the queue. let nonce_reqs = senders.iter() diff --git a/parity/params.rs b/parity/params.rs index 407870d7a..141eef94d 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -21,7 +21,7 @@ use ethcore::client::Mode; use ethcore::ethereum; use ethcore::spec::{Spec, SpecParams}; use ethereum_types::{U256, Address}; -use futures_cpupool::CpuPool; +use parity_runtime::Executor; use hash_fetch::fetch::Client as FetchClient; use journaldb::Algorithm; use miner::gas_pricer::GasPricer; @@ -256,7 +256,7 @@ impl Default for GasPricerConfig { } impl GasPricerConfig { - pub fn to_gas_pricer(&self, fetch: FetchClient, p: CpuPool) -> GasPricer { + pub fn to_gas_pricer(&self, fetch: FetchClient, p: Executor) -> GasPricer { match *self { GasPricerConfig::Fixed(u) => GasPricer::Fixed(u), GasPricerConfig::Calibrated { usd_per_tx, recalibration_period, .. } => { diff --git a/parity/rpc.rs b/parity/rpc.rs index eb769eda0..4b08aa789 100644 --- a/parity/rpc.rs +++ b/parity/rpc.rs @@ -23,14 +23,13 @@ use dir::default_data_path; use dir::helpers::replace_home; use helpers::parity_ipc_path; use jsonrpc_core::MetaIoHandler; -use parity_reactor::TokioRemote; +use parity_runtime::Executor; use parity_rpc::informant::{RpcStats, Middleware}; use parity_rpc::{self as rpc, Metadata, DomainsValidation}; use rpc_apis::{self, ApiSet}; pub use parity_rpc::{IpcServer, HttpServer, RequestMiddleware}; pub use parity_rpc::ws::Server as WsServer; -pub use parity_rpc::informant::CpuPool; pub const DAPPS_DOMAIN: &'static str = "web3.site"; @@ -134,9 +133,8 @@ fn address(enabled: bool, bind_iface: &str, bind_port: u16, hosts: &Option { pub apis: Arc, - pub remote: TokioRemote, + pub executor: Executor, pub stats: Arc, - pub pool: Option, } pub fn new_ws( @@ -155,7 +153,7 @@ pub fn new_ws( let handler = { let mut handler = MetaIoHandler::with_middleware(( rpc::WsDispatcher::new(full_handler), - Middleware::new(deps.stats.clone(), deps.apis.activity_notifier(), deps.pool.clone()) + Middleware::new(deps.stats.clone(), deps.apis.activity_notifier()) )); let apis = conf.apis.list_apis(); deps.apis.extend_with_set(&mut handler, &apis); @@ -163,7 +161,6 @@ pub fn new_ws( handler }; - let remote = deps.remote.clone(); let allowed_origins = into_domains(with_domain(conf.origins, domain, &None)); let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into()))); @@ -178,7 +175,6 @@ pub fn new_ws( let start_result = rpc::start_ws( &addr, handler, - remote.clone(), allowed_origins, allowed_hosts, conf.max_connections, @@ -210,7 +206,6 @@ pub fn new_http( let url = format!("{}:{}", conf.interface, conf.port); let addr = url.parse().map_err(|_| format!("Invalid {} listen host/port given: {}", id, url))?; let handler = setup_apis(conf.apis, deps); - let remote = deps.remote.clone(); let cors_domains = into_domains(conf.cors); let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into()))); @@ -220,7 +215,6 @@ pub fn new_http( cors_domains, allowed_hosts, handler, - remote, rpc::RpcExtractor, conf.server_threads, conf.max_payload, @@ -244,7 +238,6 @@ pub fn new_ipc( } let handler = setup_apis(conf.apis, dependencies); - let remote = dependencies.remote.clone(); let path = PathBuf::from(&conf.socket_addr); // Make sure socket file can be created on unix-like OS. // Windows pipe paths are not on the FS. @@ -255,7 +248,7 @@ pub fn new_ipc( } } - match rpc::start_ipc(&conf.socket_addr, handler, remote, rpc::RpcExtractor) { + match rpc::start_ipc(&conf.socket_addr, handler, rpc::RpcExtractor) { Ok(server) => Ok(Some(server)), Err(io_error) => Err(format!("IPC error: {}", io_error)), } @@ -294,7 +287,7 @@ pub fn setup_apis(apis: ApiSet, deps: &Dependencies) -> MetaIoHandler, pub fetch: FetchClient, - pub pool: CpuPool, - pub remote: parity_reactor::Remote, + pub executor: Executor, pub whisper_rpc: Option<::whisper::RpcFactory>, pub gas_price_percentile: usize, pub poll_lifetime: u32, @@ -253,7 +251,7 @@ impl FullDependencies { let deps = &$deps; let dispatcher = FullDispatcher::new(deps.client.clone(), deps.miner.clone(), $nonces, deps.gas_price_percentile); if deps.signer_service.is_enabled() { - $handler.extend_with($namespace::to_delegate(SigningQueueClient::new(&deps.signer_service, dispatcher, deps.remote.clone(), &deps.secret_store))) + $handler.extend_with($namespace::to_delegate(SigningQueueClient::new(&deps.signer_service, dispatcher, deps.executor.clone(), &deps.secret_store))) } else { $handler.extend_with($namespace::to_delegate(SigningUnsafeClient::new(&deps.secret_store, dispatcher))) } @@ -261,7 +259,7 @@ impl FullDependencies { } } - let nonces = Arc::new(Mutex::new(dispatch::Reservations::with_pool(self.pool.clone()))); + let nonces = Arc::new(Mutex::new(dispatch::Reservations::new(self.executor.clone()))); let dispatcher = FullDispatcher::new( self.client.clone(), self.miner.clone(), @@ -306,7 +304,7 @@ impl FullDependencies { }, Api::EthPubSub => { if !for_generic_pubsub { - let client = EthPubSubClient::new(self.client.clone(), self.remote.clone()); + let client = EthPubSubClient::new(self.client.clone(), self.executor.clone()); let h = client.handler(); self.miner.add_transactions_listener(Box::new(move |hashes| if let Some(h) = h.upgrade() { h.notify_new_transactions(hashes); @@ -322,7 +320,7 @@ impl FullDependencies { handler.extend_with(PersonalClient::new(&self.secret_store, dispatcher.clone(), self.geth_compatibility).to_delegate()); }, Api::Signer => { - handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.remote.clone()).to_delegate()); + handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.executor.clone()).to_delegate()); }, Api::Parity => { let signer = match self.signer_service.is_enabled() { @@ -351,7 +349,7 @@ impl FullDependencies { let mut rpc = MetaIoHandler::default(); let apis = ApiSet::List(apis.clone()).retain(ApiSet::PubSub).list_apis(); self.extend_api(&mut rpc, &apis, true); - handler.extend_with(PubSubClient::new(rpc, self.remote.clone()).to_delegate()); + handler.extend_with(PubSubClient::new(rpc, self.executor.clone()).to_delegate()); } }, Api::ParityAccounts => { @@ -364,7 +362,6 @@ impl FullDependencies { &self.updater, &self.net_service, self.fetch.clone(), - self.pool.clone(), ).to_delegate()) }, Api::Traces => { @@ -440,9 +437,8 @@ pub struct LightDependencies { pub transaction_queue: Arc>, pub ws_address: Option, pub fetch: FetchClient, - pub pool: CpuPool, pub geth_compatibility: bool, - pub remote: parity_reactor::Remote, + pub executor: Executor, pub whisper_rpc: Option<::whisper::RpcFactory>, pub private_tx_service: Option>, pub gas_price_percentile: usize, @@ -464,7 +460,7 @@ impl LightDependencies { self.on_demand.clone(), self.cache.clone(), self.transaction_queue.clone(), - Arc::new(Mutex::new(dispatch::Reservations::with_pool(self.pool.clone()))), + Arc::new(Mutex::new(dispatch::Reservations::new(self.executor.clone()))), self.gas_price_percentile, ); @@ -476,7 +472,7 @@ impl LightDependencies { let secret_store = deps.secret_store.clone(); if deps.signer_service.is_enabled() { $handler.extend_with($namespace::to_delegate( - SigningQueueClient::new(&deps.signer_service, dispatcher, deps.remote.clone(), &secret_store) + SigningQueueClient::new(&deps.signer_service, dispatcher, deps.executor.clone(), &secret_store) )) } else { $handler.extend_with( @@ -522,7 +518,7 @@ impl LightDependencies { self.on_demand.clone(), self.sync.clone(), self.cache.clone(), - self.remote.clone(), + self.executor.clone(), self.gas_price_percentile, ); self.client.add_listener(client.handler() as Weak<_>); @@ -538,7 +534,7 @@ impl LightDependencies { handler.extend_with(PersonalClient::new(&self.secret_store, dispatcher.clone(), self.geth_compatibility).to_delegate()); }, Api::Signer => { - handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.remote.clone()).to_delegate()); + handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.executor.clone()).to_delegate()); }, Api::Parity => { let signer = match self.signer_service.is_enabled() { @@ -565,7 +561,7 @@ impl LightDependencies { let mut rpc = MetaIoHandler::default(); let apis = ApiSet::List(apis.clone()).retain(ApiSet::PubSub).list_apis(); self.extend_api(&mut rpc, &apis, true); - handler.extend_with(PubSubClient::new(rpc, self.remote.clone()).to_delegate()); + handler.extend_with(PubSubClient::new(rpc, self.executor.clone()).to_delegate()); } }, Api::ParityAccounts => { @@ -575,7 +571,6 @@ impl LightDependencies { handler.extend_with(light::ParitySetClient::new( self.sync.clone(), self.fetch.clone(), - self.pool.clone(), ).to_delegate()) }, Api::Traces => { diff --git a/parity/run.rs b/parity/run.rs index 1ebbfb6a8..126ef9d75 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -34,14 +34,13 @@ use ethereum_types::Address; use sync::{self, SyncConfig}; use miner::work_notify::WorkPoster; use futures::IntoFuture; -use futures_cpupool::CpuPool; use hash_fetch::{self, fetch}; use informant::{Informant, LightNodeInformantData, FullNodeInformantData}; use journaldb::Algorithm; use light::Cache as LightDataCache; use miner::external::ExternalMiner; use node_filter::NodeFilter; -use parity_reactor::EventLoop; +use parity_runtime::Runtime; use parity_rpc::{Origin, Metadata, NetworkSettings, informant, is_major_importing}; use updater::{UpdatePolicy, Updater}; use parity_version::version; @@ -270,7 +269,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc) -> Result) -> Result) -> Result) -> Result) -> Result 0 { - Some(rpc::CpuPool::new(cmd.http_conf.processing_threads)) - } else { - None - }, }; // start rpc servers @@ -358,7 +349,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc) -> Result(cmd: RunCmd, logger: Arc, on_client_rq: // prepare account provider let account_provider = Arc::new(prepare_account_provider(&cmd.spec, &cmd.dirs, &spec.data_dir, cmd.acc_conf, &passwords)?); - let cpu_pool = CpuPool::new(4); - // spin up event loop - let event_loop = EventLoop::spawn(); + let runtime = Runtime::with_default_thread_count(); // fetch service let fetch = fetch::Client::new(FETCH_FULL_NUM_DNS_THREADS).map_err(|e| format!("Error starting fetch client: {:?}", e))?; @@ -489,7 +478,7 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: // create miner let miner = Arc::new(Miner::new( cmd.miner_options, - cmd.gas_pricer_conf.to_gas_pricer(fetch.clone(), cpu_pool.clone()), + cmd.gas_pricer_conf.to_gas_pricer(fetch.clone(), runtime.executor()), &spec, Some(account_provider.clone()), @@ -500,7 +489,7 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: if !cmd.miner_extras.work_notify.is_empty() { miner.add_work_listener(Box::new( - WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), event_loop.remote()) + WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), runtime.executor()) )); } @@ -698,7 +687,7 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: &Arc::downgrade(&(service.client() as Arc)), &Arc::downgrade(&sync_provider), update_policy, - hash_fetch::Client::with_fetch(contract_client.clone(), cpu_pool.clone(), updater_fetch, event_loop.remote()) + hash_fetch::Client::with_fetch(contract_client.clone(), updater_fetch, runtime.executor()) ); service.add_notify(updater.clone()); @@ -723,8 +712,7 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: geth_compatibility: cmd.geth_compatibility, ws_address: cmd.ws_conf.address(), fetch: fetch.clone(), - pool: cpu_pool.clone(), - remote: event_loop.remote(), + executor: runtime.executor(), whisper_rpc: whisper_factory, private_tx_service: Some(private_tx_service.clone()), gas_price_percentile: cmd.gas_price_percentile, @@ -733,14 +721,8 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: let dependencies = rpc::Dependencies { apis: deps_for_rpc_apis.clone(), - remote: event_loop.raw_remote(), + executor: runtime.executor(), stats: rpc_stats.clone(), - pool: if cmd.http_conf.processing_threads > 0 { - Some(rpc::CpuPool::new(cmd.http_conf.processing_threads)) - } else { - None - }, - }; // start rpc servers @@ -820,7 +802,7 @@ fn execute_impl(cmd: RunCmd, logger: Arc, on_client_rq: informant, client, client_service: Arc::new(service), - keep_alive: Box::new((watcher, updater, ws_server, http_server, ipc_server, secretstore_key_server, ipfs_server, event_loop)), + keep_alive: Box::new((watcher, updater, ws_server, http_server, ipc_server, secretstore_key_server, ipfs_server, runtime)), } }) } diff --git a/price-info/Cargo.toml b/price-info/Cargo.toml index b7ab6508f..d8bbfaab3 100644 --- a/price-info/Cargo.toml +++ b/price-info/Cargo.toml @@ -9,11 +9,10 @@ authors = ["Parity Technologies "] [dependencies] fetch = { path = "../util/fetch" } futures = "0.1" -futures-cpupool = "0.1" +parity-runtime = { path = "../util/runtime" } log = "0.4" serde_json = "1.0" [dev-dependencies] -hyper = "0.11" parking_lot = "0.6" fake-fetch = { path = "../util/fake-fetch" } diff --git a/price-info/src/lib.rs b/price-info/src/lib.rs index 93dacca33..ef6fafff6 100644 --- a/price-info/src/lib.rs +++ b/price-info/src/lib.rs @@ -19,8 +19,8 @@ //! A simple client to get the current ETH price using an external API. extern crate futures; -extern crate futures_cpupool; extern crate serde_json; +extern crate parity_runtime; #[macro_use] extern crate log; @@ -38,8 +38,8 @@ use std::str; use fetch::{Client as FetchClient, Fetch}; use futures::{Future, Stream}; use futures::future::{self, Either}; -use futures_cpupool::CpuPool; use serde_json::Value; +use parity_runtime::Executor; /// Current ETH price information. #[derive(Debug)] @@ -71,7 +71,7 @@ impl From for Error { /// A client to get the current ETH price using an external API. pub struct Client { - pool: CpuPool, + pool: Executor, api_endpoint: String, fetch: F, } @@ -92,7 +92,7 @@ impl cmp::PartialEq for Client { impl Client { /// Creates a new instance of the `Client` given a `fetch::Client`. - pub fn new(fetch: F, pool: CpuPool) -> Client { + pub fn new(fetch: F, pool: Executor) -> Client { let api_endpoint = "https://api.etherscan.io/api?module=stats&action=ethprice".to_owned(); Client { pool, api_endpoint, fetch } } @@ -108,7 +108,7 @@ impl Client { } Either::B(response.concat2().from_err()) }) - .map(move |body| { + .and_then(move |body| { let body_str = str::from_utf8(&body).ok(); let value: Option = body_str.and_then(|s| serde_json::from_str(s).ok()); @@ -128,30 +128,31 @@ impl Client { }) .map_err(|err| { warn!("Failed to auto-update latest ETH price: {:?}", err); - err }); - self.pool.spawn(future).forget() + self.pool.spawn(future) } } #[cfg(test)] mod test { use std::sync::Arc; - use futures_cpupool::CpuPool; + use parity_runtime::{Runtime, Executor}; use Client; use std::sync::atomic::{AtomicBool, Ordering}; use fake_fetch::FakeFetch; - fn price_info_ok(response: &str) -> Client> { - Client::new(FakeFetch::new(Some(response.to_owned())), CpuPool::new(1)) + fn price_info_ok(response: &str, executor: Executor) -> Client> { + Client::new(FakeFetch::new(Some(response.to_owned())), executor) } - fn price_info_not_found() -> Client> { - Client::new(FakeFetch::new(None::), CpuPool::new(1)) + fn price_info_not_found(executor: Executor) -> Client> { + Client::new(FakeFetch::new(None::), executor) } #[test] fn should_get_price_info() { + let runtime = Runtime::with_thread_count(1); + // given let response = r#"{ "status": "1", @@ -164,7 +165,7 @@ mod test { } }"#; - let price_info = price_info_ok(response); + let price_info = price_info_ok(response, runtime.executor()); // when price_info.get(|price| { @@ -176,10 +177,12 @@ mod test { #[test] fn should_not_call_set_price_if_response_is_malformed() { + let runtime = Runtime::with_thread_count(1); + // given let response = "{}"; - let price_info = price_info_ok(response); + let price_info = price_info_ok(response, runtime.executor()); let b = Arc::new(AtomicBool::new(false)); // when @@ -194,8 +197,10 @@ mod test { #[test] fn should_not_call_set_price_if_response_is_invalid() { + let runtime = Runtime::with_thread_count(1); + // given - let price_info = price_info_not_found(); + let price_info = price_info_not_found(runtime.executor()); let b = Arc::new(AtomicBool::new(false)); // when diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index f2d319704..fa48e7495 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -9,11 +9,10 @@ authors = ["Parity Technologies "] [dependencies] ansi_term = "0.10" -cid = "0.2" +cid = "0.3" futures = "0.1.6" -futures-cpupool = "0.1" log = "0.4" -multihash ="0.7" +multihash = "0.8" order-stat = "0.1" parking_lot = "0.6" rand = "0.4" @@ -28,17 +27,17 @@ tokio-timer = "0.1" transient-hashmap = "0.4" itertools = "0.5" -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } ethash = { path = "../ethash" } ethcore = { path = "../ethcore", features = ["test-helpers"] } parity-bytes = "0.1" -parity-crypto = "0.1" +parity-crypto = "0.2" fastmap = { path = "../util/fastmap" } ethcore-devtools = { path = "../devtools" } ethcore-io = { path = "../util/io" } @@ -55,7 +54,7 @@ ethkey = { path = "../ethkey" } ethstore = { path = "../ethstore" } fetch = { path = "../util/fetch" } keccak-hash = "0.1.2" -parity-reactor = { path = "../util/reactor" } +parity-runtime = { path = "../util/runtime" } parity-updater = { path = "../updater" } parity-version = { path = "../util/version" } patricia-trie = "0.3.0" diff --git a/rpc/src/http_common.rs b/rpc/src/http_common.rs index 47717f313..0e720a791 100644 --- a/rpc/src/http_common.rs +++ b/rpc/src/http_common.rs @@ -42,13 +42,13 @@ impl http::MetaExtractor for MetaExtractor where T: HttpMetaExtractor, M: jsonrpc_core::Metadata, { - fn read_metadata(&self, req: &hyper::server::Request) -> M { - let as_string = |header: Option<&hyper::header::Raw>| header - .and_then(|raw| raw.one()) - .map(|raw| String::from_utf8_lossy(raw).into_owned()); + fn read_metadata(&self, req: &hyper::Request) -> M { + let as_string = |header: Option<&hyper::header::HeaderValue>| { + header.and_then(|val| val.to_str().ok().map(|s| s.to_owned())) + }; - let origin = as_string(req.headers().get_raw("origin")); - let user_agent = as_string(req.headers().get_raw("user-agent")); + let origin = as_string(req.headers().get("origin")); + let user_agent = as_string(req.headers().get("user-agent")); self.extractor.read_metadata(origin, user_agent) } } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 2f3f4968e..cb14c42c4 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -23,7 +23,6 @@ extern crate futures; extern crate ansi_term; extern crate cid; -extern crate futures_cpupool; extern crate itertools; extern crate multihash; extern crate order_stat; @@ -60,7 +59,7 @@ extern crate ethkey; extern crate ethstore; extern crate fetch; extern crate keccak_hash as hash; -extern crate parity_reactor; +extern crate parity_runtime; extern crate parity_updater as updater; extern crate parity_version as version; extern crate patricia_trie as trie; @@ -124,7 +123,6 @@ pub use authcodes::{AuthCodes, TimeProvider}; pub use http_common::HttpMetaExtractor; use std::net::SocketAddr; -use http::tokio_core; /// RPC HTTP Server instance pub type HttpServer = http::Server; @@ -135,7 +133,6 @@ pub fn start_http( cors_domains: http::DomainsValidation, allowed_hosts: http::DomainsValidation, handler: H, - remote: tokio_core::reactor::Remote, extractor: T, threads: usize, max_payload: usize, @@ -148,7 +145,6 @@ pub fn start_http( let extractor = http_common::MetaExtractor::new(extractor); Ok(http::ServerBuilder::with_meta_extractor(handler, extractor) .threads(threads) - .event_loop_remote(remote) .cors(cors_domains.into()) .allowed_hosts(allowed_hosts.into()) .max_request_body_size(max_payload * 1024 * 1024) @@ -162,7 +158,6 @@ pub fn start_http_with_middleware( cors_domains: http::DomainsValidation, allowed_hosts: http::DomainsValidation, handler: H, - remote: tokio_core::reactor::Remote, extractor: T, middleware: R, threads: usize, @@ -177,7 +172,6 @@ pub fn start_http_with_middleware( let extractor = http_common::MetaExtractor::new(extractor); Ok(http::ServerBuilder::with_meta_extractor(handler, extractor) .threads(threads) - .event_loop_remote(remote) .cors(cors_domains.into()) .allowed_hosts(allowed_hosts.into()) .max_request_body_size(max_payload * 1024 * 1024) @@ -189,7 +183,6 @@ pub fn start_http_with_middleware( pub fn start_ipc( addr: &str, handler: H, - remote: tokio_core::reactor::Remote, extractor: T, ) -> ::std::io::Result where M: jsonrpc_core::Metadata, @@ -198,7 +191,6 @@ pub fn start_ipc( T: IpcMetaExtractor, { ipc::ServerBuilder::with_meta_extractor(handler, extractor) - .event_loop_remote(remote) .start(addr) } @@ -206,7 +198,6 @@ pub fn start_ipc( pub fn start_ws( addr: &SocketAddr, handler: H, - remote: tokio_core::reactor::Remote, allowed_origins: ws::DomainsValidation, allowed_hosts: ws::DomainsValidation, max_connections: usize, @@ -222,7 +213,6 @@ pub fn start_ws( V: ws::RequestMiddleware, { ws::ServerBuilder::with_meta_extractor(handler, extractor) - .event_loop_remote(remote) .request_middleware(middleware) .allowed_origins(allowed_origins) .allowed_hosts(allowed_hosts) diff --git a/rpc/src/tests/helpers.rs b/rpc/src/tests/helpers.rs index 602648d06..73c75924a 100644 --- a/rpc/src/tests/helpers.rs +++ b/rpc/src/tests/helpers.rs @@ -18,7 +18,7 @@ use std::ops::{Deref, DerefMut}; use std::path::PathBuf; use tempdir::TempDir; -use parity_reactor::{EventLoop, TokioRemote}; +use parity_runtime::{Runtime, TaskExecutor}; use authcodes::AuthCodes; @@ -27,15 +27,15 @@ pub struct Server { /// Server pub server: T, /// RPC Event Loop - pub event_loop: EventLoop, + pub event_loop: Runtime, } impl Server { pub fn new(f: F) -> Server where - F: FnOnce(TokioRemote) -> T, + F: FnOnce(TaskExecutor) -> T, { - let event_loop = EventLoop::spawn(); - let remote = event_loop.raw_remote(); + let event_loop = Runtime::with_thread_count(1); + let remote = event_loop.raw_executor(); Server { server: f(remote), diff --git a/rpc/src/tests/rpc.rs b/rpc/src/tests/rpc.rs index fd515ea3a..e4aead29d 100644 --- a/rpc/src/tests/rpc.rs +++ b/rpc/src/tests/rpc.rs @@ -26,14 +26,13 @@ fn serve(handler: Option>) -> Server { let address = "127.0.0.1:0".parse().unwrap(); let handler = handler.unwrap_or_default(); - Server::new(|remote| ::start_http_with_middleware( + Server::new(|_remote| ::start_http_with_middleware( &address, http::DomainsValidation::Disabled, http::DomainsValidation::Disabled, handler, - remote, extractors::RpcExtractor, - |request: hyper::Request| { + |request: hyper::Request| { http::RequestMiddlewareAction::Proceed { should_continue_on_invalid_cors: false, request, @@ -50,7 +49,7 @@ fn request(server: Server, request: &str) -> http_client::Response { } #[cfg(test)] -mod testsing { +mod tests { use jsonrpc_core::{MetaIoHandler, Value}; use v1::Metadata; use super::{request, Server}; @@ -73,7 +72,7 @@ mod testsing { // when let req = r#"{"method":"hello","params":[],"jsonrpc":"2.0","id":1}"#; - let expected = "4B\n{\"jsonrpc\":\"2.0\",\"result\":\"unknown origin / unknown agent via RPC\",\"id\":1}\n\n0\n\n"; + let expected = "{\"jsonrpc\":\"2.0\",\"result\":\"unknown origin / unknown agent via RPC\",\"id\":1}\n"; let res = request(server, &format!("\ POST / HTTP/1.1\r\n\ @@ -98,7 +97,7 @@ mod testsing { // when let req = r#"{"method":"hello","params":[],"jsonrpc":"2.0","id":1}"#; - let expected = "49\n{\"jsonrpc\":\"2.0\",\"result\":\"unknown origin / curl/7.16.3 via RPC\",\"id\":1}\n\n0\n\n"; + let expected = "{\"jsonrpc\":\"2.0\",\"result\":\"unknown origin / curl/7.16.3 via RPC\",\"id\":1}\n"; let res = request(server, &format!("\ POST / HTTP/1.1\r\n\ diff --git a/rpc/src/tests/ws.rs b/rpc/src/tests/ws.rs index ed5e8299e..6fd93fef7 100644 --- a/rpc/src/tests/ws.rs +++ b/rpc/src/tests/ws.rs @@ -34,10 +34,9 @@ pub fn serve() -> (Server, usize, GuardedAuthCodes) { let authcodes = GuardedAuthCodes::new(); let stats = Arc::new(informant::RpcStats::default()); - let res = Server::new(|remote| ::start_ws( + let res = Server::new(|_| ::start_ws( &address, io, - remote, ws::DomainsValidation::Disabled, ws::DomainsValidation::Disabled, 5, diff --git a/rpc/src/v1/extractors.rs b/rpc/src/v1/extractors.rs index 3406bb031..f0433db02 100644 --- a/rpc/src/v1/extractors.rs +++ b/rpc/src/v1/extractors.rs @@ -23,6 +23,7 @@ use authcodes; use http_common::HttpMetaExtractor; use ipc; use jsonrpc_core as core; +use jsonrpc_core::futures::future::Either; use jsonrpc_pubsub::Session; use ws; use ethereum_types::H256; @@ -216,26 +217,26 @@ impl> WsDispatcher { } impl> core::Middleware for WsDispatcher { - type Future = core::futures::future::Either< - M::Future, + type Future = Either< + core::FutureRpcResult, core::FutureResponse, >; - fn on_request(&self, request: core::Request, meta: Metadata, process: F) -> Self::Future where + fn on_request(&self, request: core::Request, meta: Metadata, process: F) + -> Either + where F: FnOnce(core::Request, Metadata) -> X, X: core::futures::Future, Error=()> + Send + 'static, { - use self::core::futures::future::Either::{A, B}; - let use_full = match &meta.origin { &Origin::Signer { .. } => true, _ => false, }; if use_full { - A(self.full_handler.handle_rpc_request(request, meta)) + Either::A(Either::A(self.full_handler.handle_rpc_request(request, meta))) } else { - B(Box::new(process(request, meta))) + Either::B(process(request, meta)) } } } diff --git a/rpc/src/v1/helpers/nonce.rs b/rpc/src/v1/helpers/nonce.rs index 1a66a7a04..110d8decb 100644 --- a/rpc/src/v1/helpers/nonce.rs +++ b/rpc/src/v1/helpers/nonce.rs @@ -23,31 +23,25 @@ use ethereum_types::{U256, Address}; use futures::{Future, future, Poll, Async}; use futures::future::Either; use futures::sync::oneshot; -use futures_cpupool::CpuPool; +use parity_runtime::Executor; /// Manages currently reserved and prospective nonces /// for multiple senders. #[derive(Debug)] pub struct Reservations { nonces: HashMap, - pool: CpuPool, + executor: Executor, } impl Reservations { /// A maximal number of reserved nonces in the hashmap /// before we start clearing the unused ones. const CLEAN_AT: usize = 512; - /// Create new nonces manager and spawn a single-threaded cpu pool - /// for progressing execution of dropped nonces. - pub fn new() -> Self { - Self::with_pool(CpuPool::new(1)) - } - - /// Create new nonces manager with given cpupool. - pub fn with_pool(pool: CpuPool) -> Self { + /// Create new nonces manager with given executor. + pub fn new(executor: Executor) -> Self { Reservations { nonces: Default::default(), - pool, + executor, } } @@ -59,9 +53,9 @@ impl Reservations { self.nonces.retain(|_, v| !v.is_empty()); } - let pool = &self.pool; + let executor = &self.executor; self.nonces.entry(sender) - .or_insert_with(move || SenderReservations::with_pool(pool.clone())) + .or_insert_with(move || SenderReservations::new(executor.clone())) .reserve_nonce(minimal) } } @@ -71,25 +65,18 @@ impl Reservations { pub struct SenderReservations { previous: Option>, previous_ready: Arc, - pool: CpuPool, + executor: Executor, prospective_value: U256, dropped: Arc, } impl SenderReservations { - /// Create new nonces manager and spawn a single-threaded cpu pool - /// for progressing execution of dropped nonces. - #[cfg(test)] - pub fn new() -> Self { - Self::with_pool(CpuPool::new(1)) - } - - /// Create new nonces manager with given cpu pool. - pub fn with_pool(pool: CpuPool) -> Self { + /// Create new nonces manager with given executor. + pub fn new(executor: Executor) -> Self { SenderReservations { previous: None, previous_ready: Arc::new(AtomicBool::new(true)), - pool, + executor, prospective_value: Default::default(), dropped: Default::default(), } @@ -110,7 +97,7 @@ impl SenderReservations { let (next, rx) = oneshot::channel(); let next = Some(next); let next_sent = Arc::new(AtomicBool::default()); - let pool = self.pool.clone(); + let executor = self.executor.clone(); let dropped = self.dropped.clone(); self.previous_ready = next_sent.clone(); match mem::replace(&mut self.previous, Some(rx)) { @@ -120,7 +107,7 @@ impl SenderReservations { next_sent, minimal, prospective_value, - pool, + executor, dropped, }, None => Reserved { @@ -129,7 +116,7 @@ impl SenderReservations { next_sent, minimal, prospective_value, - pool, + executor, dropped, }, } @@ -152,7 +139,7 @@ pub struct Reserved { next_sent: Arc, minimal: U256, prospective_value: U256, - pool: CpuPool, + executor: Executor, dropped: Arc, } @@ -196,10 +183,14 @@ impl Drop for Reserved { self.dropped.fetch_add(1, atomic::Ordering::SeqCst); // If Reserved is dropped just pipe previous and next together. let previous = mem::replace(&mut self.previous, Either::B(future::ok(U256::default()))); - self.pool.spawn(previous.map(move |nonce| { - next_sent.store(true, atomic::Ordering::SeqCst); - next.send(nonce).expect(Ready::RECV_PROOF) - })).forget() + self.executor.spawn( + previous + .map(move |nonce| { + next_sent.store(true, atomic::Ordering::SeqCst); + next.send(nonce).expect(Ready::RECV_PROOF) + }) + .map_err(|err| error!("Error dropping `Reserved`: {:?}", err)) + ); } } } @@ -253,10 +244,12 @@ impl Drop for Ready { #[cfg(test)] mod tests { use super::*; + use parity_runtime::Runtime; #[test] fn should_reserve_a_set_of_nonces_and_resolve_them() { - let mut nonces = SenderReservations::new(); + let runtime = Runtime::with_thread_count(1); + let mut nonces = SenderReservations::new(runtime.executor()); assert!(nonces.is_empty()); let n1 = nonces.reserve_nonce(5.into()); @@ -303,7 +296,8 @@ mod tests { #[test] fn should_return_prospective_nonce() { - let mut nonces = SenderReservations::new(); + let runtime = Runtime::with_thread_count(1); + let mut nonces = SenderReservations::new(runtime.executor()); let n1 = nonces.reserve_nonce(5.into()); let n2 = nonces.reserve_nonce(5.into()); diff --git a/rpc/src/v1/helpers/subscription_manager.rs b/rpc/src/v1/helpers/subscription_manager.rs index 5f6d77d88..0641ca2b0 100644 --- a/rpc/src/v1/helpers/subscription_manager.rs +++ b/rpc/src/v1/helpers/subscription_manager.rs @@ -95,7 +95,7 @@ impl> GenericPollManager { jsonrpc: Some(core::Version::V2), id: core::Id::Str(id.as_string()), method: subscription.method.clone(), - params: Some(subscription.params.clone()), + params: subscription.params.clone(), }; trace!(target: "pubsub", "Polling method: {:?}", call); let result = self.rpc.handle_call(call.into(), subscription.metadata.clone()); @@ -141,7 +141,7 @@ mod tests { use jsonrpc_core::{MetaIoHandler, NoopMiddleware, Value, Params}; use jsonrpc_core::futures::{Future, Stream}; use jsonrpc_pubsub::SubscriptionId; - use http::tokio_core::reactor; + use http::tokio::runtime::Runtime; use super::GenericPollManager; @@ -162,25 +162,25 @@ mod tests { #[test] fn should_poll_subscribed_method() { // given - let mut el = reactor::Core::new().unwrap(); + let mut el = Runtime::new().unwrap(); let mut poll_manager = poll_manager(); let (id, rx) = poll_manager.subscribe(Default::default(), "hello".into(), Params::None); assert_eq!(id, SubscriptionId::String("0x416d77337e24399d".into())); // then poll_manager.tick().wait().unwrap(); - let (res, rx) = el.run(rx.into_future()).unwrap(); + let (res, rx) = el.block_on(rx.into_future()).unwrap(); assert_eq!(res, Some(Ok(Value::String("hello".into())))); // retrieve second item poll_manager.tick().wait().unwrap(); - let (res, rx) = el.run(rx.into_future()).unwrap(); + let (res, rx) = el.block_on(rx.into_future()).unwrap(); assert_eq!(res, Some(Ok(Value::String("world".into())))); // and no more notifications poll_manager.tick().wait().unwrap(); // we need to unsubscribe otherwise the future will never finish. poll_manager.unsubscribe(&id); - assert_eq!(el.run(rx.into_future()).unwrap().0, None); + assert_eq!(el.block_on(rx.into_future()).unwrap().0, None); } } diff --git a/rpc/src/v1/impls/eth_pubsub.rs b/rpc/src/v1/impls/eth_pubsub.rs index 7961b1d18..989a43fa5 100644 --- a/rpc/src/v1/impls/eth_pubsub.rs +++ b/rpc/src/v1/impls/eth_pubsub.rs @@ -39,7 +39,7 @@ use sync::LightSync; use light::cache::Cache; use light::on_demand::OnDemand; use light::client::{LightChainClient, LightChainNotify}; -use parity_reactor::Remote; +use parity_runtime::Executor; use ethereum_types::H256; use bytes::Bytes; use parking_lot::{RwLock, Mutex}; @@ -56,7 +56,7 @@ pub struct EthPubSubClient { impl EthPubSubClient { /// Creates new `EthPubSubClient`. - pub fn new(client: Arc, remote: Remote) -> Self { + pub fn new(client: Arc, executor: Executor) -> Self { let heads_subscribers = Arc::new(RwLock::new(Subscribers::default())); let logs_subscribers = Arc::new(RwLock::new(Subscribers::default())); let transactions_subscribers = Arc::new(RwLock::new(Subscribers::default())); @@ -64,7 +64,7 @@ impl EthPubSubClient { EthPubSubClient { handler: Arc::new(ChainNotificationHandler { client, - remote, + executor, heads_subscribers: heads_subscribers.clone(), logs_subscribers: logs_subscribers.clone(), transactions_subscribers: transactions_subscribers.clone(), @@ -77,8 +77,8 @@ impl EthPubSubClient { /// Creates new `EthPubSubCient` with deterministic subscription ids. #[cfg(test)] - pub fn new_test(client: Arc, remote: Remote) -> Self { - let client = Self::new(client, remote); + pub fn new_test(client: Arc, executor: Executor) -> Self { + let client = Self::new(client, executor); *client.heads_subscribers.write() = Subscribers::new_test(); *client.logs_subscribers.write() = Subscribers::new_test(); *client.transactions_subscribers.write() = Subscribers::new_test(); @@ -98,7 +98,7 @@ impl EthPubSubClient { on_demand: Arc, sync: Arc, cache: Arc>, - remote: Remote, + executor: Executor, gas_price_percentile: usize, ) -> Self { let fetch = LightFetch { @@ -108,22 +108,22 @@ impl EthPubSubClient { cache, gas_price_percentile, }; - EthPubSubClient::new(Arc::new(fetch), remote) + EthPubSubClient::new(Arc::new(fetch), executor) } } /// PubSub Notification handler. pub struct ChainNotificationHandler { client: Arc, - remote: Remote, + executor: Executor, heads_subscribers: Arc>>, logs_subscribers: Arc>>, transactions_subscribers: Arc>>, } impl ChainNotificationHandler { - fn notify(remote: &Remote, subscriber: &Client, result: pubsub::Result) { - remote.spawn(subscriber + fn notify(executor: &Executor, subscriber: &Client, result: pubsub::Result) { + executor.spawn(subscriber .notify(Ok(result)) .map(|_| ()) .map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e)) @@ -133,7 +133,7 @@ impl ChainNotificationHandler { fn notify_heads(&self, headers: &[(encoded::Header, BTreeMap)]) { for subscriber in self.heads_subscribers.read().values() { for &(ref header, ref extra_info) in headers { - Self::notify(&self.remote, subscriber, pubsub::Result::Header(RichHeader { + Self::notify(&self.executor, subscriber, pubsub::Result::Header(RichHeader { inner: header.into(), extra_info: extra_info.clone(), })); @@ -159,14 +159,14 @@ impl ChainNotificationHandler { .collect::>() ); let limit = filter.limit; - let remote = self.remote.clone(); + let executor = self.executor.clone(); let subscriber = subscriber.clone(); - self.remote.spawn(logs + self.executor.spawn(logs .map(move |logs| { let logs = logs.into_iter().flat_map(|log| log).collect(); for log in limit_logs(logs, limit) { - Self::notify(&remote, &subscriber, pubsub::Result::Log(log)) + Self::notify(&executor, &subscriber, pubsub::Result::Log(log)) } }) .map_err(|e| warn!("Unable to fetch latest logs: {:?}", e)) @@ -178,7 +178,7 @@ impl ChainNotificationHandler { pub fn notify_new_transactions(&self, hashes: &[H256]) { for subscriber in self.transactions_subscribers.read().values() { for hash in hashes { - Self::notify(&self.remote, subscriber, pubsub::Result::TransactionHash((*hash).into())); + Self::notify(&self.executor, subscriber, pubsub::Result::TransactionHash((*hash).into())); } } } diff --git a/rpc/src/v1/impls/light/parity_set.rs b/rpc/src/v1/impls/light/parity_set.rs index 6eadea43a..ca4eb60cb 100644 --- a/rpc/src/v1/impls/light/parity_set.rs +++ b/rpc/src/v1/impls/light/parity_set.rs @@ -22,7 +22,6 @@ use std::sync::Arc; use sync::ManageNetwork; use fetch::{self, Fetch}; -use futures_cpupool::CpuPool; use hash::keccak_buffer; use jsonrpc_core::{Result, BoxFuture}; @@ -35,16 +34,14 @@ use v1::types::{Bytes, H160, H256, U256, ReleaseInfo, Transaction}; pub struct ParitySetClient { net: Arc, fetch: F, - pool: CpuPool, } impl ParitySetClient { /// Creates new `ParitySetClient` with given `Fetch`. - pub fn new(net: Arc, fetch: F, p: CpuPool) -> Self { + pub fn new(net: Arc, fetch: F) -> Self { ParitySetClient { net: net, fetch: fetch, - pool: p, } } } @@ -134,7 +131,7 @@ impl ParitySet for ParitySetClient { }) .map(Into::into) }); - Box::new(self.pool.spawn(future)) + Box::new(future) } fn upgrade_ready(&self) -> Result> { diff --git a/rpc/src/v1/impls/parity_set.rs b/rpc/src/v1/impls/parity_set.rs index 9bbb7ceab..bff428dd5 100644 --- a/rpc/src/v1/impls/parity_set.rs +++ b/rpc/src/v1/impls/parity_set.rs @@ -23,7 +23,6 @@ use ethcore::client::{BlockChainClient, Mode}; use ethcore::miner::MinerService; use sync::ManageNetwork; use fetch::{self, Fetch}; -use futures_cpupool::CpuPool; use hash::keccak_buffer; use updater::{Service as UpdateService}; @@ -40,7 +39,6 @@ pub struct ParitySetClient { updater: Arc, net: Arc, fetch: F, - pool: CpuPool, } impl ParitySetClient @@ -53,7 +51,6 @@ impl ParitySetClient updater: &Arc, net: &Arc, fetch: F, - pool: CpuPool, ) -> Self { ParitySetClient { client: client.clone(), @@ -61,7 +58,6 @@ impl ParitySetClient updater: updater.clone(), net: net.clone(), fetch: fetch, - pool: pool, } } } @@ -177,7 +173,7 @@ impl ParitySet for ParitySetClient where }) .map(Into::into) }); - Box::new(self.pool.spawn(future)) + Box::new(future) } fn upgrade_ready(&self) -> Result> { diff --git a/rpc/src/v1/impls/pubsub.rs b/rpc/src/v1/impls/pubsub.rs index 564c8b90d..98ac5707e 100644 --- a/rpc/src/v1/impls/pubsub.rs +++ b/rpc/src/v1/impls/pubsub.rs @@ -27,7 +27,7 @@ use jsonrpc_macros::pubsub::Subscriber; use jsonrpc_pubsub::SubscriptionId; use tokio_timer; -use parity_reactor::Remote; +use parity_runtime::Executor; use v1::helpers::GenericPollManager; use v1::metadata::Metadata; use v1::traits::PubSub; @@ -35,12 +35,12 @@ use v1::traits::PubSub; /// Parity PubSub implementation. pub struct PubSubClient> { poll_manager: Arc>>, - remote: Remote, + executor: Executor, } impl> PubSubClient { /// Creates new `PubSubClient`. - pub fn new(rpc: MetaIoHandler, remote: Remote) -> Self { + pub fn new(rpc: MetaIoHandler, executor: Executor) -> Self { let poll_manager = Arc::new(RwLock::new(GenericPollManager::new(rpc))); let pm2 = poll_manager.clone(); @@ -50,14 +50,14 @@ impl> PubSubClient { // Start ticking let interval = timer.interval(Duration::from_millis(1000)); - remote.spawn(interval + executor.spawn(interval .map_err(|e| warn!("Polling timer error: {:?}", e)) .for_each(move |_| pm2.read().tick()) ); PubSubClient { poll_manager, - remote, + executor, } } } @@ -65,8 +65,8 @@ impl> PubSubClient { impl PubSubClient { /// Creates new `PubSubClient` with deterministic ids. #[cfg(test)] - pub fn new_test(rpc: MetaIoHandler, remote: Remote) -> Self { - let client = Self::new(MetaIoHandler::with_middleware(Default::default()), remote); + pub fn new_test(rpc: MetaIoHandler, executor: Executor) -> Self { + let client = Self::new(MetaIoHandler::with_middleware(Default::default()), executor); *client.poll_manager.write() = GenericPollManager::new_test(rpc); client } @@ -84,7 +84,7 @@ impl> PubSub for PubSubClient { let (id, receiver) = poll_manager.subscribe(meta, method, params); match subscriber.assign_id(id.clone()) { Ok(sink) => { - self.remote.spawn(receiver.forward(sink.sink_map_err(|e| { + self.executor.spawn(receiver.forward(sink.sink_map_err(|e| { warn!("Cannot send notification: {:?}", e); })).map(|_| ())); }, diff --git a/rpc/src/v1/impls/signer.rs b/rpc/src/v1/impls/signer.rs index 8ed046b88..a6197433f 100644 --- a/rpc/src/v1/impls/signer.rs +++ b/rpc/src/v1/impls/signer.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use ethcore::account_provider::AccountProvider; use ethkey; -use parity_reactor::Remote; +use parity_runtime::Executor; use parking_lot::Mutex; use rlp::Rlp; use transaction::{SignedTransaction, PendingTransaction}; @@ -50,7 +50,7 @@ impl SignerClient { store: &Arc, dispatcher: D, signer: &Arc, - remote: Remote, + executor: Executor, ) -> Self { let subscribers = Arc::new(Mutex::new(Subscribers::default())); let subs = Arc::downgrade(&subscribers); @@ -60,7 +60,7 @@ impl SignerClient { let requests = s.requests().into_iter().map(Into::into).collect::>(); for subscription in subs.lock().values() { let subscription: &Sink<_> = subscription; - remote.spawn(subscription + executor.spawn(subscription .notify(Ok(requests.clone())) .map(|_| ()) .map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e)) diff --git a/rpc/src/v1/impls/signing.rs b/rpc/src/v1/impls/signing.rs index d16715353..1497ce0b2 100644 --- a/rpc/src/v1/impls/signing.rs +++ b/rpc/src/v1/impls/signing.rs @@ -44,7 +44,7 @@ use v1::types::{ Origin, }; -use parity_reactor::Remote; +use parity_runtime::Executor; /// After 60s entries that are not queried with `check_request` will get garbage collected. const MAX_PENDING_DURATION_SEC: u32 = 60; @@ -67,7 +67,7 @@ impl Future for DispatchResult { } } -fn schedule(remote: Remote, +fn schedule(executor: Executor, confirmations: Arc>>>, id: U256, future: RpcConfirmationReceiver) { @@ -83,7 +83,7 @@ fn schedule(remote: Remote, confirmations.insert(id, Some(result)); Ok(()) }); - remote.spawn(future); + executor.spawn(future); } /// Implementation of functions that require signing when no trusted signer is used. @@ -91,19 +91,19 @@ pub struct SigningQueueClient { signer: Arc, accounts: Arc, dispatcher: D, - remote: Remote, + executor: Executor, // None here means that the request hasn't yet been confirmed confirmations: Arc>>>, } impl SigningQueueClient { /// Creates a new signing queue client given shared signing queue. - pub fn new(signer: &Arc, dispatcher: D, remote: Remote, accounts: &Arc) -> Self { + pub fn new(signer: &Arc, dispatcher: D, executor: Executor, accounts: &Arc) -> Self { SigningQueueClient { signer: signer.clone(), accounts: accounts.clone(), dispatcher, - remote, + executor, confirmations: Arc::new(Mutex::new(TransientHashMap::new(MAX_PENDING_DURATION_SEC))), } } @@ -143,7 +143,7 @@ impl ParitySigning for SigningQueueClient { } fn post_sign(&self, meta: Metadata, address: RpcH160, data: RpcBytes) -> BoxFuture> { - let remote = self.remote.clone(); + let executor = self.executor.clone(); let confirmations = self.confirmations.clone(); Box::new(self.dispatch( @@ -153,21 +153,21 @@ impl ParitySigning for SigningQueueClient { ).map(move |result| match result { DispatchResult::Value(v) => RpcEither::Or(v), DispatchResult::Future(id, future) => { - schedule(remote, confirmations, id, future); + schedule(executor, confirmations, id, future); RpcEither::Either(id.into()) }, })) } fn post_transaction(&self, meta: Metadata, request: RpcTransactionRequest) -> BoxFuture> { - let remote = self.remote.clone(); + let executor = self.executor.clone(); let confirmations = self.confirmations.clone(); Box::new(self.dispatch(RpcConfirmationPayload::SendTransaction(request), DefaultAccount::Provided(self.accounts.default_account().ok().unwrap_or_default()), meta.origin) .map(|result| match result { DispatchResult::Value(v) => RpcEither::Or(v), DispatchResult::Future(id, future) => { - schedule(remote, confirmations, id, future); + schedule(executor, confirmations, id, future); RpcEither::Either(id.into()) }, })) diff --git a/rpc/src/v1/informant.rs b/rpc/src/v1/informant.rs index 07a70eeb1..3dab54843 100644 --- a/rpc/src/v1/informant.rs +++ b/rpc/src/v1/informant.rs @@ -20,12 +20,13 @@ use std::fmt; use std::sync::Arc; use std::sync::atomic::{self, AtomicUsize}; use std::time; -use futures_cpupool as pool; -use jsonrpc_core as rpc; +use parity_runtime; +use jsonrpc_core as core; +use jsonrpc_core::futures::future::Either; use order_stat; use parking_lot::RwLock; -pub use self::pool::CpuPool; +pub use self::parity_runtime::Executor; const RATE_SECONDS: usize = 10; const STATS_SAMPLES: usize = 60; @@ -186,16 +187,14 @@ pub trait ActivityNotifier: Send + Sync + 'static { pub struct Middleware { stats: Arc, notifier: T, - pool: Option, } impl Middleware { /// Create new Middleware with stats counter and activity notifier. - pub fn new(stats: Arc, notifier: T, pool: Option) -> Self { + pub fn new(stats: Arc, notifier: T) -> Self { Middleware { stats, notifier, - pool, } } @@ -204,28 +203,24 @@ impl Middleware { } } -impl rpc::Middleware for Middleware { - type Future = rpc::futures::future::Either< - pool::CpuFuture, ()>, - rpc::FutureResponse, - >; +impl core::Middleware for Middleware { + type Future = core::FutureResponse; - fn on_request(&self, request: rpc::Request, meta: M, process: F) -> Self::Future where - F: FnOnce(rpc::Request, M) -> X, - X: rpc::futures::Future, Error=()> + Send + 'static, + fn on_request(&self, request: core::Request, meta: M, process: F) -> Either where + F: FnOnce(core::Request, M) -> X, + X: core::futures::Future, Error=()> + Send + 'static, { - use self::rpc::futures::future::Either::{A, B}; - let start = time::Instant::now(); self.notifier.active(); self.stats.count_request(); let id = match request { - rpc::Request::Single(rpc::Call::MethodCall(ref call)) => Some(call.id.clone()), + core::Request::Single(core::Call::MethodCall(ref call)) => Some(call.id.clone()), _ => None, }; let stats = self.stats.clone(); + let future = process(request, meta).map(move |res| { let time = Self::as_micro(start.elapsed()); if time > 10_000 { @@ -235,10 +230,7 @@ impl rpc::Middleware for Middleware res }); - match self.pool { - Some(ref pool) => A(pool.spawn(future)), - None => B(Box::new(future)), - } + Either::A(Box::new(future)) } } diff --git a/rpc/src/v1/tests/eth.rs b/rpc/src/v1/tests/eth.rs index 231ee450e..16602c4a5 100644 --- a/rpc/src/v1/tests/eth.rs +++ b/rpc/src/v1/tests/eth.rs @@ -32,6 +32,7 @@ use ethjson::spec::ForkSpec; use io::IoChannel; use miner::external::ExternalMiner; use parking_lot::Mutex; +use parity_runtime::Runtime; use jsonrpc_core::IoHandler; use v1::helpers::dispatch::FullDispatcher; @@ -73,6 +74,7 @@ fn make_spec(chain: &BlockChain) -> Spec { } struct EthTester { + _runtime: Runtime, client: Arc, _miner: Arc, _snapshot: Arc, @@ -99,6 +101,7 @@ impl EthTester { } fn from_spec(spec: Spec) -> Self { + let runtime = Runtime::with_thread_count(1); let account_provider = account_provider(); let opt_account_provider = account_provider.clone(); let miner_service = miner_service(&spec, account_provider.clone()); @@ -124,7 +127,7 @@ impl EthTester { Default::default(), ); - let reservations = Arc::new(Mutex::new(nonce::Reservations::new())); + let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let dispatcher = FullDispatcher::new(client.clone(), miner_service.clone(), reservations, 50); let eth_sign = SigningUnsafeClient::new( @@ -137,6 +140,7 @@ impl EthTester { handler.extend_with(eth_sign.to_delegate()); EthTester { + _runtime: runtime, _miner: miner_service, _snapshot: snapshot_service, client: client, diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 040bf4be6..a04e2b6df 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -32,6 +32,7 @@ use miner::external::ExternalMiner; use rlp; use rustc_hex::{FromHex, ToHex}; use transaction::{Transaction, Action}; +use parity_runtime::Runtime; use jsonrpc_core::IoHandler; use v1::{Eth, EthClient, EthClientOptions, EthFilter, EthFilterClient, EthSigning, SigningUnsafeClient}; @@ -65,6 +66,7 @@ fn snapshot_service() -> Arc { } struct EthTester { + pub runtime: Runtime, pub client: Arc, pub sync: Arc, pub accounts_provider: Arc, @@ -82,6 +84,7 @@ impl Default for EthTester { impl EthTester { pub fn new_with_options(options: EthClientOptions) -> Self { + let runtime = Runtime::with_thread_count(1); let client = blockchain_client(); let sync = sync_provider(); let ap = accounts_provider(); @@ -94,7 +97,7 @@ impl EthTester { let poll_lifetime = options.poll_lifetime; let eth = EthClient::new(&client, &snapshot, &sync, &opt_ap, &miner, &external_miner, options).to_delegate(); let filter = EthFilterClient::new(client.clone(), miner.clone(), poll_lifetime).to_delegate(); - let reservations = Arc::new(Mutex::new(nonce::Reservations::new())); + let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let dispatcher = FullDispatcher::new(client.clone(), miner.clone(), reservations, gas_price_percentile); let sign = SigningUnsafeClient::new(&opt_ap, dispatcher).to_delegate(); @@ -104,6 +107,7 @@ impl EthTester { io.extend_with(filter); EthTester { + runtime, client: client, sync: sync, accounts_provider: ap, diff --git a/rpc/src/v1/tests/mocked/eth_pubsub.rs b/rpc/src/v1/tests/mocked/eth_pubsub.rs index 9233435bf..e363b9135 100644 --- a/rpc/src/v1/tests/mocked/eth_pubsub.rs +++ b/rpc/src/v1/tests/mocked/eth_pubsub.rs @@ -25,14 +25,14 @@ use std::time::Duration; use v1::{EthPubSub, EthPubSubClient, Metadata}; use ethcore::client::{TestBlockChainClient, EachBlockWith, ChainNotify, ChainRoute, ChainRouteType}; -use parity_reactor::EventLoop; +use parity_runtime::Runtime; const DURATION_ZERO: Duration = Duration::from_millis(0); #[test] fn should_subscribe_to_new_heads() { // given - let el = EventLoop::spawn(); + let el = Runtime::with_thread_count(1); let mut client = TestBlockChainClient::new(); // Insert some blocks client.add_blocks(3, EachBlockWith::Nothing); @@ -40,7 +40,7 @@ fn should_subscribe_to_new_heads() { let h2 = client.block_hash_delta_minus(2); let h1 = client.block_hash_delta_minus(3); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.remote()); + let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -89,7 +89,7 @@ fn should_subscribe_to_logs() { use ethcore::client::BlockInfo; // given - let el = EventLoop::spawn(); + let el = Runtime::with_thread_count(1); let mut client = TestBlockChainClient::new(); // Insert some blocks client.add_blocks(1, EachBlockWith::Transaction); @@ -112,7 +112,7 @@ fn should_subscribe_to_logs() { } ]); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.remote()); + let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -156,10 +156,10 @@ fn should_subscribe_to_logs() { #[test] fn should_subscribe_to_pending_transactions() { // given - let el = EventLoop::spawn(); + let el = Runtime::with_thread_count(1); let client = TestBlockChainClient::new(); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.remote()); + let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); let handler = pubsub.handler().upgrade().unwrap(); let pubsub = pubsub.to_delegate(); @@ -203,9 +203,9 @@ fn should_subscribe_to_pending_transactions() { #[test] fn should_return_unimplemented() { // given - let el = EventLoop::spawn(); + let el = Runtime::with_thread_count(1); let client = TestBlockChainClient::new(); - let pubsub = EthPubSubClient::new_test(Arc::new(client), el.remote()); + let pubsub = EthPubSubClient::new_test(Arc::new(client), el.executor()); let pubsub = pubsub.to_delegate(); let mut io = MetaIoHandler::default(); diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index 5aca2827e..6438a6661 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -22,7 +22,6 @@ use ethereum_types::{U256, Address}; use ethcore::miner::MinerService; use ethcore::client::TestBlockChainClient; use sync::ManageNetwork; -use futures_cpupool::CpuPool; use jsonrpc_core::IoHandler; use v1::{ParitySet, ParitySetClient}; @@ -55,8 +54,7 @@ fn parity_set_client( updater: &Arc, net: &Arc, ) -> TestParitySetClient { - let pool = CpuPool::new(1); - ParitySetClient::new(client, miner, updater, &(net.clone() as Arc), FakeFetch::new(Some(1)), pool) + ParitySetClient::new(client, miner, updater, &(net.clone() as Arc), FakeFetch::new(Some(1))) } #[test] diff --git a/rpc/src/v1/tests/mocked/personal.rs b/rpc/src/v1/tests/mocked/personal.rs index a60914823..344998a92 100644 --- a/rpc/src/v1/tests/mocked/personal.rs +++ b/rpc/src/v1/tests/mocked/personal.rs @@ -24,6 +24,7 @@ use ethcore::client::TestBlockChainClient; use jsonrpc_core::IoHandler; use parking_lot::Mutex; use transaction::{Action, Transaction}; +use parity_runtime::Runtime; use v1::{PersonalClient, Personal, Metadata}; use v1::helpers::nonce; @@ -32,6 +33,7 @@ use v1::tests::helpers::TestMinerService; use v1::types::H520; struct PersonalTester { + _runtime: Runtime, accounts: Arc, io: IoHandler, miner: Arc, @@ -51,10 +53,11 @@ fn miner_service() -> Arc { } fn setup() -> PersonalTester { + let runtime = Runtime::with_thread_count(1); let accounts = accounts_provider(); let client = blockchain_client(); let miner = miner_service(); - let reservations = Arc::new(Mutex::new(nonce::Reservations::new())); + let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let dispatcher = FullDispatcher::new(client, miner.clone(), reservations, 50); let personal = PersonalClient::new(&accounts, dispatcher, false); @@ -63,6 +66,7 @@ fn setup() -> PersonalTester { io.extend_with(personal.to_delegate()); let tester = PersonalTester { + _runtime: runtime, accounts: accounts, io: io, miner: miner, diff --git a/rpc/src/v1/tests/mocked/pubsub.rs b/rpc/src/v1/tests/mocked/pubsub.rs index a21f8a490..c5f965cda 100644 --- a/rpc/src/v1/tests/mocked/pubsub.rs +++ b/rpc/src/v1/tests/mocked/pubsub.rs @@ -20,7 +20,7 @@ use jsonrpc_core::{self as core, MetaIoHandler}; use jsonrpc_core::futures::{self, Stream, Future}; use jsonrpc_pubsub::Session; -use parity_reactor::EventLoop; +use parity_runtime::Runtime; use v1::{PubSub, PubSubClient, Metadata}; fn rpc() -> MetaIoHandler { @@ -40,9 +40,9 @@ fn rpc() -> MetaIoHandler { #[test] fn should_subscribe_to_a_method() { // given - let el = EventLoop::spawn(); + let el = Runtime::with_thread_count(1); let rpc = rpc(); - let pubsub = PubSubClient::new_test(rpc, el.remote()).to_delegate(); + let pubsub = PubSubClient::new_test(rpc, el.executor()).to_delegate(); let mut io = MetaIoHandler::default(); io.extend_with(pubsub); diff --git a/rpc/src/v1/tests/mocked/signer.rs b/rpc/src/v1/tests/mocked/signer.rs index 430fb4fc2..679645baf 100644 --- a/rpc/src/v1/tests/mocked/signer.rs +++ b/rpc/src/v1/tests/mocked/signer.rs @@ -21,7 +21,7 @@ use bytes::ToPretty; use ethcore::account_provider::AccountProvider; use ethcore::client::TestBlockChainClient; -use parity_reactor::EventLoop; +use parity_runtime::Runtime; use parking_lot::Mutex; use rlp::encode; use transaction::{Transaction, Action, SignedTransaction}; @@ -36,6 +36,7 @@ use v1::helpers::{nonce, SigningQueue, SignerService, FilledTransactionRequest, use v1::helpers::dispatch::{FullDispatcher, eth_data_hash}; struct SignerTester { + _runtime: Runtime, signer: Arc, accounts: Arc, io: IoHandler, @@ -56,18 +57,19 @@ fn miner_service() -> Arc { } fn signer_tester() -> SignerTester { + let runtime = Runtime::with_thread_count(1); let signer = Arc::new(SignerService::new_test(false)); let accounts = accounts_provider(); let client = blockchain_client(); let miner = miner_service(); - let reservations = Arc::new(Mutex::new(nonce::Reservations::new())); - let event_loop = EventLoop::spawn(); + let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let dispatcher = FullDispatcher::new(client, miner.clone(), reservations, 50); let mut io = IoHandler::default(); - io.extend_with(SignerClient::new(&accounts, dispatcher, &signer, event_loop.remote()).to_delegate()); + io.extend_with(SignerClient::new(&accounts, dispatcher, &signer, runtime.executor()).to_delegate()); SignerTester { + _runtime: runtime, signer: signer, accounts: accounts, io: io, diff --git a/rpc/src/v1/tests/mocked/signing.rs b/rpc/src/v1/tests/mocked/signing.rs index c063ee096..dba0fbd22 100644 --- a/rpc/src/v1/tests/mocked/signing.rs +++ b/rpc/src/v1/tests/mocked/signing.rs @@ -39,10 +39,10 @@ use ethstore::ethkey::{Generator, Random}; use parking_lot::Mutex; use serde_json; use transaction::{Transaction, Action, SignedTransaction}; - -use parity_reactor::Remote; +use parity_runtime::{Runtime, Executor}; struct SigningTester { + pub runtime: Runtime, pub signer: Arc, pub client: Arc, pub miner: Arc, @@ -52,23 +52,25 @@ struct SigningTester { impl Default for SigningTester { fn default() -> Self { + let runtime = Runtime::with_thread_count(1); let signer = Arc::new(SignerService::new_test(false)); let client = Arc::new(TestBlockChainClient::default()); let miner = Arc::new(TestMinerService::default()); let accounts = Arc::new(AccountProvider::transient_provider()); - let reservations = Arc::new(Mutex::new(nonce::Reservations::new())); + let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let mut io = IoHandler::default(); let dispatcher = FullDispatcher::new(client.clone(), miner.clone(), reservations, 50); - let remote = Remote::new_thread_per_future(); + let executor = Executor::new_thread_per_future(); - let rpc = SigningQueueClient::new(&signer, dispatcher.clone(), remote.clone(), &accounts); + let rpc = SigningQueueClient::new(&signer, dispatcher.clone(), executor.clone(), &accounts); io.extend_with(EthSigning::to_delegate(rpc)); - let rpc = SigningQueueClient::new(&signer, dispatcher, remote, &accounts); + let rpc = SigningQueueClient::new(&signer, dispatcher, executor, &accounts); io.extend_with(ParitySigning::to_delegate(rpc)); SigningTester { + runtime, signer: signer, client: client, miner: miner, diff --git a/rpc_client/Cargo.toml b/rpc_client/Cargo.toml index df5230678..17c0c8258 100644 --- a/rpc_client/Cargo.toml +++ b/rpc_client/Cargo.toml @@ -14,7 +14,7 @@ serde_json = "1.0" url = "1.2.0" matches = "0.1" parking_lot = "0.6" -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } parity-rpc = { path = "../rpc" } keccak-hash = "0.1" diff --git a/rpc_client/src/client.rs b/rpc_client/src/client.rs index 93abdac88..f44556337 100644 --- a/rpc_client/src/client.rs +++ b/rpc_client/src/client.rs @@ -274,7 +274,7 @@ impl Rpc { let request = MethodCall { jsonrpc: Some(Version::V2), method: method.to_owned(), - params: Some(Params::Array(params)), + params: Params::Array(params), id: Id::Num(id as u64), }; diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index 0d1904ce1..15ce83e53 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -9,23 +9,20 @@ authors = ["Parity Technologies "] byteorder = "1.0" log = "0.4" parking_lot = "0.6" -hyper = { version = "0.11", default-features = false } +hyper = { version = "0.12", default-features = false } serde = "1.0" serde_json = "1.0" serde_derive = "1.0" futures = "0.1" -futures-cpupool = "0.1" rustc-hex = "1.0" tiny-keccak = "1.4" -tokio = "0.1" -tokio-core = "0.1" +tokio = "~0.1.11" tokio-io = "0.1" tokio-service = "0.1" -tokio-proto = "0.1" url = "1.0" ethcore = { path = "../ethcore" } parity-bytes = "0.1" -parity-crypto = "0.1" +parity-crypto = "0.2" ethcore-logger = { path = "../logger" } ethcore-sync = { path = "../ethcore/sync" } ethcore-transaction = { path = "../ethcore/transaction" } diff --git a/secret_store/src/key_server.rs b/secret_store/src/key_server.rs index 3b2419977..1ad319780 100644 --- a/secret_store/src/key_server.rs +++ b/secret_store/src/key_server.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use std::sync::mpsc; use futures::{self, Future}; use parking_lot::Mutex; -use tokio_core::reactor::Core; +use tokio::runtime; use crypto::DEFAULT_MAC; use ethkey::crypto; use super::acl_storage::AclStorage; @@ -191,7 +191,11 @@ impl KeyServerCore { let (stop, stopped) = futures::oneshot(); let (tx, rx) = mpsc::channel(); let handle = thread::Builder::new().name("KeyServerLoop".into()).spawn(move || { - let mut el = match Core::new() { + let runtime_res = runtime::Builder::new() + .core_threads(config.threads) + .build(); + + let mut el = match runtime_res { Ok(el) => el, Err(e) => { tx.send(Err(Error::Internal(format!("error initializing event loop: {}", e)))).expect("Rx is blocking upper thread."); @@ -199,10 +203,10 @@ impl KeyServerCore { }, }; - let cluster = ClusterCore::new(el.handle(), config); + let cluster = ClusterCore::new(el.executor(), config); let cluster_client = cluster.and_then(|c| c.run().map(|_| c.client())); tx.send(cluster_client.map_err(Into::into)).expect("Rx is blocking upper thread."); - let _ = el.run(futures::empty().select(stopped)); + let _ = el.block_on(futures::empty().select(stopped)); trace!(target: "secretstore_net", "{}: KeyServerLoop thread stopped", self_key_pair.public()); }).map_err(|e| Error::Internal(format!("{}", e)))?; diff --git a/secret_store/src/key_server_cluster/client_sessions/generation_session.rs b/secret_store/src/key_server_cluster/client_sessions/generation_session.rs index 7001ccf69..2368635df 100644 --- a/secret_store/src/key_server_cluster/client_sessions/generation_session.rs +++ b/secret_store/src/key_server_cluster/client_sessions/generation_session.rs @@ -701,7 +701,7 @@ impl SessionImpl { let threshold = data.threshold.expect("threshold is filled in initialization phase; KV phase follows initialization phase; qed"); let is_zero = data.is_zero.expect("is_zero is filled in initialization phase; KV phase follows initialization phase; qed"); let self_public_share = { - if !is_zero { + if !is_zero { let derived_point = data.derived_point.clone().expect("derived point generated on initialization phase; KV phase follows initialization phase; qed"); let number_id = data.nodes[self.node()].id_number.clone(); for (_ , node_data) in data.nodes.iter_mut().filter(|&(node_id, _)| node_id != self.node()) { @@ -942,12 +942,12 @@ pub mod tests { use std::sync::Arc; use std::collections::{BTreeSet, BTreeMap, VecDeque}; use std::time::Duration; - use tokio_core::reactor::Core; use ethereum_types::Address; use ethkey::{Random, Generator, KeyPair}; use key_server_cluster::{NodeId, SessionId, Error, KeyStorage, DummyKeyStorage}; use key_server_cluster::message::{self, Message, GenerationMessage}; - use key_server_cluster::cluster::tests::{DummyCluster, make_clusters, run_clusters, loop_until, all_connections_established}; + use key_server_cluster::cluster::tests::{DummyCluster, make_clusters, run_clusters, loop_until, + all_connections_established, new_runtime}; use key_server_cluster::cluster_sessions::ClusterSession; use key_server_cluster::generation_session::{SessionImpl, SessionState, SessionParams}; use key_server_cluster::math; @@ -1357,19 +1357,22 @@ pub mod tests { let test_cases = [(1, 3)]; for &(threshold, num_nodes) in &test_cases { - let mut core = Core::new().unwrap(); + let mut core = new_runtime(); // prepare cluster objects for each node let clusters = make_clusters(&core, 6031, num_nodes); run_clusters(&clusters); + // `clusters` contains `Arc` and clones will refer to the same cores. + let clusters_clone = clusters.clone(); + // establish connections - loop_until(&mut core, CONN_TIMEOUT, || clusters.iter().all(all_connections_established)); + loop_until(&mut core, CONN_TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // run session to completion let session_id = SessionId::default(); let session = clusters[0].client().new_generation_session(session_id, Default::default(), Default::default(), threshold).unwrap(); - loop_until(&mut core, SESSION_TIMEOUT, || session.joint_public_and_secret().is_some()); + loop_until(&mut core, SESSION_TIMEOUT, move || session.joint_public_and_secret().is_some()); } } diff --git a/secret_store/src/key_server_cluster/cluster.rs b/secret_store/src/key_server_cluster/cluster.rs index 8668da539..9607d9173 100644 --- a/secret_store/src/key_server_cluster/cluster.rs +++ b/secret_store/src/key_server_cluster/cluster.rs @@ -17,15 +17,16 @@ use std::io; use std::time::{Duration, Instant}; use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; use std::collections::{BTreeMap, BTreeSet}; use std::collections::btree_map::Entry; use std::net::{SocketAddr, IpAddr}; -use futures::{finished, failed, Future, Stream}; -use futures_cpupool::CpuPool; -use parking_lot::{RwLock, Mutex}; +use futures::{future, Future, Stream}; +use parking_lot::{Mutex, RwLock}; use tokio_io::IoFuture; -use tokio_core::reactor::{Handle, Remote, Interval}; -use tokio_core::net::{TcpListener, TcpStream}; +use tokio::runtime::TaskExecutor; +use tokio::timer::{Interval, timeout::Error as TimeoutError}; +use tokio::net::{TcpListener, TcpStream}; use ethkey::{Public, KeyPair, Signature, Random, Generator}; use ethereum_types::{Address, H256}; use key_server_cluster::{Error, NodeId, SessionId, Requester, AclStorage, KeyStorage, KeyServerSet, NodeKeyPair}; @@ -136,8 +137,9 @@ pub struct ClusterConfiguration { pub acl_storage: Arc, /// Administrator public key. pub admin_public: Option, - /// Should key servers set change session should be started when servers set changes. - /// This will only work when servers set is configured using KeyServerSet contract. + /// Should key servers set change session when servers set changes? This + /// will only work when servers set is configured using KeyServerSet + /// contract. pub auto_migrate_enabled: bool, } @@ -149,8 +151,6 @@ pub struct ClusterState { /// Network cluster implementation. pub struct ClusterCore { - /// Handle to the event loop. - handle: Handle, /// Listen address. listen_address: SocketAddr, /// Cluster data. @@ -165,7 +165,7 @@ pub struct ClusterClientImpl { /// Network cluster view. It is a communication channel, required in single session. pub struct ClusterView { - core: Arc>, + core: Arc>, configured_nodes_count: usize, connected_nodes_count: usize, } @@ -175,15 +175,15 @@ pub struct ClusterData { /// Cluster configuration. pub config: ClusterConfiguration, /// Handle to the event loop. - pub handle: Remote, - /// Handle to the cpu thread pool. - pub pool: CpuPool, + pub executor: TaskExecutor, /// KeyPair this node holds. pub self_key_pair: Arc, /// Connections data. pub connections: ClusterConnections, /// Active sessions data. pub sessions: ClusterSessions, + /// Shutdown flag: + pub is_shutdown: Arc, } /// Connections that are forming the cluster. Lock order: trigger.lock() -> data.lock(). @@ -231,19 +231,18 @@ pub struct Connection { /// Connection key. key: KeyPair, /// Last message time. - last_message_time: Mutex, + last_message_time: RwLock, } impl ClusterCore { - pub fn new(handle: Handle, config: ClusterConfiguration) -> Result, Error> { + pub fn new(executor: TaskExecutor, config: ClusterConfiguration) -> Result, Error> { let listen_address = make_socket_address(&config.listen_address.0, config.listen_address.1)?; let connections = ClusterConnections::new(&config)?; let servers_set_change_creator_connector = connections.connector.clone(); let sessions = ClusterSessions::new(&config, servers_set_change_creator_connector); - let data = ClusterData::new(&handle, config, connections, sessions); + let data = ClusterData::new(&executor, config, connections, sessions); Ok(Arc::new(ClusterCore { - handle: handle, listen_address: listen_address, data: data, })) @@ -272,7 +271,7 @@ impl ClusterCore { .and_then(|_| self.run_connections())?; // schedule maintain procedures - ClusterCore::schedule_maintain(&self.handle, self.data.clone()); + ClusterCore::schedule_maintain(self.data.clone()); Ok(()) } @@ -280,7 +279,7 @@ impl ClusterCore { /// Start listening for incoming connections. pub fn run_listener(&self) -> Result<(), Error> { // start listeining for incoming connections - self.handle.spawn(ClusterCore::listen(&self.handle, self.data.clone(), self.listen_address.clone())?); + self.data.spawn(ClusterCore::listen(self.data.clone(), self.listen_address.clone())?); Ok(()) } @@ -293,53 +292,49 @@ impl ClusterCore { /// Connect to peer. fn connect(data: Arc, node_address: SocketAddr) { - data.handle.clone().spawn(move |handle| { - data.pool.clone().spawn(ClusterCore::connect_future(handle, data, node_address)) - }) + data.clone().spawn(ClusterCore::connect_future(data, node_address)); } - /// Connect to socket using given context and handle. - fn connect_future(handle: &Handle, data: Arc, node_address: SocketAddr) -> BoxedEmptyFuture { + /// Connect to socket using given context and executor. + fn connect_future(data: Arc, node_address: SocketAddr) -> BoxedEmptyFuture { let disconnected_nodes = data.connections.disconnected_nodes().keys().cloned().collect(); - Box::new(net_connect(&node_address, handle, data.self_key_pair.clone(), disconnected_nodes) + Box::new(net_connect(&node_address, data.self_key_pair.clone(), disconnected_nodes) .then(move |result| ClusterCore::process_connection_result(data, Some(node_address), result)) - .then(|_| finished(()))) + .then(|_| future::ok(()))) } /// Start listening for incoming connections. - fn listen(handle: &Handle, data: Arc, listen_address: SocketAddr) -> Result { - Ok(Box::new(TcpListener::bind(&listen_address, &handle)? + fn listen(data: Arc, listen_address: SocketAddr) -> Result { + Ok(Box::new(TcpListener::bind(&listen_address)? .incoming() - .and_then(move |(stream, node_address)| { - ClusterCore::accept_connection(data.clone(), stream, node_address); + .and_then(move |stream| { + ClusterCore::accept_connection(data.clone(), stream); Ok(()) }) .for_each(|_| Ok(())) - .then(|_| finished(())))) + .then(|_| future::ok(())))) } /// Accept connection. - fn accept_connection(data: Arc, stream: TcpStream, node_address: SocketAddr) { - data.handle.clone().spawn(move |handle| { - data.pool.clone().spawn(ClusterCore::accept_connection_future(handle, data, stream, node_address)) - }) + fn accept_connection(data: Arc, stream: TcpStream) { + data.clone().spawn(ClusterCore::accept_connection_future(data, stream)) } /// Accept connection future. - fn accept_connection_future(handle: &Handle, data: Arc, stream: TcpStream, node_address: SocketAddr) -> BoxedEmptyFuture { - Box::new(net_accept_connection(node_address, stream, handle, data.self_key_pair.clone()) + fn accept_connection_future(data: Arc, stream: TcpStream) -> BoxedEmptyFuture { + Box::new(net_accept_connection(stream, data.self_key_pair.clone()) .then(move |result| ClusterCore::process_connection_result(data, None, result)) - .then(|_| finished(()))) + .then(|_| future::ok(()))) } /// Schedule mainatain procedures. - fn schedule_maintain(handle: &Handle, data: Arc) { + fn schedule_maintain(data: Arc) { let d = data.clone(); - let interval: BoxedEmptyFuture = Box::new(Interval::new(Duration::new(MAINTAIN_INTERVAL, 0), handle) - .expect("failed to create interval") + + let interval = Interval::new_interval(Duration::new(MAINTAIN_INTERVAL, 0)) .and_then(move |_| Ok(ClusterCore::maintain(data.clone()))) .for_each(|_| Ok(())) - .then(|_| finished(()))); + .then(|_| future::ok(())); d.spawn(interval); } @@ -362,20 +357,20 @@ impl ClusterCore { Ok((_, Ok(message))) => { ClusterCore::process_connection_message(data.clone(), connection.clone(), message); // continue serving connection - data.spawn(ClusterCore::process_connection_messages(data.clone(), connection)); - Box::new(finished(Ok(()))) + data.spawn(ClusterCore::process_connection_messages(data.clone(), connection).then(|_| Ok(()))); + Box::new(future::ok(Ok(()))) }, Ok((_, Err(err))) => { warn!(target: "secretstore_net", "{}: protocol error '{}' when reading message from node {}", data.self_key_pair.public(), err, connection.node_id()); // continue serving connection - data.spawn(ClusterCore::process_connection_messages(data.clone(), connection)); - Box::new(finished(Err(err))) + data.spawn(ClusterCore::process_connection_messages(data.clone(), connection).then(|_| Ok(()))); + Box::new(future::ok(Err(err))) }, Err(err) => { warn!(target: "secretstore_net", "{}: network error '{}' when reading message from node {}", data.self_key_pair.public(), err, connection.node_id()); // close connection data.connections.remove(data.clone(), connection.node_id(), connection.is_inbound()); - Box::new(failed(err)) + Box::new(future::err(err)) }, } )) @@ -394,7 +389,7 @@ impl ClusterCore { data.sessions.on_connection_timeout(connection.node_id()); } else if last_message_diff > KEEP_ALIVE_SEND_INTERVAL { - data.spawn(connection.send_message(Message::Cluster(ClusterMessage::KeepAlive(message::KeepAlive {})))); + data.spawn(connection.send_message(Message::Cluster(ClusterMessage::KeepAlive(message::KeepAlive {}))).then(|_| Ok(()))); } } } @@ -415,33 +410,35 @@ impl ClusterCore { } /// Process connection future result. - fn process_connection_result(data: Arc, outbound_addr: Option, result: Result>, io::Error>) -> IoFuture> { + fn process_connection_result(data: Arc, outbound_addr: Option, + result: Result>, TimeoutError>) -> IoFuture> + { match result { Ok(DeadlineStatus::Meet(Ok(connection))) => { let connection = Connection::new(outbound_addr.is_none(), connection); if data.connections.insert(data.clone(), connection.clone()) { ClusterCore::process_connection_messages(data.clone(), connection) } else { - Box::new(finished(Ok(()))) + Box::new(future::ok(Ok(()))) } }, Ok(DeadlineStatus::Meet(Err(err))) => { warn!(target: "secretstore_net", "{}: protocol error '{}' when establishing {} connection{}", data.self_key_pair.public(), err, if outbound_addr.is_some() { "outbound" } else { "inbound" }, outbound_addr.map(|a| format!(" with {}", a)).unwrap_or_default()); - Box::new(finished(Ok(()))) + Box::new(future::ok(Ok(()))) }, Ok(DeadlineStatus::Timeout) => { warn!(target: "secretstore_net", "{}: timeout when establishing {} connection{}", data.self_key_pair.public(), if outbound_addr.is_some() { "outbound" } else { "inbound" }, outbound_addr.map(|a| format!(" with {}", a)).unwrap_or_default()); - Box::new(finished(Ok(()))) + Box::new(future::ok(Ok(()))) }, Err(err) => { warn!(target: "secretstore_net", "{}: network error '{}' when establishing {} connection{}", data.self_key_pair.public(), err, if outbound_addr.is_some() { "outbound" } else { "inbound" }, outbound_addr.map(|a| format!(" with {}", a)).unwrap_or_default()); - Box::new(finished(Ok(()))) + Box::new(future::ok(Ok(()))) }, } } @@ -595,7 +592,7 @@ impl ClusterCore { if !message.is_error_message() { let session_id = message.into_session_id().expect("session_id only fails for cluster messages; only session messages are passed to process_message; qed"); let session_nonce = message.session_nonce().expect("session_nonce only fails for cluster messages; only session messages are passed to process_message; qed"); - data.spawn(connection.send_message(SC::make_error_message(session_id, session_nonce, error))); + data.spawn(connection.send_message(SC::make_error_message(session_id, session_nonce, error)).then(|_| Ok(()))); } return None; }, @@ -648,13 +645,19 @@ impl ClusterCore { match message { ClusterMessage::KeepAlive(_) => data.spawn(connection.send_message(Message::Cluster(ClusterMessage::KeepAliveResponse(message::KeepAliveResponse { session_id: None, - })))), + }))).then(|_| Ok(()))), ClusterMessage::KeepAliveResponse(msg) => if let Some(session_id) = msg.session_id { data.sessions.on_session_keep_alive(connection.node_id(), session_id.into()); }, _ => warn!(target: "secretstore_net", "{}: received unexpected message {} from node {} at {}", data.self_key_pair.public(), message, connection.node_id(), connection.node_address()), } } + + /// Prevents new tasks from being spawned. + #[cfg(test)] + pub fn shutdown(&self) { + self.data.shutdown() + } } impl ClusterConnections { @@ -787,14 +790,14 @@ impl ClusterConnections { } impl ClusterData { - pub fn new(handle: &Handle, config: ClusterConfiguration, connections: ClusterConnections, sessions: ClusterSessions) -> Arc { + pub fn new(executor: &TaskExecutor, config: ClusterConfiguration, connections: ClusterConnections, sessions: ClusterSessions) -> Arc { Arc::new(ClusterData { - handle: handle.remote().clone(), - pool: CpuPool::new(config.threads), + executor: executor.clone(), self_key_pair: config.self_key_pair.clone(), connections: connections, sessions: sessions, config: config, + is_shutdown: Arc::new(AtomicBool::new(false)), }) } @@ -803,12 +806,28 @@ impl ClusterData { self.connections.get(node) } - /// Spawns a future using thread pool and schedules execution of it with event loop handle. - pub fn spawn(&self, f: F) where F: Future + Send + 'static, F::Item: Send + 'static, F::Error: Send + 'static { - let pool_work = self.pool.spawn(f); - self.handle.spawn(move |_handle| { - pool_work.then(|_| finished(())) - }) + /// Spawns a future on the runtime. + // + // TODO: Consider implementing a more graceful shutdown process using an + // `AtomicBool`, etc. which would prevent tasks from being spawned after a + // shutdown signal is given. (Recursive calls, in + // `process_connection_messages` for example, appear to continue + // indefinitely.) + pub fn spawn(&self, f: F) where F: Future + Send + 'static { + if self.is_shutdown.load(Ordering::Acquire) == false { + if let Err(err) = future::Executor::execute(&self.executor, Box::new(f)) { + error!("Secret store runtime unable to spawn task. Runtime is shutting down. ({:?})", err); + } + } else { + error!("Secret store runtime unable to spawn task. Shutdown has been started."); + } + } + + /// Sets the `is_shutdown` flag which prevents future tasks from being + /// spawned via `::spawn`. + #[cfg(test)] + pub fn shutdown(&self) { + self.is_shutdown.store(true, Ordering::Release); } } @@ -820,7 +839,7 @@ impl Connection { is_inbound: is_inbound, stream: connection.stream, key: connection.key, - last_message_time: Mutex::new(Instant::now()), + last_message_time: RwLock::new(Instant::now()), }) } @@ -833,11 +852,11 @@ impl Connection { } pub fn last_message_time(&self) -> Instant { - *self.last_message_time.lock() + *self.last_message_time.read() } pub fn set_last_message_time(&self, last_message_time: Instant) { - *self.last_message_time.lock() = last_message_time; + *self.last_message_time.write() = last_message_time; } pub fn node_address(&self) -> &SocketAddr { @@ -858,7 +877,7 @@ impl ClusterView { ClusterView { configured_nodes_count: configured_nodes_count, connected_nodes_count: nodes.len(), - core: Arc::new(Mutex::new(ClusterViewCore { + core: Arc::new(RwLock::new(ClusterViewCore { cluster: cluster, nodes: nodes, })), @@ -868,29 +887,29 @@ impl ClusterView { impl Cluster for ClusterView { fn broadcast(&self, message: Message) -> Result<(), Error> { - let core = self.core.lock(); + let core = self.core.read(); for node in core.nodes.iter().filter(|n| *n != core.cluster.self_key_pair.public()) { trace!(target: "secretstore_net", "{}: sent message {} to {}", core.cluster.self_key_pair.public(), message, node); let connection = core.cluster.connection(node).ok_or(Error::NodeDisconnected)?; - core.cluster.spawn(connection.send_message(message.clone())) + core.cluster.spawn(connection.send_message(message.clone()).then(|_| Ok(()))) } Ok(()) } fn send(&self, to: &NodeId, message: Message) -> Result<(), Error> { - let core = self.core.lock(); + let core = self.core.read(); trace!(target: "secretstore_net", "{}: sent message {} to {}", core.cluster.self_key_pair.public(), message, to); let connection = core.cluster.connection(to).ok_or(Error::NodeDisconnected)?; - core.cluster.spawn(connection.send_message(message)); + core.cluster.spawn(connection.send_message(message).then(|_| Ok(()))); Ok(()) } fn is_connected(&self, node: &NodeId) -> bool { - self.core.lock().nodes.contains(node) + self.core.read().nodes.contains(node) } fn nodes(&self) -> BTreeSet { - self.core.lock().nodes.clone() + self.core.read().nodes.clone() } fn configured_nodes_count(&self) -> usize { @@ -1118,8 +1137,11 @@ pub mod tests { use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::{Duration, Instant}; use std::collections::{BTreeSet, VecDeque}; - use parking_lot::Mutex; - use tokio_core::reactor::Core; + use parking_lot::RwLock; + use tokio::{ + runtime::{Runtime, Builder as RuntimeBuilder}, + prelude::{future, Future}, + }; use ethereum_types::{Address, H256}; use ethkey::{Random, Generator, Public, Signature, sign}; use key_server_cluster::{NodeId, SessionId, Requester, Error, DummyAclStorage, DummyKeyStorage, @@ -1135,7 +1157,7 @@ pub mod tests { use key_server_cluster::key_version_negotiation_session::{SessionImpl as KeyVersionNegotiationSession, IsolatedSessionTransport as KeyVersionNegotiationSessionTransport}; - const TIMEOUT: Duration = Duration::from_millis(300); + const TIMEOUT: Duration = Duration::from_millis(1000); #[derive(Default)] pub struct DummyClusterClient { @@ -1145,7 +1167,7 @@ pub mod tests { #[derive(Debug)] pub struct DummyCluster { id: NodeId, - data: Mutex, + data: RwLock, } #[derive(Debug, Default)] @@ -1182,7 +1204,7 @@ pub mod tests { pub fn new(id: NodeId) -> Self { DummyCluster { id: id, - data: Mutex::new(DummyClusterData::default()) + data: RwLock::new(DummyClusterData::default()) } } @@ -1191,25 +1213,25 @@ pub mod tests { } pub fn add_node(&self, node: NodeId) { - self.data.lock().nodes.insert(node); + self.data.write().nodes.insert(node); } pub fn add_nodes>(&self, nodes: I) { - self.data.lock().nodes.extend(nodes) + self.data.write().nodes.extend(nodes) } pub fn remove_node(&self, node: &NodeId) { - self.data.lock().nodes.remove(node); + self.data.write().nodes.remove(node); } pub fn take_message(&self) -> Option<(NodeId, Message)> { - self.data.lock().messages.pop_front() + self.data.write().messages.pop_front() } } impl Cluster for DummyCluster { fn broadcast(&self, message: Message) -> Result<(), Error> { - let mut data = self.data.lock(); + let mut data = self.data.write(); let all_nodes: Vec<_> = data.nodes.iter().cloned().filter(|n| n != &self.id).collect(); for node in all_nodes { data.messages.push_back((node, message.clone())); @@ -1219,40 +1241,49 @@ pub mod tests { fn send(&self, to: &NodeId, message: Message) -> Result<(), Error> { debug_assert!(&self.id != to); - self.data.lock().messages.push_back((to.clone(), message)); + self.data.write().messages.push_back((to.clone(), message)); Ok(()) } fn is_connected(&self, node: &NodeId) -> bool { - let data = self.data.lock(); + let data = self.data.read(); &self.id == node || data.nodes.contains(node) } fn nodes(&self) -> BTreeSet { - self.data.lock().nodes.iter().cloned().collect() + self.data.read().nodes.iter().cloned().collect() } fn configured_nodes_count(&self) -> usize { - self.data.lock().nodes.len() + self.data.read().nodes.len() } fn connected_nodes_count(&self) -> usize { - self.data.lock().nodes.len() + self.data.read().nodes.len() } } - pub fn loop_until(core: &mut Core, timeout: Duration, predicate: F) where F: Fn() -> bool { - let start = Instant::now(); - loop { - core.turn(Some(Duration::from_millis(1))); - if predicate() { - break; - } + /// Loops until `predicate` returns `true` or `timeout` has elapsed. + pub fn loop_until(runtime: &mut Runtime, timeout: Duration, predicate: F) + where F: Send + 'static + Fn() -> bool + { + use futures::Stream; + use tokio::timer::Interval; - if Instant::now() - start > timeout { - panic!("no result in {:?}", timeout); - } - } + let start = Instant::now(); + + runtime.block_on(Interval::new_interval(Duration::from_millis(1)) + .and_then(move |_| { + if Instant::now() - start > timeout { + panic!("no result in {:?}", timeout); + } + + Ok(()) + }) + .take_while(move |_| future::ok(!predicate())) + .for_each(|_| Ok(())) + .then(|_| future::ok::<(), ()>(())) + ).unwrap(); } pub fn all_connections_established(cluster: &Arc) -> bool { @@ -1261,7 +1292,7 @@ pub mod tests { .all(|p| cluster.connection(p).is_some()) } - pub fn make_clusters(core: &Core, ports_begin: u16, num_nodes: usize) -> Vec> { + pub fn make_clusters(runtime: &Runtime, ports_begin: u16, num_nodes: usize) -> Vec> { let key_pairs: Vec<_> = (0..num_nodes).map(|_| Random.generate().unwrap()).collect(); let cluster_params: Vec<_> = (0..num_nodes).map(|i| ClusterConfiguration { threads: 1, @@ -1277,7 +1308,7 @@ pub mod tests { auto_migrate_enabled: false, }).collect(); let clusters: Vec<_> = cluster_params.into_iter().enumerate() - .map(|(_, params)| ClusterCore::new(core.handle(), params).unwrap()) + .map(|(_, params)| ClusterCore::new(runtime.executor(), params).unwrap()) .collect(); clusters @@ -1292,97 +1323,134 @@ pub mod tests { } } + pub fn shutdown_clusters(clusters: &[Arc]) { + for cluster in clusters { + cluster.shutdown() + } + } + + /// Returns a new runtime with a static number of threads. + pub fn new_runtime() -> Runtime { + RuntimeBuilder::new() + .core_threads(4) + .build() + .expect("Unable to create tokio runtime") + } + #[test] fn cluster_connects_to_other_nodes() { - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6010, 3); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6010, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } #[test] fn cluster_wont_start_generation_session_if_not_fully_connected() { - let core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6013, 3); + let runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6013, 3); clusters[0].run().unwrap(); match clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1) { Err(Error::NodeDisconnected) => (), Err(e) => panic!("unexpected error {:?}", e), _ => panic!("unexpected success"), } + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } #[test] fn error_in_generation_session_broadcasted_to_all_other_nodes() { //::logger::init_log(); - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6016, 3); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6016, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // ask one of nodes to produce faulty generation sessions clusters[1].client().make_faulty_generation_sessions(); // start && wait for generation session to fail let session = clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1).unwrap(); - loop_until(&mut core, TIMEOUT, || session.joint_public_and_secret().is_some() - && clusters[0].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || session_clone.joint_public_and_secret().is_some() + && clusters_clone[0].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_err()); // check that faulty session is either removed from all nodes, or nonexistent (already removed) for i in 1..3 { if let Some(session) = clusters[i].client().generation_session(&SessionId::default()) { + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); // wait for both session completion && session removal (session completion event is fired // before session is removed from its own container by cluster) - loop_until(&mut core, TIMEOUT, || session.joint_public_and_secret().is_some() - && clusters[i].client().generation_session(&SessionId::default()).is_none()); + loop_until(&mut runtime, TIMEOUT, move || session_clone.joint_public_and_secret().is_some() + && clusters_clone[i].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_err()); } } + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } #[test] fn generation_session_completion_signalled_if_failed_on_master() { //::logger::init_log(); - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6025, 3); + let mut runtime = new_runtime(); + + let clusters = make_clusters(&runtime, 6025, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // ask one of nodes to produce faulty generation sessions clusters[0].client().make_faulty_generation_sessions(); // start && wait for generation session to fail let session = clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1).unwrap(); - loop_until(&mut core, TIMEOUT, || session.joint_public_and_secret().is_some() - && clusters[0].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || session_clone.joint_public_and_secret().is_some() + && clusters_clone[0].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_err()); // check that faulty session is either removed from all nodes, or nonexistent (already removed) for i in 1..3 { if let Some(session) = clusters[i].client().generation_session(&SessionId::default()) { + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); // wait for both session completion && session removal (session completion event is fired // before session is removed from its own container by cluster) - loop_until(&mut core, TIMEOUT, || session.joint_public_and_secret().is_some() - && clusters[i].client().generation_session(&SessionId::default()).is_none()); + loop_until(&mut runtime, TIMEOUT, move || session_clone.joint_public_and_secret().is_some() + && clusters_clone[i].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_err()); } } + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } #[test] fn generation_session_is_removed_when_succeeded() { //::logger::init_log(); - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6019, 3); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6019, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // start && wait for generation session to complete let session = clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1).unwrap(); - loop_until(&mut core, TIMEOUT, || (session.state() == GenerationSessionState::Finished - || session.state() == GenerationSessionState::Failed) - && clusters[0].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || (session_clone.state() == GenerationSessionState::Finished + || session_clone.state() == GenerationSessionState::Failed) + && clusters_clone[0].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_ok()); // check that on non-master nodes session is either: @@ -1392,19 +1460,24 @@ pub mod tests { if let Some(session) = clusters[i].client().generation_session(&SessionId::default()) { // run to completion if completion message is still on the way // AND check that it is actually removed from cluster sessions - loop_until(&mut core, TIMEOUT, || (session.state() == GenerationSessionState::Finished - || session.state() == GenerationSessionState::Failed) - && clusters[i].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || (session_clone.state() == GenerationSessionState::Finished + || session_clone.state() == GenerationSessionState::Failed) + && clusters_clone[i].client().generation_session(&SessionId::default()).is_none()); } } + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } #[test] fn sessions_are_removed_when_initialization_fails() { - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6022, 3); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6022, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // generation session { @@ -1432,6 +1505,8 @@ pub mod tests { assert!(clusters[0].data.sessions.decryption_sessions.is_empty()); assert!(clusters[0].data.sessions.negotiation_sessions.is_empty()); } + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } // test ignored because of @@ -1441,16 +1516,19 @@ pub mod tests { #[ignore] fn schnorr_signing_session_completes_if_node_does_not_have_a_share() { //::logger::init_log(); - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6028, 3); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6028, 3); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // start && wait for generation session to complete let session = clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1).unwrap(); - loop_until(&mut core, TIMEOUT, || (session.state() == GenerationSessionState::Finished - || session.state() == GenerationSessionState::Failed) - && clusters[0].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || (session_clone.state() == GenerationSessionState::Finished + || session_clone.state() == GenerationSessionState::Failed) + && clusters_clone[0].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_ok()); // now remove share from node2 @@ -1462,8 +1540,10 @@ pub mod tests { let session0 = clusters[0].client().new_schnorr_signing_session(Default::default(), signature.into(), None, Default::default()).unwrap(); let session = clusters[0].data.sessions.schnorr_signing_sessions.first().unwrap(); - loop_until(&mut core, TIMEOUT, || session.is_finished() && (0..3).all(|i| - clusters[i].data.sessions.schnorr_signing_sessions.is_empty())); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || session_clone.is_finished() && (0..3).all(|i| + clusters_clone[i].data.sessions.schnorr_signing_sessions.is_empty())); session0.wait().unwrap(); // and try to sign message with generated key using node that has no key share @@ -1471,8 +1551,10 @@ pub mod tests { let session2 = clusters[2].client().new_schnorr_signing_session(Default::default(), signature.into(), None, Default::default()).unwrap(); let session = clusters[2].data.sessions.schnorr_signing_sessions.first().unwrap(); - loop_until(&mut core, TIMEOUT, || session.is_finished() && (0..3).all(|i| - clusters[i].data.sessions.schnorr_signing_sessions.is_empty())); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || session_clone.is_finished() && (0..3).all(|i| + clusters_clone[i].data.sessions.schnorr_signing_sessions.is_empty())); session2.wait().unwrap(); // now remove share from node1 @@ -1483,8 +1565,11 @@ pub mod tests { let session1 = clusters[0].client().new_schnorr_signing_session(Default::default(), signature.into(), None, Default::default()).unwrap(); let session = clusters[0].data.sessions.schnorr_signing_sessions.first().unwrap(); - loop_until(&mut core, TIMEOUT, || session.is_finished()); + let session = session.clone(); + loop_until(&mut runtime, TIMEOUT, move || session.is_finished()); session1.wait().unwrap_err(); + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } // test ignored because of @@ -1494,16 +1579,19 @@ pub mod tests { #[ignore] fn ecdsa_signing_session_completes_if_node_does_not_have_a_share() { //::logger::init_log(); - let mut core = Core::new().unwrap(); - let clusters = make_clusters(&core, 6041, 4); + let mut runtime = new_runtime(); + let clusters = make_clusters(&runtime, 6041, 4); run_clusters(&clusters); - loop_until(&mut core, TIMEOUT, || clusters.iter().all(all_connections_established)); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || clusters_clone.iter().all(all_connections_established)); // start && wait for generation session to complete let session = clusters[0].client().new_generation_session(SessionId::default(), Default::default(), Default::default(), 1).unwrap(); - loop_until(&mut core, TIMEOUT, || (session.state() == GenerationSessionState::Finished - || session.state() == GenerationSessionState::Failed) - && clusters[0].client().generation_session(&SessionId::default()).is_none()); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, TIMEOUT, move || (session_clone.state() == GenerationSessionState::Finished + || session_clone.state() == GenerationSessionState::Failed) + && clusters_clone[0].client().generation_session(&SessionId::default()).is_none()); assert!(session.joint_public_and_secret().unwrap().is_ok()); // now remove share from node2 @@ -1515,16 +1603,20 @@ pub mod tests { let session0 = clusters[0].client().new_ecdsa_signing_session(Default::default(), signature.into(), None, H256::random()).unwrap(); let session = clusters[0].data.sessions.ecdsa_signing_sessions.first().unwrap(); - loop_until(&mut core, Duration::from_millis(1000), || session.is_finished() && (0..3).all(|i| - clusters[i].data.sessions.ecdsa_signing_sessions.is_empty())); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, Duration::from_millis(1000), move || session_clone.is_finished() && (0..3).all(|i| + clusters_clone[i].data.sessions.ecdsa_signing_sessions.is_empty())); session0.wait().unwrap(); // and try to sign message with generated key using node that has no key share let signature = sign(Random.generate().unwrap().secret(), &Default::default()).unwrap(); let session2 = clusters[2].client().new_ecdsa_signing_session(Default::default(), signature.into(), None, H256::random()).unwrap(); let session = clusters[2].data.sessions.ecdsa_signing_sessions.first().unwrap(); - loop_until(&mut core, Duration::from_millis(1000), || session.is_finished() && (0..3).all(|i| - clusters[i].data.sessions.ecdsa_signing_sessions.is_empty())); + let session_clone = session.clone(); + let clusters_clone = clusters.clone(); + loop_until(&mut runtime, Duration::from_millis(1000), move || session_clone.is_finished() && (0..3).all(|i| + clusters_clone[i].data.sessions.ecdsa_signing_sessions.is_empty())); session2.wait().unwrap(); // now remove share from node1 @@ -1534,7 +1626,9 @@ pub mod tests { let signature = sign(Random.generate().unwrap().secret(), &Default::default()).unwrap(); let session1 = clusters[0].client().new_ecdsa_signing_session(Default::default(), signature.into(), None, H256::random()).unwrap(); let session = clusters[0].data.sessions.ecdsa_signing_sessions.first().unwrap(); - loop_until(&mut core, Duration::from_millis(1000), || session.is_finished()); + loop_until(&mut runtime, Duration::from_millis(1000), move || session.is_finished()); session1.wait().unwrap_err(); + shutdown_clusters(&clusters); + runtime.shutdown_now().wait().unwrap(); } } diff --git a/secret_store/src/key_server_cluster/io/deadline.rs b/secret_store/src/key_server_cluster/io/deadline.rs index 94a189522..f3b660cbf 100644 --- a/secret_store/src/key_server_cluster/io/deadline.rs +++ b/secret_store/src/key_server_cluster/io/deadline.rs @@ -16,18 +16,34 @@ use std::io; use std::time::Duration; -use futures::{Future, Select, Poll, Async}; -use tokio_core::reactor::{Handle, Timeout}; +use futures::{Future, Poll}; +use tokio::timer::timeout::{Timeout, Error as TimeoutError}; -type DeadlineBox = Box::Item>, Error = ::Error> + Send>; +type DeadlineBox = Box::Item>, + Error = TimeoutError<::Error> +> + Send>; /// Complete a passed future or fail if it is not completed within timeout. -pub fn deadline(duration: Duration, handle: &Handle, future: F) -> Result, io::Error> - where F: Future + Send + 'static, T: 'static { - let timeout: DeadlineBox = Box::new(Timeout::new(duration, handle)?.map(|_| DeadlineStatus::Timeout)); - let future: DeadlineBox = Box::new(future.map(DeadlineStatus::Meet)); +pub fn deadline(duration: Duration, future: F) -> Result, io::Error> + where F: Future + Send + 'static, T: Send + 'static +{ + let timeout = Box::new(Timeout::new(future, duration) + .then(|res| { + match res { + Ok(fut) => Ok(DeadlineStatus::Meet(fut)), + Err(err) => { + if err.is_elapsed() { + Ok(DeadlineStatus::Timeout) + } else { + Err(err) + } + }, + } + }) + ); let deadline = Deadline { - future: timeout.select(future), + future: timeout, }; Ok(deadline) } @@ -43,19 +59,15 @@ pub enum DeadlineStatus { /// Future, which waits for passed future completion within given period, or fails with timeout. pub struct Deadline where F: Future { - future: Select, DeadlineBox>, + future: DeadlineBox, } impl Future for Deadline where F: Future { type Item = DeadlineStatus; - type Error = io::Error; + type Error = TimeoutError; fn poll(&mut self) -> Poll { - match self.future.poll() { - Ok(Async::Ready((result, _other))) => Ok(Async::Ready(result)), - Ok(Async::NotReady) => Ok(Async::NotReady), - Err((err, _other)) => Err(err), - } + self.future.poll() } } @@ -63,14 +75,14 @@ impl Future for Deadline where F: Future { mod tests { use std::time::Duration; use futures::{Future, done}; - use tokio_core::reactor::Core; + use tokio::reactor::Reactor; use super::{deadline, DeadlineStatus}; #[test] fn deadline_result_works() { - let mut core = Core::new().unwrap(); - let deadline = deadline(Duration::from_millis(1000), &core.handle(), done(Ok(()))).unwrap(); - core.turn(Some(Duration::from_millis(3))); + let mut reactor = Reactor::new().unwrap(); + let deadline = deadline(Duration::from_millis(1000), done(Ok(()))).unwrap(); + reactor.turn(Some(Duration::from_millis(3))).unwrap(); assert_eq!(deadline.wait().unwrap(), DeadlineStatus::Meet(())); } } diff --git a/secret_store/src/key_server_cluster/io/shared_tcp_stream.rs b/secret_store/src/key_server_cluster/io/shared_tcp_stream.rs index 64afbbe82..fb8abb47d 100644 --- a/secret_store/src/key_server_cluster/io/shared_tcp_stream.rs +++ b/secret_store/src/key_server_cluster/io/shared_tcp_stream.rs @@ -19,7 +19,7 @@ use std::net::Shutdown; use std::io::{Read, Write, Error}; use futures::Poll; use tokio_io::{AsyncRead, AsyncWrite}; -use tokio_core::net::TcpStream; +use tokio::net::TcpStream; /// Read+Write implementation for Arc. pub struct SharedTcpStream { diff --git a/secret_store/src/key_server_cluster/net/accept_connection.rs b/secret_store/src/key_server_cluster/net/accept_connection.rs index 3565ea3d0..3dfb4bdb4 100644 --- a/secret_store/src/key_server_cluster/net/accept_connection.rs +++ b/secret_store/src/key_server_cluster/net/accept_connection.rs @@ -19,20 +19,23 @@ use std::sync::Arc; use std::net::SocketAddr; use std::time::Duration; use futures::{Future, Poll}; -use tokio_core::reactor::Handle; -use tokio_core::net::TcpStream; +use tokio::net::TcpStream; use key_server_cluster::{Error, NodeKeyPair}; use key_server_cluster::io::{accept_handshake, Handshake, Deadline, deadline}; use key_server_cluster::net::Connection; /// Create future for accepting incoming connection. -pub fn accept_connection(address: SocketAddr, stream: TcpStream, handle: &Handle, self_key_pair: Arc) -> Deadline { +pub fn accept_connection(stream: TcpStream, self_key_pair: Arc) -> Deadline { + // TODO: This could fail so it would be better either to accept the + // address as a separate argument or return a result. + let address = stream.peer_addr().expect("Unable to determine tcp peer address"); + let accept = AcceptConnection { handshake: accept_handshake(stream, self_key_pair), address: address, }; - deadline(Duration::new(5, 0), handle, accept).expect("Failed to create timeout") + deadline(Duration::new(5, 0), accept).expect("Failed to create timeout") } /// Future for accepting incoming connection. diff --git a/secret_store/src/key_server_cluster/net/connect.rs b/secret_store/src/key_server_cluster/net/connect.rs index 8b93479f9..438ce9e12 100644 --- a/secret_store/src/key_server_cluster/net/connect.rs +++ b/secret_store/src/key_server_cluster/net/connect.rs @@ -20,26 +20,25 @@ use std::io; use std::time::Duration; use std::net::SocketAddr; use futures::{Future, Poll, Async}; -use tokio_core::reactor::Handle; -use tokio_core::net::{TcpStream, TcpStreamNew}; +use tokio::net::{TcpStream, tcp::ConnectFuture}; use key_server_cluster::{Error, NodeId, NodeKeyPair}; use key_server_cluster::io::{handshake, Handshake, Deadline, deadline}; use key_server_cluster::net::Connection; /// Create future for connecting to other node. -pub fn connect(address: &SocketAddr, handle: &Handle, self_key_pair: Arc, trusted_nodes: BTreeSet) -> Deadline { +pub fn connect(address: &SocketAddr, self_key_pair: Arc, trusted_nodes: BTreeSet) -> Deadline { let connect = Connect { - state: ConnectState::TcpConnect(TcpStream::connect(address, handle)), + state: ConnectState::TcpConnect(TcpStream::connect(address)), address: address.clone(), self_key_pair: self_key_pair, trusted_nodes: trusted_nodes, }; - deadline(Duration::new(5, 0), handle, connect).expect("Failed to create timeout") + deadline(Duration::new(5, 0), connect).expect("Failed to create timeout") } enum ConnectState { - TcpConnect(TcpStreamNew), + TcpConnect(ConnectFuture), Handshake(Handshake), Connected, } diff --git a/secret_store/src/lib.rs b/secret_store/src/lib.rs index b58534b3e..ddd8f6d44 100644 --- a/secret_store/src/lib.rs +++ b/secret_store/src/lib.rs @@ -24,7 +24,6 @@ extern crate ethcore_sync as sync; extern crate ethcore_transaction as transaction; extern crate ethereum_types; extern crate ethkey; -extern crate futures_cpupool; extern crate hyper; extern crate keccak_hash as hash; extern crate kvdb; @@ -34,9 +33,7 @@ extern crate serde; extern crate serde_json; extern crate tiny_keccak; extern crate tokio; -extern crate tokio_core; extern crate tokio_io; -extern crate tokio_proto; extern crate tokio_service; extern crate url; diff --git a/secret_store/src/listener/http_listener.rs b/secret_store/src/listener/http_listener.rs index 5aa82a1cb..9877a4241 100644 --- a/secret_store/src/listener/http_listener.rs +++ b/secret_store/src/listener/http_listener.rs @@ -16,14 +16,17 @@ use std::collections::BTreeSet; use std::sync::{Arc, Weak}; -use hyper::{self, header, Chunk, Uri, Request as HttpRequest, Response as HttpResponse, Method as HttpMethod, StatusCode as HttpStatusCode}; -use hyper::server::Http; +use hyper::{self, Uri, Request as HttpRequest, Response as HttpResponse, Method as HttpMethod, + StatusCode as HttpStatusCode, Body, + header::{self, HeaderValue}, + server::conn::Http, + service::Service, +}; use serde::Serialize; use serde_json; use tokio; use tokio::net::TcpListener; -use tokio::runtime::Runtime; -use tokio_service::Service; +use tokio::runtime::{Runtime, Builder as RuntimeBuilder}; use futures::{future, Future, Stream}; use url::percent_encoding::percent_decode; @@ -88,7 +91,10 @@ impl KeyServerHttpListener { key_server: key_server, }); - let mut runtime = Runtime::new()?; + let mut runtime = RuntimeBuilder::new() + // TODO: Add config option/arg? + .core_threads(2) + .build()?; let listener_address = format!("{}:{}", listener_address.address, listener_address.port).parse()?; let listener = TcpListener::bind(&listener_address)?; @@ -97,10 +103,10 @@ impl KeyServerHttpListener { let server = listener.incoming() .map_err(|e| warn!("Key server listener error: {:?}", e)) .for_each(move |socket| { - let http: Http = Http::new(); - let serve = http.serve_connection(socket, KeyServerHttpHandler { - handler: shared_handler2.clone(), - }).map(|_| ()).map_err(|e| { + let http = Http::new(); + let serve = http.serve_connection(socket, + KeyServerHttpHandler { handler: shared_handler2.clone() } + ).map(|_| ()).map_err(|e| { warn!("Key server handler error: {:?}", e); }); @@ -119,7 +125,7 @@ impl KeyServerHttpListener { } impl KeyServerHttpHandler { - fn process(self, req_method: HttpMethod, req_uri: Uri, path: &str, req_body: &[u8]) -> HttpResponse { + fn process(self, req_method: HttpMethod, req_uri: Uri, path: &str, req_body: &[u8]) -> HttpResponse { match parse_request(&req_method, &path, &req_body) { Request::GenerateServerKey(document, signature, threshold) => { return_server_public_key(&req_uri, self.handler.key_server.upgrade() @@ -195,22 +201,28 @@ impl KeyServerHttpHandler { }, Request::Invalid => { warn!(target: "secretstore", "Ignoring invalid {}-request {}", req_method, req_uri); - HttpResponse::new().with_status(HttpStatusCode::BadRequest) + HttpResponse::builder() + .status(HttpStatusCode::BAD_REQUEST) + .body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed") }, } } } impl Service for KeyServerHttpHandler { - type Request = HttpRequest; - type Response = HttpResponse; + type ReqBody = Body; + type ResBody = Body; type Error = hyper::Error; - type Future = Box + Send>; + type Future = Box, Error=Self::Error> + Send>; - fn call(&self, req: HttpRequest) -> Self::Future { - if req.headers().has::() { + fn call(&mut self, req: HttpRequest) -> Self::Future { + if req.headers().contains_key(header::ORIGIN) { warn!(target: "secretstore", "Ignoring {}-request {} with Origin header", req.method(), req.uri()); - return Box::new(future::ok(HttpResponse::new().with_status(HttpStatusCode::NotFound))); + return Box::new(future::ok(HttpResponse::builder() + .status(HttpStatusCode::NOT_FOUND) + .body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed"))) } let req_method = req.method().clone(); @@ -218,35 +230,40 @@ impl Service for KeyServerHttpHandler { // We cannot consume Self because of the Service trait requirement. let this = self.clone(); - Box::new(req.body().concat2().map(move |body| { + Box::new(req.into_body().concat2().map(move |body| { let path = req_uri.path().to_string(); if path.starts_with("/") { this.process(req_method, req_uri, &path, &body) } else { warn!(target: "secretstore", "Ignoring invalid {}-request {}", req_method, req_uri); - HttpResponse::new().with_status(HttpStatusCode::NotFound) + HttpResponse::builder() + .status(HttpStatusCode::NOT_FOUND) + .body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed") } })) } } -fn return_empty(req_uri: &Uri, empty: Result<(), Error>) -> HttpResponse { +fn return_empty(req_uri: &Uri, empty: Result<(), Error>) -> HttpResponse { return_bytes::(req_uri, empty.map(|_| None)) } -fn return_server_public_key(req_uri: &Uri, server_public: Result) -> HttpResponse { +fn return_server_public_key(req_uri: &Uri, server_public: Result) -> HttpResponse { return_bytes(req_uri, server_public.map(|k| Some(SerializablePublic(k)))) } -fn return_message_signature(req_uri: &Uri, signature: Result) -> HttpResponse { +fn return_message_signature(req_uri: &Uri, signature: Result) -> HttpResponse { return_bytes(req_uri, signature.map(|s| Some(SerializableBytes(s)))) } -fn return_document_key(req_uri: &Uri, document_key: Result) -> HttpResponse { +fn return_document_key(req_uri: &Uri, document_key: Result) -> HttpResponse { return_bytes(req_uri, document_key.map(|k| Some(SerializableBytes(k)))) } -fn return_document_key_shadow(req_uri: &Uri, document_key_shadow: Result) -> HttpResponse { +fn return_document_key_shadow(req_uri: &Uri, document_key_shadow: Result) + -> HttpResponse +{ return_bytes(req_uri, document_key_shadow.map(|k| Some(SerializableEncryptedDocumentKeyShadow { decrypted_secret: k.decrypted_secret.into(), common_point: k.common_point.expect("always filled when requesting document_key_shadow; qed").into(), @@ -254,42 +271,65 @@ fn return_document_key_shadow(req_uri: &Uri, document_key_shadow: Result(req_uri: &Uri, result: Result, Error>) -> HttpResponse { +fn return_bytes(req_uri: &Uri, result: Result, Error>) -> HttpResponse { match result { Ok(Some(result)) => match serde_json::to_vec(&result) { - Ok(result) => HttpResponse::new() - .with_header(header::ContentType::json()) - .with_body(result), + Ok(result) => { + let body: Body = result.into(); + HttpResponse::builder() + .header(header::CONTENT_TYPE, HeaderValue::from_static("application/json; charset=utf-8")) + .body(body) + .expect("Error creating http response") + }, Err(err) => { warn!(target: "secretstore", "response to request {} has failed with: {}", req_uri, err); - HttpResponse::new().with_status(HttpStatusCode::InternalServerError) + HttpResponse::builder() + .status(HttpStatusCode::INTERNAL_SERVER_ERROR) + .body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed") } }, - Ok(None) => HttpResponse::new().with_status(HttpStatusCode::Ok), + Ok(None) => { + HttpResponse::builder() + .status(HttpStatusCode::OK) + .body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed") + }, Err(err) => return_error(err), } } -fn return_error(err: Error) -> HttpResponse { - let mut res = HttpResponse::new().with_status(match err { - Error::AccessDenied | Error::ConsensusUnreachable | Error::ConsensusTemporaryUnreachable => - HttpStatusCode::Forbidden, - Error::ServerKeyIsNotFound | Error::DocumentKeyIsNotFound => - HttpStatusCode::NotFound, - Error::InsufficientRequesterData(_) | Error::Hyper(_) | Error::Serde(_) - | Error::DocumentKeyAlreadyStored | Error::ServerKeyAlreadyGenerated => - HttpStatusCode::BadRequest, - _ => HttpStatusCode::InternalServerError, - }); +fn return_error(err: Error) -> HttpResponse { + let status = match err { + | Error::AccessDenied + | Error::ConsensusUnreachable + | Error::ConsensusTemporaryUnreachable => + HttpStatusCode::FORBIDDEN, + | Error::ServerKeyIsNotFound + | Error::DocumentKeyIsNotFound => + HttpStatusCode::NOT_FOUND, + | Error::InsufficientRequesterData(_) + | Error::Hyper(_) + | Error::Serde(_) + | Error::DocumentKeyAlreadyStored + | Error::ServerKeyAlreadyGenerated => + HttpStatusCode::BAD_REQUEST, + _ => HttpStatusCode::INTERNAL_SERVER_ERROR, + }; + + let mut res = HttpResponse::builder(); + res.status(status); // return error text. ignore errors when returning error let error_text = format!("\"{}\"", err); if let Ok(error_text) = serde_json::to_vec(&error_text) { - res.headers_mut().set(header::ContentType::json()); - res.set_body(error_text); + res.header(header::CONTENT_TYPE, HeaderValue::from_static("application/json; charset=utf-8")); + res.body(error_text.into()) + .expect("`error_text` is a formatted string, parsing cannot fail; qed") + } else { + res.body(Body::empty()) + .expect("Nothing to parse, cannot fail; qed") } - - res } fn parse_request(method: &HttpMethod, uri_path: &str, body: &[u8]) -> Request { @@ -328,19 +368,19 @@ fn parse_request(method: &HttpMethod, uri_path: &str, body: &[u8]) -> Request { let common_point = path.get(args_offset + 2).map(|v| v.parse()); let encrypted_key = path.get(args_offset + 3).map(|v| v.parse()); match (prefix, args_count, method, threshold, message_hash, common_point, encrypted_key) { - ("shadow", 3, &HttpMethod::Post, Some(Ok(threshold)), _, _, _) => + ("shadow", 3, &HttpMethod::POST, Some(Ok(threshold)), _, _, _) => Request::GenerateServerKey(document, signature, threshold), - ("shadow", 4, &HttpMethod::Post, _, _, Some(Ok(common_point)), Some(Ok(encrypted_key))) => + ("shadow", 4, &HttpMethod::POST, _, _, Some(Ok(common_point)), Some(Ok(encrypted_key))) => Request::StoreDocumentKey(document, signature, common_point, encrypted_key), - ("", 3, &HttpMethod::Post, Some(Ok(threshold)), _, _, _) => + ("", 3, &HttpMethod::POST, Some(Ok(threshold)), _, _, _) => Request::GenerateDocumentKey(document, signature, threshold), - ("", 2, &HttpMethod::Get, _, _, _, _) => + ("", 2, &HttpMethod::GET, _, _, _, _) => Request::GetDocumentKey(document, signature), - ("shadow", 2, &HttpMethod::Get, _, _, _, _) => + ("shadow", 2, &HttpMethod::GET, _, _, _, _) => Request::GetDocumentKeyShadow(document, signature), - ("schnorr", 3, &HttpMethod::Get, _, Some(Ok(message_hash)), _, _) => + ("schnorr", 3, &HttpMethod::GET, _, Some(Ok(message_hash)), _, _) => Request::SchnorrSignMessage(document, signature, message_hash), - ("ecdsa", 3, &HttpMethod::Get, _, Some(Ok(message_hash)), _, _) => + ("ecdsa", 3, &HttpMethod::GET, _, Some(Ok(message_hash)), _, _) => Request::EcdsaSignMessage(document, signature, message_hash), _ => Request::Invalid, } @@ -348,7 +388,7 @@ fn parse_request(method: &HttpMethod, uri_path: &str, body: &[u8]) -> Request { fn parse_admin_request(method: &HttpMethod, path: Vec, body: &[u8]) -> Request { let args_count = path.len(); - if *method != HttpMethod::Post || args_count != 4 || path[1] != "servers_set_change" { + if *method != HttpMethod::POST || args_count != 4 || path[1] != "servers_set_change" { return Request::Invalid; } @@ -392,39 +432,39 @@ mod tests { #[test] fn parse_request_successful() { // POST /shadow/{server_key_id}/{signature}/{threshold} => generate server key - assert_eq!(parse_request(&HttpMethod::Post, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), + assert_eq!(parse_request(&HttpMethod::POST, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), Request::GenerateServerKey("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), 2)); // POST /shadow/{server_key_id}/{signature}/{common_point}/{encrypted_key} => store encrypted document key - assert_eq!(parse_request(&HttpMethod::Post, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8/1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb", Default::default()), + assert_eq!(parse_request(&HttpMethod::POST, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8/1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb", Default::default()), Request::StoreDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "b486d3840218837b035c66196ecb15e6b067ca20101e11bd5e626288ab6806ecc70b8307012626bd512bad1559112d11d21025cef48cc7a1d2f3976da08f36c8".parse().unwrap(), "1395568277679f7f583ab7c0992da35f26cde57149ee70e524e49bdae62db3e18eb96122501e7cbb798b784395d7bb5a499edead0706638ad056d886e56cf8fb".parse().unwrap())); // POST /{server_key_id}/{signature}/{threshold} => generate server && document key - assert_eq!(parse_request(&HttpMethod::Post, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), + assert_eq!(parse_request(&HttpMethod::POST, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/2", Default::default()), Request::GenerateDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), 2)); // GET /{server_key_id}/{signature} => get document key - assert_eq!(parse_request(&HttpMethod::Get, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), + assert_eq!(parse_request(&HttpMethod::GET, "/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), Request::GetDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); - assert_eq!(parse_request(&HttpMethod::Get, "/%30000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), + assert_eq!(parse_request(&HttpMethod::GET, "/%30000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), Request::GetDocumentKey("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); // GET /shadow/{server_key_id}/{signature} => get document key shadow - assert_eq!(parse_request(&HttpMethod::Get, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), + assert_eq!(parse_request(&HttpMethod::GET, "/shadow/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", Default::default()), Request::GetDocumentKeyShadow("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap())); // GET /schnorr/{server_key_id}/{signature}/{message_hash} => schnorr-sign message with server key - assert_eq!(parse_request(&HttpMethod::Get, "/schnorr/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), + assert_eq!(parse_request(&HttpMethod::GET, "/schnorr/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), Request::SchnorrSignMessage("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse().unwrap())); // GET /ecdsa/{server_key_id}/{signature}/{message_hash} => ecdsa-sign message with server key - assert_eq!(parse_request(&HttpMethod::Get, "/ecdsa/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), + assert_eq!(parse_request(&HttpMethod::GET, "/ecdsa/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c", Default::default()), Request::EcdsaSignMessage("0000000000000000000000000000000000000000000000000000000000000001".into(), "a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01".parse().unwrap(), "281b6bf43cb86d0dc7b98e1b7def4a80f3ce16d28d2308f934f116767306f06c".parse().unwrap())); @@ -432,7 +472,7 @@ mod tests { let node1: Public = "843645726384530ffb0c52f175278143b5a93959af7864460f5a4fec9afd1450cfb8aef63dec90657f43f55b13e0a73c7524d4e9a13c051b4e5f1e53f39ecd91".parse().unwrap(); let node2: Public = "07230e34ebfe41337d3ed53b186b3861751f2401ee74b988bba55694e2a6f60c757677e194be2e53c3523cc8548694e636e6acb35c4e8fdc5e29d28679b9b2f3".parse().unwrap(); let nodes = vec![node1, node2].into_iter().collect(); - assert_eq!(parse_request(&HttpMethod::Post, "/admin/servers_set_change/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/b199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", + assert_eq!(parse_request(&HttpMethod::POST, "/admin/servers_set_change/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/b199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", &r#"["0x843645726384530ffb0c52f175278143b5a93959af7864460f5a4fec9afd1450cfb8aef63dec90657f43f55b13e0a73c7524d4e9a13c051b4e5f1e53f39ecd91", "0x07230e34ebfe41337d3ed53b186b3861751f2401ee74b988bba55694e2a6f60c757677e194be2e53c3523cc8548694e636e6acb35c4e8fdc5e29d28679b9b2f3"]"#.as_bytes()), Request::ChangeServersSet( @@ -444,20 +484,20 @@ mod tests { #[test] fn parse_request_failed() { - assert_eq!(parse_request(&HttpMethod::Get, "", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/shadow", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "///2", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/shadow///2", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/0000000000000000000000000000000000000000000000000000000000000001", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/0000000000000000000000000000000000000000000000000000000000000001/", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/a/b", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/schnorr/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/0000000000000000000000000000000000000000000000000000000000000002/0000000000000000000000000000000000000000000000000000000000000002", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Get, "/ecdsa/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/0000000000000000000000000000000000000000000000000000000000000002/0000000000000000000000000000000000000000000000000000000000000002", Default::default()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Post, "/admin/servers_set_change/xxx/yyy", + assert_eq!(parse_request(&HttpMethod::GET, "", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/shadow", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "///2", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/shadow///2", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/0000000000000000000000000000000000000000000000000000000000000001", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/0000000000000000000000000000000000000000000000000000000000000001/", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/a/b", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/schnorr/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/0000000000000000000000000000000000000000000000000000000000000002/0000000000000000000000000000000000000000000000000000000000000002", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::GET, "/ecdsa/0000000000000000000000000000000000000000000000000000000000000001/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/0000000000000000000000000000000000000000000000000000000000000002/0000000000000000000000000000000000000000000000000000000000000002", Default::default()), Request::Invalid); + assert_eq!(parse_request(&HttpMethod::POST, "/admin/servers_set_change/xxx/yyy", &r#"["0x843645726384530ffb0c52f175278143b5a93959af7864460f5a4fec9afd1450cfb8aef63dec90657f43f55b13e0a73c7524d4e9a13c051b4e5f1e53f39ecd91", "0x07230e34ebfe41337d3ed53b186b3861751f2401ee74b988bba55694e2a6f60c757677e194be2e53c3523cc8548694e636e6acb35c4e8fdc5e29d28679b9b2f3"]"#.as_bytes()), Request::Invalid); - assert_eq!(parse_request(&HttpMethod::Post, "/admin/servers_set_change/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", "".as_bytes()), + assert_eq!(parse_request(&HttpMethod::POST, "/admin/servers_set_change/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01/a199fb39e11eefb61c78a4074a53c0d4424600a3e74aad4fb9d93a26c30d067e1d4d29936de0c73f19827394a1dd049480a0d581aee7ae7546968da7d3d1c2fd01", "".as_bytes()), Request::Invalid); } } diff --git a/util/fake-fetch/Cargo.toml b/util/fake-fetch/Cargo.toml index 217d7f461..870da27c8 100644 --- a/util/fake-fetch/Cargo.toml +++ b/util/fake-fetch/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Parity Technologies "] [dependencies] fetch = { path = "../fetch" } futures = "0.1" -hyper = "0.11" +hyper = "0.12" diff --git a/util/fake-fetch/src/lib.rs b/util/fake-fetch/src/lib.rs index 9dbe05b9c..750656e78 100644 --- a/util/fake-fetch/src/lib.rs +++ b/util/fake-fetch/src/lib.rs @@ -18,7 +18,7 @@ extern crate fetch; extern crate hyper; extern crate futures; -use hyper::StatusCode; +use hyper::{StatusCode, Body}; use futures::{future, future::FutureResult}; use fetch::{Fetch, Url, Request}; @@ -39,10 +39,13 @@ impl Fetch for FakeFetch where T: Clone + Send+ Sync { fn fetch(&self, request: Request, abort: fetch::Abort) -> Self::Result { let u = request.url().clone(); future::ok(if self.val.is_some() { - let r = hyper::Response::new().with_body(&b"Some content"[..]); + let r = hyper::Response::new("Some content".into()); fetch::client::Response::new(u, r, abort) } else { - fetch::client::Response::new(u, hyper::Response::new().with_status(StatusCode::NotFound), abort) + let r = hyper::Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::empty()).expect("Nothing to parse, can not fail; qed"); + fetch::client::Response::new(u, r, abort) }) } diff --git a/util/fetch/Cargo.toml b/util/fetch/Cargo.toml index 8f87c6c0f..d5df1034b 100644 --- a/util/fetch/Cargo.toml +++ b/util/fetch/Cargo.toml @@ -8,11 +8,11 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1" -hyper = "0.11" -hyper-rustls = "0.11" +hyper = "~0.12.9" +hyper-rustls = "0.14" +http = "0.1" log = "0.4" -tokio-core = "0.1" -tokio-timer = "0.1" +tokio = "~0.1.8" url = "1" bytes = "0.4" diff --git a/util/fetch/src/client.rs b/util/fetch/src/client.rs index 3f1f274e0..d32273f24 100644 --- a/util/fetch/src/client.rs +++ b/util/fetch/src/client.rs @@ -17,8 +17,7 @@ use futures::future::{self, Loop}; use futures::sync::{mpsc, oneshot}; use futures::{self, Future, Async, Sink, Stream}; -use hyper::header::{UserAgent, Location, ContentLength, ContentType}; -use hyper::mime::Mime; +use hyper::header::{self, HeaderMap, HeaderValue, IntoHeaderName}; use hyper::{self, Method, StatusCode}; use hyper_rustls; use std; @@ -29,8 +28,7 @@ use std::sync::mpsc::RecvTimeoutError; use std::thread; use std::time::Duration; use std::{io, fmt}; -use tokio_core::reactor; -use tokio_timer::{self, Timer}; +use tokio::{self, util::FutureExt}; use url::{self, Url}; use bytes::Bytes; @@ -118,7 +116,7 @@ impl Abort { /// Types which retrieve content from some URL. pub trait Fetch: Clone + Send + Sync + 'static { /// The result future. - type Result: Future + Send + 'static; + type Result: Future + Send + 'static; /// Make a request to given URL fn fetch(&self, request: Request, abort: Abort) -> Self::Result; @@ -131,7 +129,7 @@ pub trait Fetch: Clone + Send + Sync + 'static { } type TxResponse = oneshot::Sender>; -type TxStartup = std::sync::mpsc::SyncSender>; +type TxStartup = std::sync::mpsc::SyncSender>; type ChanItem = Option<(Request, Abort, TxResponse)>; /// An implementation of `Fetch` using a `hyper` client. @@ -140,9 +138,8 @@ type ChanItem = Option<(Request, Abort, TxResponse)>; // not implement `Send` currently. #[derive(Debug)] pub struct Client { - core: mpsc::Sender, + runtime: mpsc::Sender, refs: Arc, - timer: Timer, } // When cloning a client we increment the internal reference counter. @@ -150,9 +147,8 @@ impl Clone for Client { fn clone(&self) -> Client { self.refs.fetch_add(1, Ordering::SeqCst); Client { - core: self.core.clone(), + runtime: self.runtime.clone(), refs: self.refs.clone(), - timer: self.timer.clone(), } } } @@ -163,7 +159,7 @@ impl Drop for Client { fn drop(&mut self) { if self.refs.fetch_sub(1, Ordering::SeqCst) == 1 { // ignore send error as it means the background thread is gone already - let _ = self.core.clone().send(None).wait(); + let _ = self.runtime.clone().send(None).wait(); } } } @@ -193,23 +189,20 @@ impl Client { } Ok(Client { - core: tx_proto, + runtime: tx_proto, refs: Arc::new(AtomicUsize::new(1)), - timer: Timer::default(), }) } fn background_thread(tx_start: TxStartup, rx_proto: mpsc::Receiver, num_dns_threads: usize) -> io::Result> { thread::Builder::new().name("fetch".into()).spawn(move || { - let mut core = match reactor::Core::new() { + let mut runtime = match tokio::runtime::current_thread::Runtime::new() { Ok(c) => c, Err(e) => return tx_start.send(Err(e)).unwrap_or(()) }; - let handle = core.handle(); - let hyper = hyper::Client::configure() - .connector(hyper_rustls::HttpsConnector::new(num_dns_threads, &core.handle())) - .build(&core.handle()); + let hyper = hyper::Client::builder() + .build(hyper_rustls::HttpsConnector::new(num_dns_threads)); let future = rx_proto.take_while(|item| Ok(item.is_some())) .map(|item| item.expect("`take_while` is only passing on channel items != None; qed")) @@ -241,13 +234,18 @@ impl Client { request2.set_url(next_url); request2 } else { - Request::new(next_url, Method::Get) + Request::new(next_url, Method::GET) }; Ok(Loop::Continue((client, request, abort, redirects + 1))) } else { - let content_len = resp.headers.get::().cloned(); - if content_len.map(|n| *n > abort.max_size() as u64).unwrap_or(false) { - return Err(Error::SizeLimit) + if let Some(ref h_val) = resp.headers.get(header::CONTENT_LENGTH) { + let content_len = h_val + .to_str()? + .parse::()?; + + if content_len > abort.max_size() as u64 { + return Err(Error::SizeLimit) + } } Ok(Loop::Break(resp)) } @@ -256,7 +254,7 @@ impl Client { .then(|result| { future::ok(sender.send(result).unwrap_or(())) }); - handle.spawn(fut); + tokio::spawn(fut); trace!(target: "fetch", "waiting for next request ..."); future::ok(()) }); @@ -264,7 +262,7 @@ impl Client { tx_start.send(Ok(())).unwrap_or(()); debug!(target: "fetch", "processing requests ..."); - if let Err(()) = core.run(future) { + if let Err(()) = runtime.block_on(future) { error!(target: "fetch", "error while executing future") } debug!(target: "fetch", "fetch background thread finished") @@ -273,7 +271,7 @@ impl Client { } impl Fetch for Client { - type Result = Box + Send>; + type Result = Box + Send + 'static>; fn fetch(&self, request: Request, abort: Abort) -> Self::Result { debug!(target: "fetch", "fetching: {:?}", request.url()); @@ -282,7 +280,7 @@ impl Fetch for Client { } let (tx_res, rx_res) = oneshot::channel(); let maxdur = abort.max_duration(); - let sender = self.core.clone(); + let sender = self.runtime.clone(); let future = sender.send(Some((request, abort, tx_res))) .map_err(|e| { error!(target: "fetch", "failed to schedule request: {}", e); @@ -291,7 +289,15 @@ impl Fetch for Client { .and_then(|_| rx_res.map_err(|oneshot::Canceled| Error::BackgroundThreadDead)) .and_then(future::result); - Box::new(self.timer.timeout(future, maxdur)) + Box::new(future.timeout(maxdur) + .map_err(|err| { + if err.is_inner() { + Error::from(err.into_inner().unwrap()) + } else { + Error::from(err) + } + }) + ) } /// Get content from some URL. @@ -315,22 +321,21 @@ impl Fetch for Client { // Extract redirect location from response. The second return value indicate whether the original method should be preserved. fn redirect_location(u: Url, r: &Response) -> Option<(Url, bool)> { - use hyper::StatusCode::*; let preserve_method = match r.status() { - TemporaryRedirect | PermanentRedirect => true, + StatusCode::TEMPORARY_REDIRECT | StatusCode::PERMANENT_REDIRECT => true, _ => false, }; match r.status() { - MovedPermanently - | PermanentRedirect - | TemporaryRedirect - | Found - | SeeOther => { - if let Some(loc) = r.headers.get::() { - u.join(loc).ok().map(|url| (url, preserve_method)) - } else { - None - } + StatusCode::MOVED_PERMANENTLY + | StatusCode::PERMANENT_REDIRECT + | StatusCode::TEMPORARY_REDIRECT + | StatusCode::FOUND + | StatusCode::SEE_OTHER => { + r.headers.get(header::LOCATION).and_then(|loc| { + loc.to_str().ok().and_then(|loc_s| { + u.join(loc_s).ok().map(|url| (url, preserve_method)) + }) + }) } _ => None } @@ -341,7 +346,7 @@ fn redirect_location(u: Url, r: &Response) -> Option<(Url, bool)> { pub struct Request { url: Url, method: Method, - headers: hyper::Headers, + headers: HeaderMap, body: Bytes, } @@ -350,19 +355,19 @@ impl Request { pub fn new(url: Url, method: Method) -> Request { Request { url, method, - headers: hyper::Headers::new(), + headers: HeaderMap::new(), body: Default::default(), } } /// Create a new GET request. pub fn get(url: Url) -> Request { - Request::new(url, Method::Get) + Request::new(url, Method::GET) } /// Create a new empty POST request. pub fn post(url: Url) -> Request { - Request::new(url, Method::Post) + Request::new(url, Method::POST) } /// Read the url. @@ -371,12 +376,12 @@ impl Request { } /// Read the request headers. - pub fn headers(&self) -> &hyper::Headers { + pub fn headers(&self) -> &HeaderMap { &self.headers } /// Get a mutable reference to the headers. - pub fn headers_mut(&mut self) -> &mut hyper::Headers { + pub fn headers_mut(&mut self) -> &mut HeaderMap { &mut self.headers } @@ -391,8 +396,10 @@ impl Request { } /// Consume self, and return it with the added given header. - pub fn with_header(mut self, value: H) -> Self { - self.headers_mut().set(value); + pub fn with_header(mut self, key: K, val: HeaderValue) -> Self + where K: IntoHeaderName, + { + self.headers_mut().append(key, val); self } @@ -403,16 +410,15 @@ impl Request { } } -impl Into for Request { - fn into(mut self) -> hyper::Request { - let uri = self.url.as_ref().parse().expect("Every valid URLis also a URI."); - let mut req = hyper::Request::new(self.method, uri); - - self.headers.set(UserAgent::new("Parity Fetch Neo")); - *req.headers_mut() = self.headers; - req.set_body(self.body); - - req +impl From for hyper::Request { + fn from(req: Request) -> hyper::Request { + let uri: hyper::Uri = req.url.as_ref().parse().expect("Every valid URLis also a URI."); + hyper::Request::builder() + .method(req.method) + .uri(uri) + .header(header::USER_AGENT, HeaderValue::from_static("Parity Fetch Neo")) + .body(req.body.into()) + .expect("Header, uri, method, and body are already valid and can not fail to parse; qed") } } @@ -421,7 +427,7 @@ impl Into for Request { pub struct Response { url: Url, status: StatusCode, - headers: hyper::Headers, + headers: HeaderMap, body: hyper::Body, abort: Abort, nread: usize, @@ -429,12 +435,12 @@ pub struct Response { impl Response { /// Create a new response, wrapping a hyper response. - pub fn new(u: Url, r: hyper::Response, a: Abort) -> Response { + pub fn new(u: Url, r: hyper::Response, a: Abort) -> Response { Response { url: u, status: r.status(), headers: r.headers().clone(), - body: r.body(), + body: r.into_body(), abort: a, nread: 0, } @@ -447,26 +453,21 @@ impl Response { /// Status code == OK (200)? pub fn is_success(&self) -> bool { - self.status() == StatusCode::Ok + self.status() == StatusCode::OK } /// Status code == 404. pub fn is_not_found(&self) -> bool { - self.status() == StatusCode::NotFound + self.status() == StatusCode::NOT_FOUND } /// Is the content-type text/html? pub fn is_html(&self) -> bool { - if let Some(ref mime) = self.content_type() { - mime.type_() == "text" && mime.subtype() == "html" - } else { - false - } - } - - /// The conten-type header value. - pub fn content_type(&self) -> Option { - self.headers.get::().map(|ct| ct.0.clone()) + self.headers.get(header::CONTENT_TYPE).and_then(|ct_val| { + ct_val.to_str().ok().map(|ct_str| { + ct_str.contains("text") && ct_str.contains("html") + }) + }).unwrap_or(false) } } @@ -562,6 +563,10 @@ impl io::Read for BodyReader { pub enum Error { /// Hyper gave us an error. Hyper(hyper::Error), + /// A hyper header conversion error. + HyperHeaderToStrError(hyper::header::ToStrError), + /// An integer parsing error. + ParseInt(std::num::ParseIntError), /// Some I/O error occured. Io(io::Error), /// Invalid URLs where attempted to parse. @@ -570,8 +575,10 @@ pub enum Error { Aborted, /// Too many redirects have been encountered. TooManyRedirects, + /// tokio-timer inner future gave us an error. + TokioTimeoutInnerVal(String), /// tokio-timer gave us an error. - Timer(tokio_timer::TimerError), + TokioTimer(Option), /// The maximum duration was reached. Timeout, /// The response body is too large. @@ -585,23 +592,43 @@ impl fmt::Display for Error { match *self { Error::Aborted => write!(fmt, "The request has been aborted."), Error::Hyper(ref e) => write!(fmt, "{}", e), + Error::HyperHeaderToStrError(ref e) => write!(fmt, "{}", e), + Error::ParseInt(ref e) => write!(fmt, "{}", e), Error::Url(ref e) => write!(fmt, "{}", e), Error::Io(ref e) => write!(fmt, "{}", e), Error::BackgroundThreadDead => write!(fmt, "background thread gond"), Error::TooManyRedirects => write!(fmt, "too many redirects"), - Error::Timer(ref e) => write!(fmt, "{}", e), + Error::TokioTimeoutInnerVal(ref s) => write!(fmt, "tokio timer inner value error: {:?}", s), + Error::TokioTimer(ref e) => write!(fmt, "tokio timer error: {:?}", e), Error::Timeout => write!(fmt, "request timed out"), Error::SizeLimit => write!(fmt, "size limit reached"), } } } +impl ::std::error::Error for Error { + fn description(&self) -> &str { "Fetch client error" } + fn cause(&self) -> Option<&::std::error::Error> { None } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) } } +impl From for Error { + fn from(e: hyper::header::ToStrError) -> Self { + Error::HyperHeaderToStrError(e) + } +} + +impl From for Error { + fn from(e: std::num::ParseIntError) -> Self { + Error::ParseInt(e) + } +} + impl From for Error { fn from(e: io::Error) -> Self { Error::Io(e) @@ -614,24 +641,35 @@ impl From for Error { } } -impl From> for Error { - fn from(e: tokio_timer::TimeoutError) -> Self { - match e { - tokio_timer::TimeoutError::Timer(_, e) => Error::Timer(e), - tokio_timer::TimeoutError::TimedOut(_) => Error::Timeout, +impl From> for Error { + fn from(e: tokio::timer::timeout::Error) -> Self { + if e.is_inner() { + Error::TokioTimeoutInnerVal(format!("{:?}", e.into_inner().unwrap())) + } else if e.is_elapsed() { + Error::Timeout + } else { + Error::TokioTimer(e.into_timer()) } } } +impl From for Error { + fn from(e: tokio::timer::Error) -> Self { + Error::TokioTimer(Some(e)) + } +} + #[cfg(test)] mod test { use super::*; use futures::future; - use futures::sync::mpsc; - use hyper::StatusCode; - use hyper::server::{Http, Request, Response, Service}; - use tokio_timer::Timer; - use std; + use futures::sync::oneshot; + use hyper::{ + StatusCode, + service::Service, + }; + use tokio::timer::Delay; + use tokio::runtime::current_thread::Runtime; use std::io::Read; use std::net::SocketAddr; @@ -641,139 +679,238 @@ mod test { fn it_should_fetch() { let server = TestServer::run(); let client = Client::new(4).unwrap(); - let future = client.get(&format!("http://{}?123", server.addr()), Default::default()); - let resp = future.wait().unwrap(); - assert!(resp.is_success()); - let body = resp.concat2().wait().unwrap(); - assert_eq!(&body[..], b"123") + let mut runtime = Runtime::new().unwrap(); + + let future = client.get(&format!("http://{}?123", server.addr()), Abort::default()) + .map(|resp| { + assert!(resp.is_success()); + resp + }) + .map(|resp| resp.concat2()) + .flatten() + .map(|body| assert_eq!(&body[..], b"123")) + .map_err(|err| panic!(err)); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_fetch_in_light_mode() { let server = TestServer::run(); let client = Client::new(1).unwrap(); - let future = client.get(&format!("http://{}?123", server.addr()), Default::default()); - let resp = future.wait().unwrap(); - assert!(resp.is_success()); - let body = resp.concat2().wait().unwrap(); - assert_eq!(&body[..], b"123") + let mut runtime = Runtime::new().unwrap(); + + let future = client.get(&format!("http://{}?123", server.addr()), Abort::default()) + .map(|resp| { + assert!(resp.is_success()); + resp + }) + .map(|resp| resp.concat2()) + .flatten() + .map(|body| assert_eq!(&body[..], b"123")) + .map_err(|err| panic!(err)); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_timeout() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default().with_max_duration(Duration::from_secs(1)); - match client.get(&format!("http://{}/delay?3", server.addr()), abort).wait() { - Err(Error::Timeout) => {} - other => panic!("expected timeout, got {:?}", other) - } + + let future = client.get(&format!("http://{}/delay?3", server.addr()), abort) + .then(|res| { + match res { + Err(Error::Timeout) => Ok::<_, ()>(()), + other => panic!("expected timeout, got {:?}", other), + } + }); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_follow_redirects() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default(); - let future = client.get(&format!("http://{}/redirect?http://{}/", server.addr(), server.addr()), abort); - assert!(future.wait().unwrap().is_success()) + + let future = client.get(&format!("http://{}/redirect?http://{}/", server.addr(), server.addr()), abort) + .and_then(|resp| { + if resp.is_success() { Ok(()) } else { panic!("Response unsuccessful") } + }); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_follow_relative_redirects() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default().with_max_redirects(4); - let future = client.get(&format!("http://{}/redirect?/", server.addr()), abort); - assert!(future.wait().unwrap().is_success()) + let future = client.get(&format!("http://{}/redirect?/", server.addr()), abort) + .and_then(|resp| { + if resp.is_success() { Ok(()) } else { panic!("Response unsuccessful") } + }); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_not_follow_too_many_redirects() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default().with_max_redirects(3); - match client.get(&format!("http://{}/loop", server.addr()), abort).wait() { - Err(Error::TooManyRedirects) => {} - other => panic!("expected too many redirects error, got {:?}", other) - } + let future = client.get(&format!("http://{}/loop", server.addr()), abort) + .then(|res| { + match res { + Err(Error::TooManyRedirects) => Ok::<_, ()>(()), + other => panic!("expected too many redirects error, got {:?}", other) + } + }); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_read_data() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default(); - let future = client.get(&format!("http://{}?abcdefghijklmnopqrstuvwxyz", server.addr()), abort); - let resp = future.wait().unwrap(); - assert!(resp.is_success()); - assert_eq!(&resp.concat2().wait().unwrap()[..], b"abcdefghijklmnopqrstuvwxyz") + let future = client.get(&format!("http://{}?abcdefghijklmnopqrstuvwxyz", server.addr()), abort) + .and_then(|resp| { + if resp.is_success() { Ok(resp) } else { panic!("Response unsuccessful") } + }) + .map(|resp| resp.concat2()) + .flatten() + .map(|body| assert_eq!(&body[..], b"abcdefghijklmnopqrstuvwxyz")); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_not_read_too_much_data() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + let abort = Abort::default().with_max_size(3); - let resp = client.get(&format!("http://{}/?1234", server.addr()), abort).wait().unwrap(); - assert!(resp.is_success()); - match resp.concat2().wait() { - Err(Error::SizeLimit) => {} - other => panic!("expected size limit error, got {:?}", other) - } + let future = client.get(&format!("http://{}/?1234", server.addr()), abort) + .and_then(|resp| { + if resp.is_success() { Ok(resp) } else { panic!("Response unsuccessful") } + }) + .map(|resp| resp.concat2()) + .flatten() + .then(|body| { + match body { + Err(Error::SizeLimit) => Ok::<_, ()>(()), + other => panic!("expected size limit error, got {:?}", other), + } + }); + + runtime.block_on(future).unwrap(); } #[test] fn it_should_not_read_too_much_data_sync() { let server = TestServer::run(); let client = Client::new(4).unwrap(); + let mut runtime = Runtime::new().unwrap(); + + // let abort = Abort::default().with_max_size(3); + // let resp = client.get(&format!("http://{}/?1234", server.addr()), abort).wait().unwrap(); + // assert!(resp.is_success()); + // let mut buffer = Vec::new(); + // let mut reader = BodyReader::new(resp); + // match reader.read_to_end(&mut buffer) { + // Err(ref e) if e.kind() == io::ErrorKind::PermissionDenied => {} + // other => panic!("expected size limit error, got {:?}", other) + // } + + // FIXME (c0gent): The prior version of this test (pre-hyper-0.12, + // commented out above) is not possible to recreate. It relied on an + // apparent bug in `Client::background_thread` which suppressed the + // `SizeLimit` error from occurring. This is due to the headers + // collection not returning a value for content length when queried. + // The precise reason why this was happening is unclear. + let abort = Abort::default().with_max_size(3); - let resp = client.get(&format!("http://{}/?1234", server.addr()), abort).wait().unwrap(); - assert!(resp.is_success()); - let mut buffer = Vec::new(); - let mut reader = BodyReader::new(resp); - match reader.read_to_end(&mut buffer) { - Err(ref e) if e.kind() == io::ErrorKind::PermissionDenied => {} - other => panic!("expected size limit error, got {:?}", other) + let future = client.get(&format!("http://{}/?1234", server.addr()), abort) + .and_then(|resp| { + assert_eq!(true, false, "Unreachable. (see FIXME note)"); + assert!(resp.is_success()); + let mut buffer = Vec::new(); + let mut reader = BodyReader::new(resp); + match reader.read_to_end(&mut buffer) { + Err(ref e) if e.kind() == io::ErrorKind::PermissionDenied => Ok(()), + other => panic!("expected size limit error, got {:?}", other) + } + }); + + // FIXME: This simply demonstrates the above point. + match runtime.block_on(future) { + Err(Error::SizeLimit) => {}, + other => panic!("Expected `Error::SizeLimit`, got: {:?}", other), } } - struct TestServer(Timer); + struct TestServer; impl Service for TestServer { - type Request = Request; - type Response = Response; - type Error = hyper::Error; - type Future = Box>; + type ReqBody = hyper::Body; + type ResBody = hyper::Body; + type Error = Error; + type Future = Box, Error=Self::Error> + Send + 'static>; - fn call(&self, req: Request) -> Self::Future { + fn call(&mut self, req: hyper::Request) -> Self::Future { match req.uri().path() { "/" => { let body = req.uri().query().unwrap_or("").to_string(); - let req = Response::new().with_body(body); - Box::new(future::ok(req)) + let res = hyper::Response::new(body.into()); + Box::new(future::ok(res)) } "/redirect" => { - let loc = Location::new(req.uri().query().unwrap_or("/").to_string()); - let req = Response::new() - .with_status(StatusCode::MovedPermanently) - .with_header(loc); - Box::new(future::ok(req)) + let loc = req.uri().query().unwrap_or("/").to_string(); + let res = hyper::Response::builder() + .status(StatusCode::MOVED_PERMANENTLY) + .header(hyper::header::LOCATION, loc) + .body(hyper::Body::empty()) + .expect("Unable to create response"); + Box::new(future::ok(res)) } "/loop" => { - let req = Response::new() - .with_status(StatusCode::MovedPermanently) - .with_header(Location::new("/loop".to_string())); - Box::new(future::ok(req)) + let res = hyper::Response::builder() + .status(StatusCode::MOVED_PERMANENTLY) + .header(hyper::header::LOCATION, "/loop") + .body(hyper::Body::empty()) + .expect("Unable to create response"); + Box::new(future::ok(res)) } "/delay" => { - let d = Duration::from_secs(req.uri().query().unwrap_or("0").parse().unwrap()); - Box::new(self.0.sleep(d) - .map_err(|_| return io::Error::new(io::ErrorKind::Other, "timer error")) - .from_err() - .map(|_| Response::new())) + let dur = Duration::from_secs(req.uri().query().unwrap_or("0").parse().unwrap()); + let delayed_res = Delay::new(std::time::Instant::now() + dur) + .and_then(|_| Ok::<_, _>(hyper::Response::new(hyper::Body::empty()))) + .from_err(); + Box::new(delayed_res) + } + _ => { + let res = hyper::Response::builder() + .status(StatusCode::NOT_FOUND) + .body(hyper::Body::empty()) + .expect("Unable to create response"); + Box::new(future::ok(res)) } - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) } } } @@ -781,19 +918,27 @@ mod test { impl TestServer { fn run() -> Handle { let (tx_start, rx_start) = std::sync::mpsc::sync_channel(1); - let (tx_end, rx_end) = mpsc::channel(0); - let rx_end_fut = rx_end.into_future().map(|_| ()).map_err(|_| ()); + let (tx_end, rx_end) = oneshot::channel(); + let rx_end_fut = rx_end.map(|_| ()).map_err(|_| ()); thread::spawn(move || { let addr = ADDRESS.parse().unwrap(); - let server = Http::new().bind(&addr, || Ok(TestServer(Timer::default()))).unwrap(); - tx_start.send(server.local_addr().unwrap()).unwrap_or(()); - server.run_until(rx_end_fut).unwrap(); + + let server = hyper::server::Server::bind(&addr) + .serve(|| future::ok::<_, hyper::Error>(TestServer)); + + tx_start.send(server.local_addr()).unwrap_or(()); + + tokio::run( + server.with_graceful_shutdown(rx_end_fut) + .map_err(|e| panic!("server error: {}", e)) + ); }); - Handle(rx_start.recv().unwrap(), tx_end) + + Handle(rx_start.recv().unwrap(), Some(tx_end)) } } - struct Handle(SocketAddr, mpsc::Sender<()>); + struct Handle(SocketAddr, Option>); impl Handle { fn addr(&self) -> SocketAddr { @@ -803,7 +948,7 @@ mod test { impl Drop for Handle { fn drop(&mut self) { - self.1.clone().send(()).wait().unwrap(); + self.1.take().unwrap().send(()).unwrap(); } } } diff --git a/util/fetch/src/lib.rs b/util/fetch/src/lib.rs index 37225dfa1..5ad497a79 100644 --- a/util/fetch/src/lib.rs +++ b/util/fetch/src/lib.rs @@ -26,9 +26,9 @@ extern crate futures; extern crate hyper; extern crate hyper_rustls; +extern crate http; -extern crate tokio_core; -extern crate tokio_timer; +extern crate tokio; extern crate url; extern crate bytes; diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 112595ad9..74a4cc945 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -21,7 +21,7 @@ ansi_term = "0.10" rustc-hex = "1.0" ethcore-io = { path = "../io", features = ["mio"] } parity-bytes = "0.1" -parity-crypto = "0.1" +parity-crypto = "0.2" ethcore-logger = { path ="../../logger" } ethcore-network = { path = "../network" } ethereum-types = "0.4" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 51c3dc671..ef2e11d12 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] [dependencies] error-chain = { version = "0.12", default-features = false } -parity-crypto = "0.1" +parity-crypto = "0.2" ethcore-io = { path = "../io" } ethereum-types = "0.4" ethkey = { path = "../../ethkey" } diff --git a/util/reactor/src/lib.rs b/util/reactor/src/lib.rs deleted file mode 100644 index 8fd37e7c8..000000000 --- a/util/reactor/src/lib.rs +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2015-2018 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity 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. - -// Parity 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 Parity. If not, see . - -//! Tokio Core Reactor wrapper. - -extern crate futures; -extern crate tokio_core; - -use std::{fmt, thread}; -use std::sync::mpsc; -use std::time::Duration; -use futures::{Future, IntoFuture}; -pub use tokio_core::reactor::{Remote as TokioRemote, Handle, Timeout}; - -/// Event Loop for futures. -/// Wrapper around `tokio::reactor::Core`. -/// Runs in a separate thread. -pub struct EventLoop { - remote: Remote, - handle: EventLoopHandle, -} - -impl EventLoop { - /// Spawns a new thread with `EventLoop` with given handler. - pub fn spawn() -> Self { - let (stop, stopped) = futures::oneshot(); - let (tx, rx) = mpsc::channel(); - let handle = thread::spawn(move || { - let mut el = tokio_core::reactor::Core::new().expect("Creating an event loop should not fail."); - tx.send(el.remote()).expect("Rx is blocking upper thread."); - let _ = el.run(futures::empty().select(stopped)); - }); - let remote = rx.recv().expect("tx is transfered to a newly spawned thread."); - - EventLoop { - remote: Remote { - inner: Mode::Tokio(remote), - }, - handle: EventLoopHandle { - close: Some(stop), - handle: Some(handle), - }, - } - } - - /// Returns this event loop raw remote. - /// - /// Deprecated: Exists only to connect with current JSONRPC implementation. - pub fn raw_remote(&self) -> TokioRemote { - if let Mode::Tokio(ref remote) = self.remote.inner { - remote.clone() - } else { - panic!("Event loop is never initialized in other mode then Tokio.") - } - } - - /// Returns event loop remote. - pub fn remote(&self) -> Remote { - self.remote.clone() - } -} - -#[derive(Clone)] -enum Mode { - Tokio(TokioRemote), - Sync, - ThreadPerFuture, -} - -impl fmt::Debug for Mode { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - use self::Mode::*; - - match *self { - Tokio(_) => write!(fmt, "tokio"), - Sync => write!(fmt, "synchronous"), - ThreadPerFuture => write!(fmt, "thread per future"), - } - } -} - -#[derive(Debug, Clone)] -pub struct Remote { - inner: Mode, -} - -impl Remote { - /// Remote for existing event loop. - /// - /// Deprecated: Exists only to connect with current JSONRPC implementation. - pub fn new(remote: TokioRemote) -> Self { - Remote { - inner: Mode::Tokio(remote), - } - } - - /// Synchronous remote, used mostly for tests. - pub fn new_sync() -> Self { - Remote { - inner: Mode::Sync, - } - } - - /// Spawns a new thread for each future (use only for tests). - pub fn new_thread_per_future() -> Self { - Remote { - inner: Mode::ThreadPerFuture, - } - } - - /// Spawn a future to this event loop - pub fn spawn(&self, r: R) where - R: IntoFuture + Send + 'static, - R::Future: 'static, - { - match self.inner { - Mode::Tokio(ref remote) => remote.spawn(move |_| r), - Mode::Sync => { - let _= r.into_future().wait(); - }, - Mode::ThreadPerFuture => { - thread::spawn(move || { - let _= r.into_future().wait(); - }); - }, - } - } - - /// Spawn a new future returned by given closure. - pub fn spawn_fn(&self, f: F) where - F: FnOnce(&Handle) -> R + Send + 'static, - R: IntoFuture, - R::Future: 'static, - { - match self.inner { - Mode::Tokio(ref remote) => remote.spawn(move |handle| f(handle)), - Mode::Sync => { - let mut core = tokio_core::reactor::Core::new().expect("Creating an event loop should not fail."); - let handle = core.handle(); - let _ = core.run(f(&handle).into_future()); - }, - Mode::ThreadPerFuture => { - thread::spawn(move || { - let mut core = tokio_core::reactor::Core::new().expect("Creating an event loop should not fail."); - let handle = core.handle(); - let _ = core.run(f(&handle).into_future()); - }); - }, - } - } - - /// Spawn a new future and wait for it or for a timeout to occur. - pub fn spawn_with_timeout(&self, f: F, duration: Duration, on_timeout: T) where - T: FnOnce() -> () + Send + 'static, - F: FnOnce(&Handle) -> R + Send + 'static, - R: IntoFuture, - R::Future: 'static, - { - match self.inner { - Mode::Tokio(ref remote) => remote.spawn(move |handle| { - let future = f(handle).into_future(); - let timeout = Timeout::new(duration, handle).expect("Event loop is still up."); - future.select(timeout.then(move |_| { - on_timeout(); - Ok(()) - })).then(|_| Ok(())) - }), - Mode::Sync => { - let mut core = tokio_core::reactor::Core::new().expect("Creating an event loop should not fail."); - let handle = core.handle(); - let future = f(&handle).into_future(); - let timeout = Timeout::new(duration, &handle).expect("Event loop is still up."); - let _: Result<(), ()> = core.run(future.select(timeout.then(move |_| { - on_timeout(); - Ok(()) - })).then(|_| Ok(()))); - }, - Mode::ThreadPerFuture => { - thread::spawn(move || { - let mut core = tokio_core::reactor::Core::new().expect("Creating an event loop should not fail."); - let handle = core.handle(); - let future = f(&handle).into_future(); - let timeout = Timeout::new(duration, &handle).expect("Event loop is still up."); - let _: Result<(), ()> = core.run(future.select(timeout.then(move |_| { - on_timeout(); - Ok(()) - })).then(|_| Ok(()))); - }); - }, - } - } -} - -/// A handle to running event loop. Dropping the handle will cause event loop to finish. -pub struct EventLoopHandle { - close: Option>, - handle: Option> -} - -impl From for EventLoopHandle { - fn from(el: EventLoop) -> Self { - el.handle - } -} - -impl Drop for EventLoopHandle { - fn drop(&mut self) { - self.close.take().map(|v| v.send(())); - } -} - -impl EventLoopHandle { - /// Blocks current thread and waits until the event loop is finished. - pub fn wait(mut self) -> thread::Result<()> { - self.handle.take() - .expect("Handle is taken only in `wait`, `wait` is consuming; qed").join() - } - - /// Finishes this event loop. - pub fn close(mut self) { - let _ = self.close.take() - .expect("Close is taken only in `close` and `drop`. `close` is consuming; qed") - .send(()); - } -} diff --git a/util/reactor/Cargo.toml b/util/runtime/Cargo.toml similarity index 68% rename from util/reactor/Cargo.toml rename to util/runtime/Cargo.toml index 820b188a0..084fef55a 100644 --- a/util/reactor/Cargo.toml +++ b/util/runtime/Cargo.toml @@ -1,11 +1,11 @@ [package] -description = "Parity Reactor" +description = "Parity Runtime" homepage = "http://parity.io" license = "GPL-3.0" -name = "parity-reactor" +name = "parity-runtime" version = "0.1.0" authors = ["Parity Technologies "] [dependencies] futures = "0.1" -tokio-core = "0.1" +tokio = "~0.1.9" diff --git a/util/runtime/src/lib.rs b/util/runtime/src/lib.rs new file mode 100644 index 000000000..aa7b6e73c --- /dev/null +++ b/util/runtime/src/lib.rs @@ -0,0 +1,256 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +//! Tokio Runtime wrapper. + +extern crate futures; +extern crate tokio; + +use std::{fmt, thread}; +use std::sync::mpsc; +use std::time::{Duration, Instant}; +use futures::{future, Future, IntoFuture}; +pub use tokio::timer::Delay; +pub use tokio::runtime::{Runtime as TokioRuntime, Builder as TokioRuntimeBuilder, TaskExecutor}; + +/// Runtime for futures. +/// +/// Runs in a separate thread. +pub struct Runtime { + executor: Executor, + handle: RuntimeHandle, +} + +impl Runtime { + fn new(runtime_bldr: &mut TokioRuntimeBuilder) -> Self { + let mut runtime = runtime_bldr + .build() + .expect("Building a Tokio runtime will only fail when mio components \ + cannot be initialized (catastrophic)"); + let (stop, stopped) = futures::oneshot(); + let (tx, rx) = mpsc::channel(); + let handle = thread::spawn(move || { + tx.send(runtime.executor()).expect("Rx is blocking upper thread."); + runtime.block_on(futures::empty().select(stopped).map(|_| ()).map_err(|_| ())) + .expect("Tokio runtime should not have unhandled errors."); + }); + let executor = rx.recv().expect("tx is transfered to a newly spawned thread."); + + Runtime { + executor: Executor { + inner: Mode::Tokio(executor), + }, + handle: RuntimeHandle { + close: Some(stop), + handle: Some(handle), + }, + } + } + + /// Spawns a new tokio runtime with a default thread count on a background + /// thread and returns a `Runtime` which can be used to spawn tasks via + /// its executor. + pub fn with_default_thread_count() -> Self { + let mut runtime_bldr = TokioRuntimeBuilder::new(); + Self::new(&mut runtime_bldr) + } + + /// Spawns a new tokio runtime with a the specified thread count on a + /// background thread and returns a `Runtime` which can be used to spawn + /// tasks via its executor. + pub fn with_thread_count(thread_count: usize) -> Self { + let mut runtime_bldr = TokioRuntimeBuilder::new(); + runtime_bldr.core_threads(thread_count); + + Self::new(&mut runtime_bldr) + } + + /// Returns this runtime raw executor. + /// + /// Deprecated: Exists only to connect with current JSONRPC implementation. + pub fn raw_executor(&self) -> TaskExecutor { + if let Mode::Tokio(ref executor) = self.executor.inner { + executor.clone() + } else { + panic!("Runtime is not initialized in Tokio mode.") + } + } + + /// Returns runtime executor. + pub fn executor(&self) -> Executor { + self.executor.clone() + } +} + +#[derive(Clone)] +enum Mode { + Tokio(TaskExecutor), + Sync, + ThreadPerFuture, +} + +impl fmt::Debug for Mode { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + use self::Mode::*; + + match *self { + Tokio(_) => write!(fmt, "tokio"), + Sync => write!(fmt, "synchronous"), + ThreadPerFuture => write!(fmt, "thread per future"), + } + } +} + +/// Returns a future which runs `f` until `duration` has elapsed, at which +/// time `on_timeout` is run and the future resolves. +fn timeout(f: F, duration: Duration, on_timeout: T) + -> impl Future + Send + 'static +where + T: FnOnce() -> () + Send + 'static, + F: FnOnce() -> R + Send + 'static, + R: IntoFuture + Send + 'static, + R::Future: Send + 'static, +{ + let future = future::lazy(f); + let timeout = Delay::new(Instant::now() + duration) + .then(move |_| { + on_timeout(); + Ok(()) + }); + future.select(timeout).then(|_| Ok(())) +} + +#[derive(Debug, Clone)] +pub struct Executor { + inner: Mode, +} + +impl Executor { + /// Executor for existing runtime. + /// + /// Deprecated: Exists only to connect with current JSONRPC implementation. + pub fn new(executor: TaskExecutor) -> Self { + Executor { + inner: Mode::Tokio(executor), + } + } + + /// Synchronous executor, used mostly for tests. + pub fn new_sync() -> Self { + Executor { + inner: Mode::Sync, + } + } + + /// Spawns a new thread for each future (use only for tests). + pub fn new_thread_per_future() -> Self { + Executor { + inner: Mode::ThreadPerFuture, + } + } + + /// Spawn a future to this runtime + pub fn spawn(&self, r: R) where + R: IntoFuture + Send + 'static, + R::Future: Send + 'static, + { + match self.inner { + Mode::Tokio(ref executor) => executor.spawn(r.into_future()), + Mode::Sync => { + let _= r.into_future().wait(); + }, + Mode::ThreadPerFuture => { + thread::spawn(move || { + let _= r.into_future().wait(); + }); + }, + } + } + + /// Spawn a new future returned by given closure. + pub fn spawn_fn(&self, f: F) where + F: FnOnce() -> R + Send + 'static, + R: IntoFuture + Send + 'static, + R::Future: Send + 'static, + { + match self.inner { + Mode::Tokio(ref executor) => executor.spawn(future::lazy(f)), + Mode::Sync => { + let _ = future::lazy(f).wait(); + }, + Mode::ThreadPerFuture => { + thread::spawn(move || { + let _= f().into_future().wait(); + }); + }, + } + } + + /// Spawn a new future and wait for it or for a timeout to occur. + pub fn spawn_with_timeout(&self, f: F, duration: Duration, on_timeout: T) where + T: FnOnce() -> () + Send + 'static, + F: FnOnce() -> R + Send + 'static, + R: IntoFuture + Send + 'static, + R::Future: Send + 'static, + { + match self.inner { + Mode::Tokio(ref executor) => { + executor.spawn(timeout(f, duration, on_timeout)) + }, + Mode::Sync => { + let _ = timeout(f, duration, on_timeout).wait(); + }, + Mode::ThreadPerFuture => { + thread::spawn(move || { + let _ = timeout(f, duration, on_timeout).wait(); + }); + }, + } + } +} + +/// A handle to a runtime. Dropping the handle will cause runtime to shutdown. +pub struct RuntimeHandle { + close: Option>, + handle: Option> +} + +impl From for RuntimeHandle { + fn from(el: Runtime) -> Self { + el.handle + } +} + +impl Drop for RuntimeHandle { + fn drop(&mut self) { + self.close.take().map(|v| v.send(())); + } +} + +impl RuntimeHandle { + /// Blocks current thread and waits until the runtime is finished. + pub fn wait(mut self) -> thread::Result<()> { + self.handle.take() + .expect("Handle is taken only in `wait`, `wait` is consuming; qed").join() + } + + /// Finishes this runtime. + pub fn close(mut self) { + let _ = self.close.take() + .expect("Close is taken only in `close` and `drop`. `close` is consuming; qed") + .send(()); + } +} diff --git a/whisper/Cargo.toml b/whisper/Cargo.toml index 2bf371827..ac87540ac 100644 --- a/whisper/Cargo.toml +++ b/whisper/Cargo.toml @@ -9,7 +9,7 @@ bitflags = "0.9" byteorder = "1.0.0" ethereum-types = "0.4" ethcore-network = { path = "../util/network" } -parity-crypto = "0.1" +parity-crypto = "0.2" ethkey = { path = "../ethkey" } hex = "0.2" log = "0.4" @@ -25,6 +25,6 @@ slab = "0.3" smallvec = "0.6" tiny-keccak = "1.4" -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } diff --git a/whisper/cli/Cargo.toml b/whisper/cli/Cargo.toml index ac44c53bc..58b653ba6 100644 --- a/whisper/cli/Cargo.toml +++ b/whisper/cli/Cargo.toml @@ -14,9 +14,9 @@ docopt = "0.8" serde = "1.0" serde_derive = "1.0" panic_hook = { path = "../../util/panic_hook" } -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } -jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } +jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" } log = "0.4" [[bin]]