From eaa0ab014a30800862cf19e491abdf815633f839 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Wed, 5 Jun 2019 15:46:01 +0200 Subject: [PATCH] Move import lock onto backend (#2797) * Drop import_lock from client, move it into backend, impl default version via static mutex * still need to allow depcretion because of client.backend * additional docs * Remove default impl of get_import_lock, impl on instances * Bump parking_lot to 0.8.0 accross the board --- substrate/Cargo.lock | 78 +++++++++---------- substrate/core/client/Cargo.toml | 2 +- substrate/core/client/db/Cargo.toml | 2 +- substrate/core/client/db/src/lib.rs | 6 ++ substrate/core/client/src/backend.rs | 8 ++ substrate/core/client/src/client.rs | 21 +---- substrate/core/client/src/in_mem.rs | 8 +- substrate/core/client/src/light/backend.rs | 8 +- substrate/core/consensus/aura/Cargo.toml | 2 +- substrate/core/consensus/aura/src/lib.rs | 1 - substrate/core/consensus/babe/Cargo.toml | 2 +- substrate/core/consensus/babe/src/lib.rs | 2 +- substrate/core/consensus/common/Cargo.toml | 2 +- substrate/core/consensus/rhd/Cargo.toml | 2 +- substrate/core/consensus/slots/Cargo.toml | 2 +- substrate/core/executor/Cargo.toml | 2 +- substrate/core/finality-grandpa/Cargo.toml | 2 +- substrate/core/finality-grandpa/src/tests.rs | 3 +- substrate/core/inherents/Cargo.toml | 2 +- substrate/core/network-libp2p/Cargo.toml | 2 +- substrate/core/network/Cargo.toml | 2 +- substrate/core/offchain/Cargo.toml | 2 +- substrate/core/rpc/Cargo.toml | 2 +- substrate/core/service/Cargo.toml | 2 +- substrate/core/service/src/lib.rs | 3 +- substrate/core/state-db/Cargo.toml | 2 +- substrate/core/state-machine/Cargo.toml | 2 +- substrate/core/telemetry/Cargo.toml | 2 +- substrate/core/test-client/src/lib.rs | 2 +- substrate/core/transaction-pool/Cargo.toml | 2 +- .../core/transaction-pool/graph/Cargo.toml | 2 +- substrate/node-template/Cargo.toml | 2 +- substrate/node-template/src/service.rs | 5 +- substrate/node/cli/src/service.rs | 5 +- substrate/srml/aura/Cargo.toml | 2 +- substrate/srml/babe/Cargo.toml | 2 +- substrate/srml/finality-tracker/Cargo.toml | 2 +- 37 files changed, 101 insertions(+), 97 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index ba81460ca3..b1b933c3a6 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -677,7 +677,7 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "1.1.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -739,7 +739,7 @@ version = "1.0.0-pre.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "curve25519-dalek 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "h2" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1195,7 +1195,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.27 (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.22 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1517,7 +1517,7 @@ dependencies = [ "libp2p-websocket 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-yamux 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-multihash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-multihash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1543,7 +1543,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "multistream-select 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-multihash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-multihash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1648,7 +1648,7 @@ dependencies = [ "libp2p-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-multihash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-multihash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1704,7 +1704,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "curve25519-dalek 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2271,7 +2271,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "node-template-runtime 2.0.0", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "substrate-basic-authorship 2.0.0", "substrate-cli 2.0.0", @@ -2476,7 +2476,7 @@ dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-multihash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-multihash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2485,7 +2485,7 @@ dependencies = [ [[package]] name = "parity-multihash" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3083,7 +3083,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "curve25519-dalek 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ed25519-dalek 1.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "merlin 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3448,7 +3448,7 @@ version = "2.0.0" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -3470,7 +3470,7 @@ dependencies = [ "hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -3613,7 +3613,7 @@ version = "2.0.0" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4008,7 +4008,7 @@ dependencies = [ "kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 2.0.0", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -4036,7 +4036,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-consensus-common 2.0.0", @@ -4057,7 +4057,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", "sr-version 2.0.0", @@ -4112,7 +4112,7 @@ dependencies = [ "merlin 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4157,7 +4157,7 @@ dependencies = [ "libp2p 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", "sr-version 2.0.0", @@ -4176,7 +4176,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rhododendron 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4199,7 +4199,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-consensus-common 2.0.0", @@ -4221,7 +4221,7 @@ dependencies = [ "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-version 2.0.0", "substrate-panic-handler 2.0.0", @@ -4244,7 +4244,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -4278,7 +4278,7 @@ name = "substrate-inherents" version = "2.0.0" dependencies = [ "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", ] @@ -4321,7 +4321,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -4349,7 +4349,7 @@ dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4374,7 +4374,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-consensus-common 2.0.0", @@ -4460,7 +4460,7 @@ dependencies = [ "jsonrpc-pubsub 12.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.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.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4513,7 +4513,7 @@ dependencies = [ "node-primitives 2.0.0", "node-runtime 2.0.0", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4561,7 +4561,7 @@ dependencies = [ "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 2.0.0", ] @@ -4574,7 +4574,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-panic-handler 2.0.0", "substrate-primitives 2.0.0", "substrate-trie 2.0.0", @@ -4588,7 +4588,7 @@ version = "2.0.0" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4655,7 +4655,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-primitives 2.0.0", @@ -4670,7 +4670,7 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-keyring 2.0.0", @@ -5631,7 +5631,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "curve25519-dalek 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -5781,7 +5781,7 @@ dependencies = [ "checksum ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" "checksum ctrlc 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5531b7f0698d9220b4729f8811931dbe0e91a05be2f7b3245fdc50dd856bae26" "checksum cuckoofilter 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd43f7cfaffe0a386636a10baea2ee05cc50df3b77bea4a456c9572a939bf1f" -"checksum curve25519-dalek 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "750226d75fc2f5a8daec6e7477624e258674023eb73d8d647f63b943ca182a4a" +"checksum curve25519-dalek 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440b7acc6264fde2eee18bae135625129c88ff244f3ded035e3caa585a6bf0a" "checksum data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f47ca1860a761136924ddd2422ba77b2ea54fe8cc75b9040804a0d9d32ad97" "checksum derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d944ac6003ed268757ef1ee686753b57efc5fcf0ebe7b64c9fc81e7e32ff839" "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" @@ -5820,7 +5820,7 @@ dependencies = [ "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum globset 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef4feaabe24a0a658fd9cf4a9acf6ed284f045c77df0f49020ba3245cfb7b454" -"checksum h2 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "09ae3ecbdc15e379c7356430d7c0c6a44d3a937324999429dcf89e970297e54f" +"checksum h2 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "1e42e3daed5a7e17b12a0c23b5b2fbff23a925a570938ebee4baca1a9a1a2240" "checksum hash-db 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba7fb417e5c470acdd61068c79767d0e65962e70836cf6c9dfd2409f06345ce0" "checksum hash256-std-hasher 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b2027c19ec91eb304999abae7307d225cf93be42af53b0039f76e98ed5af86" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" @@ -5940,7 +5940,7 @@ dependencies = [ "checksum parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dcb43c05fb71c03b4ea7327bf15694da1e0f23f19d5b1e95bab6c6d74097e336" "checksum parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00a486fd383382ddcb2de928364b1f82571c1e48274fc43b7667a4738ee4056c" "checksum parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" -"checksum parity-multihash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05d6a68e07ab34a9e87bd8dd4936f6bb5be21e4f6dbcdbaf04d8e854eba0af01" +"checksum parity-multihash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eb83358a0c05e52c44d658981fec2d146d3516d1adffd9e553684f8c8e9e8fa5" "checksum parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac" diff --git a/substrate/core/client/Cargo.toml b/substrate/core/client/Cargo.toml index e295894b83..0978b897ec 100644 --- a/substrate/core/client/Cargo.toml +++ b/substrate/core/client/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" derive_more = { version = "0.14.0", optional = true } fnv = { version = "1.0", optional = true } log = { version = "0.4", optional = true } -parking_lot = { version = "0.7.1", optional = true } +parking_lot = { version = "0.8.0", optional = true } hex = { package = "hex-literal", version = "0.1", optional = true } futures = { version = "0.1.17", optional = true } consensus = { package = "substrate-consensus-common", path = "../consensus/common", optional = true } diff --git a/substrate/core/client/db/Cargo.toml b/substrate/core/client/db/Cargo.toml index 77512ec269..64051164b8 100644 --- a/substrate/core/client/db/Cargo.toml +++ b/substrate/core/client/db/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -parking_lot = "0.7.1" +parking_lot = "0.8" log = "0.4" kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" } # FIXME replace with release as soon as our rocksdb changes are released upstream https://github.com/paritytech/parity-common/issues/88 diff --git a/substrate/core/client/db/src/lib.rs b/substrate/core/client/db/src/lib.rs index 302cdfd083..674e8022dc 100644 --- a/substrate/core/client/db/src/lib.rs +++ b/substrate/core/client/db/src/lib.rs @@ -656,6 +656,7 @@ pub struct Backend { blockchain: BlockchainDb, canonicalization_delay: u64, shared_cache: SharedCache, + import_lock: Mutex<()>, } impl> Backend { @@ -722,6 +723,7 @@ impl> Backend { blockchain, canonicalization_delay, shared_cache: new_shared_cache(state_cache_size), + import_lock: Default::default(), }) } @@ -1350,6 +1352,10 @@ impl client::backend::Backend for Backend whe } Ok(()) } + + fn get_import_lock(&self) -> &Mutex<()> { + &self.import_lock + } } impl client::backend::LocalBackend for Backend diff --git a/substrate/core/client/src/backend.rs b/substrate/core/client/src/backend.rs index d2cc086ecd..5028b9dde7 100644 --- a/substrate/core/client/src/backend.rs +++ b/substrate/core/client/src/backend.rs @@ -26,6 +26,7 @@ use state_machine::ChangesTrieStorage as StateChangesTrieStorage; use consensus::well_known_cache_keys; use hash_db::Hasher; use trie::MemoryDB; +use parking_lot::Mutex; /// State of a new block. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -174,6 +175,13 @@ pub trait Backend: AuxStore + Send + Sync where fn get_aux(&self, key: &[u8]) -> error::Result>> { AuxStore::get_aux(self, key) } + + /// Gain access to the import lock around this backend. + /// _Note_ Backend isn't expected to acquire the lock by itself ever. Rather + /// the using components should acquire and hold the lock whenever they do + /// something that the import of a block would interfere with, e.g. importing + /// a new block or calculating the best head. + fn get_import_lock(&self) -> &Mutex<()>; } /// Changes trie storage that supports pruning. diff --git a/substrate/core/client/src/client.rs b/substrate/core/client/src/client.rs index aa236d1580..f3040f13da 100644 --- a/substrate/core/client/src/client.rs +++ b/substrate/core/client/src/client.rs @@ -124,7 +124,6 @@ pub struct Client where Block: BlockT { storage_notifications: Mutex>, import_notification_sinks: Mutex>>>, finality_notification_sinks: Mutex>>>, - import_lock: Arc>, // holds the block hash currently being imported. TODO: replace this with block queue importing_block: RwLock>, execution_strategies: ExecutionStrategies, @@ -318,7 +317,6 @@ impl Client where storage_notifications: Default::default(), import_notification_sinks: Default::default(), finality_notification_sinks: Default::default(), - import_lock: Default::default(), importing_block: Default::default(), execution_strategies, _phantom: Default::default(), @@ -344,15 +342,6 @@ impl Client where &self.backend } - /// Expose reference to import lock - #[doc(hidden)] - #[deprecated(note="Rather than relying on `client` to provide this, access \ - to the backend should be handled at setup only - see #1134. This function \ - will be removed once that is in place.")] - pub fn import_lock(&self) -> Arc> { - self.import_lock.clone() - } - /// Given a `BlockId` and a key prefix, return the matching child storage keys in that block. pub fn storage_keys(&self, id: &BlockId, key_prefix: &StorageKey) -> error::Result> { let keys = self.state_at(id)?.keys(&key_prefix.0).into_iter().map(StorageKey).collect(); @@ -744,7 +733,7 @@ impl Client where Err: From, { let inner = || { - let _import_lock = self.import_lock.lock(); + let _import_lock = self.backend.get_import_lock().lock(); let mut op = ClientImportOperation { op: self.backend.begin_operation()?, @@ -1493,17 +1482,14 @@ where /// where 'longest' is defined as the highest number of blocks pub struct LongestChain { backend: Arc, - import_lock: Arc>, _phantom: PhantomData } impl Clone for LongestChain { fn clone(&self) -> Self { let backend = self.backend.clone(); - let import_lock = self.import_lock.clone(); LongestChain { backend, - import_lock, _phantom: Default::default() } } @@ -1515,10 +1501,9 @@ where Block: BlockT, { /// Instantiate a new LongestChain for Backend B - pub fn new(backend: Arc, import_lock: Arc>) -> Self { + pub fn new(backend: Arc) -> Self { LongestChain { backend, - import_lock, _phantom: Default::default() } } @@ -1564,7 +1549,7 @@ where // ensure no blocks are imported during this code block. // an import could trigger a reorg which could change the canonical chain. // we depend on the canonical chain staying the same during this code block. - let _import_lock = self.import_lock.lock(); + let _import_lock = self.backend.get_import_lock().lock(); let info = self.backend.blockchain().info(); diff --git a/substrate/core/client/src/in_mem.rs b/substrate/core/client/src/in_mem.rs index 92d04230dd..dec10d40f7 100644 --- a/substrate/core/client/src/in_mem.rs +++ b/substrate/core/client/src/in_mem.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; use std::sync::Arc; -use parking_lot::RwLock; +use parking_lot::{RwLock, Mutex}; use primitives::{ChangesTrieConfiguration, storage::well_known_keys}; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{ @@ -541,6 +541,7 @@ where states: RwLock>>, changes_trie_storage: ChangesTrieStorage, blockchain: Blockchain, + import_lock: Mutex<()>, } impl Backend @@ -555,6 +556,7 @@ where states: RwLock::new(HashMap::new()), changes_trie_storage: ChangesTrieStorage(InMemoryChangesTrieStorage::new()), blockchain: Blockchain::new(), + import_lock: Default::default(), } } } @@ -684,6 +686,10 @@ where fn revert(&self, _n: NumberFor) -> error::Result> { Ok(Zero::zero()) } + + fn get_import_lock(&self) -> &Mutex<()> { + &self.import_lock + } } impl backend::LocalBackend for Backend diff --git a/substrate/core/client/src/light/backend.rs b/substrate/core/client/src/light/backend.rs index 0c2279bf3d..60b4c66c17 100644 --- a/substrate/core/client/src/light/backend.rs +++ b/substrate/core/client/src/light/backend.rs @@ -20,7 +20,7 @@ use std::collections::HashMap; use std::sync::{Arc, Weak}; use futures::{Future, IntoFuture}; -use parking_lot::RwLock; +use parking_lot::{RwLock, Mutex}; use runtime_primitives::{generic::BlockId, Justification, StorageOverlay, ChildrenStorageOverlay}; use state_machine::{Backend as StateBackend, TrieBackend, backend::InMemory as InMemoryState}; @@ -41,6 +41,7 @@ const IN_MEMORY_EXPECT_PROOF: &str = "InMemory state backend has Void error type pub struct Backend { blockchain: Arc>, genesis_state: RwLock>>, + import_lock: Mutex<()>, } /// Light block (header and justification) import operation. @@ -77,6 +78,7 @@ impl Backend { Self { blockchain, genesis_state: RwLock::new(None), + import_lock: Default::default(), } } @@ -213,6 +215,10 @@ impl ClientBackend for Backend where fn revert(&self, _n: NumberFor) -> ClientResult> { Err(ClientError::NotAvailableOnLightClient.into()) } + + fn get_import_lock(&self) -> &Mutex<()> { + &self.import_lock + } } impl RemoteBackend for Backend diff --git a/substrate/core/consensus/aura/Cargo.toml b/substrate/core/consensus/aura/Cargo.toml index 6e489cf8a9..446dcbff3a 100644 --- a/substrate/core/consensus/aura/Cargo.toml +++ b/substrate/core/consensus/aura/Cargo.toml @@ -23,7 +23,7 @@ authorities = { package = "substrate-consensus-authorities", path = "../authorit runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } futures = "0.1.17" tokio = "0.1.7" -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4" [dev-dependencies] diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs index 6f73c6ed65..36561645f0 100644 --- a/substrate/core/consensus/aura/src/lib.rs +++ b/substrate/core/consensus/aura/src/lib.rs @@ -886,7 +886,6 @@ mod tests { #[allow(deprecated)] let select_chain = LongestChain::new( client.backend().clone(), - client.import_lock().clone(), ); let environ = Arc::new(DummyFactory(client.clone())); import_notifications.push( diff --git a/substrate/core/consensus/babe/Cargo.toml b/substrate/core/consensus/babe/Cargo.toml index bc557ffb56..04cd42c680 100644 --- a/substrate/core/consensus/babe/Cargo.toml +++ b/substrate/core/consensus/babe/Cargo.toml @@ -24,7 +24,7 @@ slots = { package = "substrate-consensus-slots", path = "../slots" } runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } futures = "0.1.26" tokio = "0.1.18" -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4.6" schnorrkel = "0.1.1" rand = "0.6.5" diff --git a/substrate/core/consensus/babe/src/lib.rs b/substrate/core/consensus/babe/src/lib.rs index 12c388d329..0cb95c02df 100644 --- a/substrate/core/consensus/babe/src/lib.rs +++ b/substrate/core/consensus/babe/src/lib.rs @@ -975,7 +975,7 @@ mod tests { #[allow(deprecated)] - let select_chain = LongestChain::new(client.backend().clone(), client.import_lock().clone()); + let select_chain = LongestChain::new(client.backend().clone()); let babe = start_babe(BabeParams { config, diff --git a/substrate/core/consensus/common/Cargo.toml b/substrate/core/consensus/common/Cargo.toml index c2fc7cf231..3d133461e7 100644 --- a/substrate/core/consensus/common/Cargo.toml +++ b/substrate/core/consensus/common/Cargo.toml @@ -18,7 +18,7 @@ runtime_version = { package = "sr-version", path = "../../sr-version" } runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } tokio-timer = "0.2" parity-codec = { version = "3.3", features = ["derive"] } -parking_lot = "0.7.1" +parking_lot = "0.8.0" [dev-dependencies] test_client = { package = "substrate-test-client", path = "../../test-client" } diff --git a/substrate/core/consensus/rhd/Cargo.toml b/substrate/core/consensus/rhd/Cargo.toml index 3f0a79a863..ee1efb8d06 100644 --- a/substrate/core/consensus/rhd/Cargo.toml +++ b/substrate/core/consensus/rhd/Cargo.toml @@ -20,7 +20,7 @@ runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } runtime_version = { package = "sr-version", path = "../../sr-version" } runtime_io = { package = "sr-io", path = "../../sr-io" } tokio = "0.1.7" -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4" rhododendron = { version = "0.5.0", features = ["codec"] } exit-future = "0.1" diff --git a/substrate/core/consensus/slots/Cargo.toml b/substrate/core/consensus/slots/Cargo.toml index 2be9133d54..7a3b487dc6 100644 --- a/substrate/core/consensus/slots/Cargo.toml +++ b/substrate/core/consensus/slots/Cargo.toml @@ -14,7 +14,7 @@ consensus_common = { package = "substrate-consensus-common", path = "../common" inherents = { package = "substrate-inherents", path = "../../inherents" } futures = "0.1.17" tokio = "0.1.7" -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4" [dev-dependencies] diff --git a/substrate/core/executor/Cargo.toml b/substrate/core/executor/Cargo.toml index 8f39d35c79..9cc198557d 100644 --- a/substrate/core/executor/Cargo.toml +++ b/substrate/core/executor/Cargo.toml @@ -17,7 +17,7 @@ panic-handler = { package = "substrate-panic-handler", path = "../panic-handler" wasmi = { version = "0.4.3" } byteorder = "1.1" lazy_static = "1.0" -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4" libsecp256k1 = "0.2.1" tiny-keccak = "1.4.2" diff --git a/substrate/core/finality-grandpa/Cargo.toml b/substrate/core/finality-grandpa/Cargo.toml index 9d44c8ee3e..b00c646286 100644 --- a/substrate/core/finality-grandpa/Cargo.toml +++ b/substrate/core/finality-grandpa/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" fork-tree = { path = "../../core/util/fork-tree" } futures = "0.1" log = "0.4" -parking_lot = "0.7.1" +parking_lot = "0.8.0" tokio = "0.1.7" rand = "0.6" parity-codec = { version = "3.3", features = ["derive"] } diff --git a/substrate/core/finality-grandpa/src/tests.rs b/substrate/core/finality-grandpa/src/tests.rs index 7fc2509f41..18342e3a1e 100644 --- a/substrate/core/finality-grandpa/src/tests.rs +++ b/substrate/core/finality-grandpa/src/tests.rs @@ -121,8 +121,7 @@ impl TestNetFactory for GrandpaTestNet { PeersClient::Full(ref client) => { #[allow(deprecated)] let select_chain = LongestChain::new( - client.backend().clone(), - client.import_lock().clone() + client.backend().clone() ); let (import, link) = block_import( client.clone(), diff --git a/substrate/core/inherents/Cargo.toml b/substrate/core/inherents/Cargo.toml index a71661bd1d..606d9c5ae9 100644 --- a/substrate/core/inherents/Cargo.toml +++ b/substrate/core/inherents/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -parking_lot = { version = "0.7", optional = true } +parking_lot = { version = "0.8.0", optional = true } rstd = { package = "sr-std", path = "../sr-std", default-features = false } parity-codec = { version = "3.3", default-features = false, features = ["derive"] } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false } diff --git a/substrate/core/network-libp2p/Cargo.toml b/substrate/core/network-libp2p/Cargo.toml index e92738b902..8a03a1c511 100644 --- a/substrate/core/network-libp2p/Cargo.toml +++ b/substrate/core/network-libp2p/Cargo.toml @@ -13,7 +13,7 @@ bytes = "0.4" fnv = "1.0" futures = "0.1" libp2p = { version = "0.9.0", default-features = false, features = ["secp256k1", "libp2p-websocket"] } -parking_lot = "0.7.1" +parking_lot = "0.8.0" lazy_static = "1.2" log = "0.4" rand = "0.6" diff --git a/substrate/core/network/Cargo.toml b/substrate/core/network/Cargo.toml index 6576ccabbf..8fbf7daa9c 100644 --- a/substrate/core/network/Cargo.toml +++ b/substrate/core/network/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" [dependencies] derive_more = "0.14.0" log = "0.4" -parking_lot = "0.7.1" +parking_lot = "0.8.0" bitflags = "1.0" futures = "0.1.17" linked-hash-map = "0.5" diff --git a/substrate/core/offchain/Cargo.toml b/substrate/core/offchain/Cargo.toml index da2aeb4334..0672ebcc0c 100644 --- a/substrate/core/offchain/Cargo.toml +++ b/substrate/core/offchain/Cargo.toml @@ -13,7 +13,7 @@ futures = "0.1.25" log = "0.4" offchain-primitives = { package = "substrate-offchain-primitives", path = "./primitives" } parity-codec = { version = "3.3", features = ["derive"] } -parking_lot = "0.7.1" +parking_lot = "0.8.0" primitives = { package = "substrate-primitives", path = "../../core/primitives" } runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives" } tokio = "0.1.7" diff --git a/substrate/core/rpc/Cargo.toml b/substrate/core/rpc/Cargo.toml index a7337858d8..c621f71a43 100644 --- a/substrate/core/rpc/Cargo.toml +++ b/substrate/core/rpc/Cargo.toml @@ -11,7 +11,7 @@ jsonrpc-core-client = "12.0.0" jsonrpc-pubsub = "12.0.0" jsonrpc-derive = "12.0.0" log = "0.4" -parking_lot = "0.7.1" +parking_lot = "0.8.0" parity-codec = "3.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/substrate/core/service/Cargo.toml b/substrate/core/service/Cargo.toml index 89804166d6..0a0cd91553 100644 --- a/substrate/core/service/Cargo.toml +++ b/substrate/core/service/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] derive_more = "0.14.0" futures = "0.1.17" -parking_lot = "0.7.1" +parking_lot = "0.8.0" lazy_static = "1.0" log = "0.4" slog = {version = "^2", features = ["nested-values"]} diff --git a/substrate/core/service/src/lib.rs b/substrate/core/service/src/lib.rs index 92b7a06d38..5129944c54 100644 --- a/substrate/core/service/src/lib.rs +++ b/substrate/core/service/src/lib.rs @@ -622,7 +622,8 @@ impl network::TransactionPool, ComponentBlock< /// { |_, client| Ok(BasicQueue::new(Arc::new(MyVerifier), client, None, None, None)) }, /// SelectChain = LongestChain, Self::Block> /// { |config: &FactoryFullConfiguration, client: Arc>| { -/// Ok(LongestChain::new(client.backend().clone(), client.import_lock())) +/// #[allow(deprecated)] +/// Ok(LongestChain::new(client.backend().clone())) /// }}, /// FinalityProofProvider = { |client: Arc>| { /// Ok(Some(Arc::new(grandpa::FinalityProofProvider::new(client.clone(), client)) as _)) diff --git a/substrate/core/state-db/Cargo.toml b/substrate/core/state-db/Cargo.toml index 6f2ac70a30..8c02dbc450 100644 --- a/substrate/core/state-db/Cargo.toml +++ b/substrate/core/state-db/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -parking_lot = "0.7.1" +parking_lot = "0.8.0" log = "0.4" primitives = { package = "substrate-primitives", path = "../../core/primitives" } parity-codec = { version = "3.3", features = ["derive"] } diff --git a/substrate/core/state-machine/Cargo.toml b/substrate/core/state-machine/Cargo.toml index 222c543f54..b1cb98ae80 100644 --- a/substrate/core/state-machine/Cargo.toml +++ b/substrate/core/state-machine/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] log = "0.4" -parking_lot = "0.7.1" +parking_lot = "0.8.0" hash-db = "0.12" trie-db = "0.12" trie-root = "0.12" diff --git a/substrate/core/telemetry/Cargo.toml b/substrate/core/telemetry/Cargo.toml index d1fa12abe2..f61d6bc4d3 100644 --- a/substrate/core/telemetry/Cargo.toml +++ b/substrate/core/telemetry/Cargo.toml @@ -6,7 +6,7 @@ description = "Telemetry utils" edition = "2018" [dependencies] -parking_lot = "0.7.1" +parking_lot = "0.8.0" lazy_static = "1.0" log = "0.4" rand = "0.6" diff --git a/substrate/core/test-client/src/lib.rs b/substrate/core/test-client/src/lib.rs index 7a176a6c31..f39ad86b64 100644 --- a/substrate/core/test-client/src/lib.rs +++ b/substrate/core/test-client/src/lib.rs @@ -237,7 +237,7 @@ impl TestClientBuilder where ).expect("Creates new client"); #[allow(deprecated)] - let longest_chain = client::LongestChain::new(self.backend, client.import_lock()); + let longest_chain = client::LongestChain::new(self.backend); (client, longest_chain) } diff --git a/substrate/core/transaction-pool/Cargo.toml b/substrate/core/transaction-pool/Cargo.toml index 5b2c2350af..ed2cd27833 100644 --- a/substrate/core/transaction-pool/Cargo.toml +++ b/substrate/core/transaction-pool/Cargo.toml @@ -9,7 +9,7 @@ derive_more = "0.14.0" futures = "0.1" log = "0.4" parity-codec = "3.3" -parking_lot = "0.7.1" +parking_lot = "0.8.0" sr-primitives = { path = "../sr-primitives" } client = { package = "substrate-client", path = "../client" } substrate-primitives = { path = "../primitives" } diff --git a/substrate/core/transaction-pool/graph/Cargo.toml b/substrate/core/transaction-pool/graph/Cargo.toml index 0ebc74b7da..3f918efa4a 100644 --- a/substrate/core/transaction-pool/graph/Cargo.toml +++ b/substrate/core/transaction-pool/graph/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" derive_more = "0.14.0" futures = "0.1" log = "0.4" -parking_lot = "0.7.1" +parking_lot = "0.8.0" serde = { version = "1.0", features = ["derive"] } substrate-primitives = { path = "../../primitives" } sr-primitives = { path = "../../sr-primitives" } diff --git a/substrate/node-template/Cargo.toml b/substrate/node-template/Cargo.toml index 69f9c884cd..e78bb2d27e 100644 --- a/substrate/node-template/Cargo.toml +++ b/substrate/node-template/Cargo.toml @@ -16,7 +16,7 @@ ctrlc = { version = "3.0", features = ["termination"] } log = "0.4" tokio = "0.1" exit-future = "0.1" -parking_lot = "0.7.1" +parking_lot = "0.8.0" parity-codec = "3.3" trie-root = "0.12.2" sr-io = { path = "../core/sr-io" } diff --git a/substrate/node-template/src/service.rs b/substrate/node-template/src/service.rs index 934cf87b9c..c8f5dfc0a1 100644 --- a/substrate/node-template/src/service.rs +++ b/substrate/node-template/src/service.rs @@ -129,10 +129,7 @@ construct_service_factory! { SelectChain = LongestChain, Self::Block> { |config: &FactoryFullConfiguration, client: Arc>| { #[allow(deprecated)] - Ok(LongestChain::new( - client.backend().clone(), - client.import_lock() - )) + Ok(LongestChain::new(client.backend().clone())) } }, FinalityProofProvider = { |_client: Arc>| { diff --git a/substrate/node/cli/src/service.rs b/substrate/node/cli/src/service.rs index 2991bfe377..415ddbe71b 100644 --- a/substrate/node/cli/src/service.rs +++ b/substrate/node/cli/src/service.rs @@ -205,10 +205,7 @@ construct_service_factory! { SelectChain = LongestChain, Self::Block> { |config: &FactoryFullConfiguration, client: Arc>| { #[allow(deprecated)] - Ok(LongestChain::new( - client.backend().clone(), - client.import_lock() - )) + Ok(LongestChain::new(client.backend().clone())) } }, FinalityProofProvider = { |client: Arc>| { diff --git a/substrate/srml/aura/Cargo.toml b/substrate/srml/aura/Cargo.toml index 6a437ce71a..82027871b4 100644 --- a/substrate/srml/aura/Cargo.toml +++ b/substrate/srml/aura/Cargo.toml @@ -18,7 +18,7 @@ session = { package = "srml-session", path = "../session", default-features = fa [dev-dependencies] lazy_static = "1.0" -parking_lot = "0.7.1" +parking_lot = "0.8.0" substrate-primitives = { path = "../../core/primitives" } runtime_io = { package = "sr-io", path = "../../core/sr-io" } consensus = { package = "srml-consensus", path = "../consensus" } diff --git a/substrate/srml/babe/Cargo.toml b/substrate/srml/babe/Cargo.toml index 0c25a98948..0f189dfcda 100644 --- a/substrate/srml/babe/Cargo.toml +++ b/substrate/srml/babe/Cargo.toml @@ -20,7 +20,7 @@ babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../ [dev-dependencies] lazy_static = "1.3.0" -parking_lot = "0.7.1" +parking_lot = "0.8.0" substrate-primitives = { path = "../../core/primitives" } runtime_io = { package = "sr-io", path = "../../core/sr-io" } consensus = { package = "srml-consensus", path = "../consensus" } diff --git a/substrate/srml/finality-tracker/Cargo.toml b/substrate/srml/finality-tracker/Cargo.toml index c7006a3c3e..e6cf47ab25 100644 --- a/substrate/srml/finality-tracker/Cargo.toml +++ b/substrate/srml/finality-tracker/Cargo.toml @@ -17,7 +17,7 @@ srml-system = { path = "../system", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } sr-io = { path = "../../core/sr-io", default-features = false } lazy_static = "1.0" -parking_lot = "0.7" +parking_lot = "0.8.0" [features] default = ["std"]