From 47b7a4e716bfed27811e87983122199a49fac1b3 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 1 Jun 2020 14:10:35 -0400 Subject: [PATCH 01/12] Bump jsonrpc pubsub, core, http, and ws Right now these are the packages which _need_ to be updated so I can just the latest `jsonrpc-pubsub` code. Once a release it cut upstream the rest of the dependencies should be updated as well. --- Cargo.lock | 77 ++++++++++++++++++++++------------- client/rpc-api/Cargo.toml | 4 +- client/rpc-servers/Cargo.toml | 8 ++-- client/rpc/Cargo.toml | 4 +- 4 files changed, 57 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06b1b42b10453..44667a2e20b73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2342,14 +2342,26 @@ dependencies = [ "failure", "futures 0.1.29", "hyper 0.12.35", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-pubsub 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "serde", "serde_json", "url 1.7.2", ] +[[package]] +name = "jsonrpc-core" +version = "14.1.0" +source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +dependencies = [ + "futures 0.1.29", + "log", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "jsonrpc-core" version = "14.1.0" @@ -2387,11 +2399,10 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" version = "14.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52860f0549694aa4abb12766856f56952ab46d3fb9f0815131b2db3d9cc2f29" +source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" dependencies = [ "hyper 0.12.35", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-server-utils", "log", "net2", @@ -2399,13 +2410,25 @@ dependencies = [ "unicase", ] +[[package]] +name = "jsonrpc-pubsub" +version = "14.1.0" +source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +dependencies = [ + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "log", + "parking_lot 0.10.2", + "rand 0.7.3", + "serde", +] + [[package]] name = "jsonrpc-pubsub" version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4ca5e391d6c6a2261d4adca029f427fe63ea546ad6cef2957c654c08495ec16" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "parking_lot 0.10.2", "serde", @@ -2414,12 +2437,11 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" version = "14.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f06add502b48351e05dd95814835327fb115e4e9f834ca42fd522d3b769d4d2" +source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" dependencies = [ "bytes 0.4.12", "globset", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "lazy_static", "log", "tokio 0.1.22", @@ -2430,10 +2452,9 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" version = "14.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017a7dd5083d9ed62c5e1dd3e317975c33c3115dac5447f4480fe05a8c354754" +source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-server-utils", "log", "parking_lot 0.10.2", @@ -3392,7 +3413,7 @@ version = "2.0.0-rc2" dependencies = [ "futures 0.3.4", "futures-timer 3.0.2", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p", "node-cli", "sc-rpc-api", @@ -3413,7 +3434,7 @@ dependencies = [ "frame-system", "futures 0.3.4", "hex-literal", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "nix", "node-executor", @@ -3544,7 +3565,7 @@ dependencies = [ name = "node-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives", "node-runtime", "pallet-contracts-rpc", @@ -4087,7 +4108,7 @@ dependencies = [ name = "pallet-contracts-rpc" version = "0.8.0-rc2" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "pallet-contracts-primitives", @@ -4643,7 +4664,7 @@ dependencies = [ name = "pallet-transaction-payment-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", @@ -6139,7 +6160,7 @@ version = "0.8.0-rc2" dependencies = [ "derive_more", "futures 0.3.4", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "sc-consensus", @@ -6181,7 +6202,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "futures 0.3.4", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -6396,7 +6417,7 @@ dependencies = [ "derive_more", "finality-grandpa", "futures 0.3.4", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -6603,8 +6624,8 @@ dependencies = [ "futures 0.1.29", "futures 0.3.4", "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "lazy_static", "log", "parity-scale-codec", @@ -6640,10 +6661,10 @@ version = "0.8.0-rc2" dependencies = [ "derive_more", "futures 0.3.4", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", - "jsonrpc-pubsub", + "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "log", "parity-scale-codec", "parking_lot 0.10.2", @@ -6661,9 +6682,9 @@ dependencies = [ name = "sc-rpc-server" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-http-server", - "jsonrpc-pubsub", + "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-ws-server", "log", "serde", @@ -8109,7 +8130,7 @@ dependencies = [ "frame-system", "futures 0.3.4", "jsonrpc-client-transports", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "sc-rpc-api", "serde", @@ -8124,7 +8145,7 @@ dependencies = [ "env_logger 0.7.1", "frame-system-rpc-runtime-api", "futures 0.3.4", - "jsonrpc-core", + "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client", "jsonrpc-derive", "log", diff --git a/client/rpc-api/Cargo.toml b/client/rpc-api/Cargo.toml index 1075c3a11c810..d4642e8711d6b 100644 --- a/client/rpc-api/Cargo.toml +++ b/client/rpc-api/Cargo.toml @@ -15,10 +15,10 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } derive_more = "0.99.2" futures = { version = "0.3.1", features = ["compat"] } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" -jsonrpc-pubsub = "14.0.3" +jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } log = "0.4.8" parking_lot = "0.10.0" sp-core = { version = "2.0.0-rc2", path = "../../primitives/core" } diff --git a/client/rpc-servers/Cargo.toml b/client/rpc-servers/Cargo.toml index 401f5f4882530..e0d01c88f0a13 100644 --- a/client/rpc-servers/Cargo.toml +++ b/client/rpc-servers/Cargo.toml @@ -12,13 +12,13 @@ description = "Substrate RPC servers." targets = ["x86_64-unknown-linux-gnu"] [dependencies] -jsonrpc-core = "14.0.3" -pubsub = { package = "jsonrpc-pubsub", version = "14.0.3" } +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } +pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } log = "0.4.8" serde = "1.0.101" serde_json = "1.0.41" sp-runtime = { version = "2.0.0-rc2", path = "../../primitives/runtime" } [target.'cfg(not(target_os = "unknown"))'.dependencies] -http = { package = "jsonrpc-http-server", version = "14.0.3" } -ws = { package = "jsonrpc-ws-server", version = "14.0.3" } +http = { package = "jsonrpc-http-server", git = "https://github.com/paritytech/jsonrpc" } +ws = { package = "jsonrpc-ws-server", git = "https://github.com/paritytech/jsonrpc" } diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 62f93195758b9..3ba0907fb9611 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -17,10 +17,10 @@ sc-client-api = { version = "2.0.0-rc2", path = "../api" } sp-api = { version = "2.0.0-rc2", path = "../../primitives/api" } codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.1", features = ["compat"] } -jsonrpc-pubsub = "14.0.3" +jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } log = "0.4.8" sp-core = { version = "2.0.0-rc2", path = "../../primitives/core" } -rpc = { package = "jsonrpc-core", version = "14.0.3" } +rpc = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } sp-version = { version = "2.0.0-rc2", path = "../../primitives/version" } serde_json = "1.0.41" sp-session = { version = "2.0.0-rc2", path = "../../primitives/session" } From f0ec533b0e9bdf62a0c25b91770d66c0a64d1272 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 1 Jun 2020 15:34:19 -0400 Subject: [PATCH 02/12] Use jsonrpc-pubsub's SubscriptionManager This places sc-rpc-api::Subscriptions --- client/rpc-api/src/lib.rs | 1 - client/rpc/src/author/mod.rs | 8 ++++---- client/rpc/src/chain/chain_full.rs | 8 ++++---- client/rpc/src/chain/chain_light.rs | 8 ++++---- client/rpc/src/chain/mod.rs | 11 +++++------ client/rpc/src/lib.rs | 2 +- client/rpc/src/state/mod.rs | 8 ++++---- client/rpc/src/state/state_full.rs | 8 ++++---- client/rpc/src/state/state_light.rs | 8 ++++---- 9 files changed, 30 insertions(+), 32 deletions(-) diff --git a/client/rpc-api/src/lib.rs b/client/rpc-api/src/lib.rs index f742d73b692c0..d58eabcab36ea 100644 --- a/client/rpc-api/src/lib.rs +++ b/client/rpc-api/src/lib.rs @@ -26,7 +26,6 @@ mod policy; mod subscriptions; pub use jsonrpc_core::IoHandlerExtension as RpcExtension; -pub use subscriptions::{Subscriptions, TaskExecutor}; pub use helpers::Receiver; pub use policy::DenyUnsafe; diff --git a/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index d59fad354ef3c..ecf838dfdd864 100644 --- a/client/rpc/src/author/mod.rs +++ b/client/rpc/src/author/mod.rs @@ -32,8 +32,8 @@ use rpc::futures::{ }; use futures::{StreamExt as _, compat::Compat}; use futures::future::{ready, FutureExt, TryFutureExt}; -use sc_rpc_api::{DenyUnsafe, Subscriptions}; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; +use sc_rpc_api::DenyUnsafe; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use codec::{Encode, Decode}; use sp_core::{Bytes, traits::BareCryptoStorePtr}; use sp_api::ProvideRuntimeApi; @@ -55,7 +55,7 @@ pub struct Author { /// Transactions pool pool: Arc

, /// Subscriptions manager - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, /// The key store. keystore: BareCryptoStorePtr, /// Whether to deny unsafe calls @@ -67,7 +67,7 @@ impl Author { pub fn new( client: Arc, pool: Arc

, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, keystore: BareCryptoStorePtr, deny_unsafe: DenyUnsafe, ) -> Self { diff --git a/client/rpc/src/chain/chain_full.rs b/client/rpc/src/chain/chain_full.rs index c1b062754bdac..816dbba866417 100644 --- a/client/rpc/src/chain/chain_full.rs +++ b/client/rpc/src/chain/chain_full.rs @@ -18,8 +18,8 @@ use std::sync::Arc; use rpc::futures::future::result; +use jsonrpc_pubsub::manager::SubscriptionManager; -use sc_rpc_api::Subscriptions; use sc_client_api::{BlockchainEvents, BlockBackend}; use sp_runtime::{generic::{BlockId, SignedBlock}, traits::{Block as BlockT}}; @@ -32,14 +32,14 @@ pub struct FullChain { /// Substrate client. client: Arc, /// Current subscriptions. - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, /// phantom member to pin the block type _phantom: PhantomData, } impl FullChain { /// Create new Chain API RPC handler. - pub fn new(client: Arc, subscriptions: Subscriptions) -> Self { + pub fn new(client: Arc, subscriptions: SubscriptionManager) -> Self { Self { client, subscriptions, @@ -56,7 +56,7 @@ impl ChainBackend for FullChain whe &self.client } - fn subscriptions(&self) -> &Subscriptions { + fn subscriptions(&self) -> &SubscriptionManager { &self.subscriptions } diff --git a/client/rpc/src/chain/chain_light.rs b/client/rpc/src/chain/chain_light.rs index 059233089d05d..8a4afbed71c16 100644 --- a/client/rpc/src/chain/chain_light.rs +++ b/client/rpc/src/chain/chain_light.rs @@ -19,8 +19,8 @@ use std::sync::Arc; use futures::{future::ready, FutureExt, TryFutureExt}; use rpc::futures::future::{result, Future, Either}; +use jsonrpc_pubsub::manager::SubscriptionManager; -use sc_rpc_api::Subscriptions; use sc_client_api::light::{Fetcher, RemoteBodyRequest, RemoteBlockchain}; use sp_runtime::{ generic::{BlockId, SignedBlock}, @@ -37,7 +37,7 @@ pub struct LightChain { /// Substrate client. client: Arc, /// Current subscriptions. - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, /// Remote blockchain reference remote_blockchain: Arc>, /// Remote fetcher reference. @@ -48,7 +48,7 @@ impl> LightChain { /// Create new Chain API RPC handler. pub fn new( client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, remote_blockchain: Arc>, fetcher: Arc, ) -> Self { @@ -70,7 +70,7 @@ impl ChainBackend for LightChain &Subscriptions { + fn subscriptions(&self) -> &SubscriptionManager { &self.subscriptions } diff --git a/client/rpc/src/chain/mod.rs b/client/rpc/src/chain/mod.rs index 6d53fbbb06f6e..7b13e7a6005ff 100644 --- a/client/rpc/src/chain/mod.rs +++ b/client/rpc/src/chain/mod.rs @@ -32,9 +32,8 @@ use rpc::{ futures::{stream, Future, Sink, Stream}, }; -use sc_rpc_api::Subscriptions; use sc_client_api::{BlockchainEvents, light::{Fetcher, RemoteBlockchain}}; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use sp_rpc::{number::NumberOrHex, list::ListOrValue}; use sp_runtime::{ generic::{BlockId, SignedBlock}, @@ -57,7 +56,7 @@ trait ChainBackend: Send + Sync + 'static fn client(&self) -> &Arc; /// Get subscriptions reference. - fn subscriptions(&self) -> &Subscriptions; + fn subscriptions(&self) -> &SubscriptionManager; /// Tries to unwrap passed block hash, or uses best block hash otherwise. fn unwrap_or_best(&self, hash: Option) -> Block::Hash { @@ -177,7 +176,7 @@ trait ChainBackend: Send + Sync + 'static /// Create new state API that works on full node. pub fn new_full( client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, ) -> Chain where Block: BlockT + 'static, @@ -191,7 +190,7 @@ pub fn new_full( /// Create new state API that works on light node. pub fn new_light>( client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, remote_blockchain: Arc>, fetcher: Arc, ) -> Chain @@ -279,7 +278,7 @@ impl ChainApi, Block::Hash, Block::Header, Signe /// Subscribe to new headers. fn subscribe_headers( client: &Arc, - subscriptions: &Subscriptions, + subscriptions: &SubscriptionManager, subscriber: Subscriber, best_block_hash: G, stream: F, diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index f979b0ab6957e..53a63b449c87e 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -24,7 +24,7 @@ mod metadata; -pub use sc_rpc_api::{DenyUnsafe, Subscriptions}; +pub use sc_rpc_api::DenyUnsafe; pub use self::metadata::Metadata; pub use rpc::IoHandlerExtension as RpcExtension; diff --git a/client/rpc/src/state/mod.rs b/client/rpc/src/state/mod.rs index 168dc3e0105a4..921cc7efc699d 100644 --- a/client/rpc/src/state/mod.rs +++ b/client/rpc/src/state/mod.rs @@ -25,10 +25,10 @@ mod state_light; mod tests; use std::sync::Arc; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use rpc::{Result as RpcResult, futures::{Future, future::result}}; -use sc_rpc_api::{Subscriptions, state::ReadProof}; +use sc_rpc_api::state::ReadProof; use sc_client_api::light::{RemoteBlockchain, Fetcher}; use sp_core::{Bytes, storage::{StorageKey, PrefixedStorageKey, StorageData, StorageChangeSet}}; use sp_version::RuntimeVersion; @@ -170,7 +170,7 @@ pub trait StateBackend: Send + Sync + 'static /// Create new state API that works on full node. pub fn new_full( client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, ) -> (State, ChildState) where Block: BlockT + 'static, @@ -191,7 +191,7 @@ pub fn new_full( /// Create new state API that works on light node. pub fn new_light>( client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, remote_blockchain: Arc>, fetcher: Arc, ) -> (State, ChildState) diff --git a/client/rpc/src/state/state_full.rs b/client/rpc/src/state/state_full.rs index 82f87e9acf223..f0ae79a033b58 100644 --- a/client/rpc/src/state/state_full.rs +++ b/client/rpc/src/state/state_full.rs @@ -21,10 +21,10 @@ use std::sync::Arc; use std::ops::Range; use futures::{future, StreamExt as _, TryStreamExt as _}; use log::warn; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use rpc::{Result as RpcResult, futures::{stream, Future, Sink, Stream, future::result}}; -use sc_rpc_api::{Subscriptions, state::ReadProof}; +use sc_rpc_api::state::ReadProof; use sc_client_api::backend::Backend; use sp_blockchain::{Result as ClientResult, Error as ClientError, HeaderMetadata, CachedHeaderMetadata, HeaderBackend}; use sc_client_api::BlockchainEvents; @@ -60,7 +60,7 @@ struct QueryStorageRange { /// State API backend for full nodes. pub struct FullState { client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, _phantom: PhantomData<(BE, Block)> } @@ -72,7 +72,7 @@ impl FullState Block: BlockT + 'static, { /// Create new state API backend for full nodes. - pub fn new(client: Arc, subscriptions: Subscriptions) -> Self { + pub fn new(client: Arc, subscriptions: SubscriptionManager) -> Self { Self { client, subscriptions, _phantom: PhantomData } } diff --git a/client/rpc/src/state/state_light.rs b/client/rpc/src/state/state_light.rs index af5d4248e3a42..ec275a2d78b79 100644 --- a/client/rpc/src/state/state_light.rs +++ b/client/rpc/src/state/state_light.rs @@ -28,7 +28,7 @@ use futures::{ StreamExt as _, TryStreamExt as _, }; use hash_db::Hasher; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use log::warn; use parking_lot::Mutex; use rpc::{ @@ -38,7 +38,7 @@ use rpc::{ futures::stream::Stream, }; -use sc_rpc_api::{Subscriptions, state::ReadProof}; +use sc_rpc_api::state::ReadProof; use sp_blockchain::{Error as ClientError, HeaderBackend}; use sc_client_api::{ BlockchainEvents, @@ -63,7 +63,7 @@ type StorageMap = HashMap>; #[derive(Clone)] pub struct LightState, Client> { client: Arc, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, version_subscriptions: SimpleSubscriptions, storage_subscriptions: Arc>>, remote_blockchain: Arc>, @@ -143,7 +143,7 @@ impl + 'static, Client> LightState, - subscriptions: Subscriptions, + subscriptions: SubscriptionManager, remote_blockchain: Arc>, fetcher: Arc, ) -> Self { From 51d67c54feff6acf3049a08efab895559e3b7ad7 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 1 Jun 2020 16:04:56 -0400 Subject: [PATCH 03/12] Bump jsonrpc-core outside of sc-rpc-* --- Cargo.lock | 13 +++++++------ bin/node/rpc/Cargo.toml | 2 +- client/consensus/babe/rpc/Cargo.toml | 2 +- client/finality-grandpa/rpc/Cargo.toml | 2 +- client/service/Cargo.toml | 1 + client/service/src/builder.rs | 3 ++- frame/contracts/rpc/Cargo.toml | 2 +- frame/transaction-payment/rpc/Cargo.toml | 2 +- utils/frame/rpc/system/Cargo.toml | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44667a2e20b73..7727776719dc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3565,7 +3565,7 @@ dependencies = [ name = "node-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "node-primitives", "node-runtime", "pallet-contracts-rpc", @@ -4108,7 +4108,7 @@ dependencies = [ name = "pallet-contracts-rpc" version = "0.8.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", "pallet-contracts-primitives", @@ -4664,7 +4664,7 @@ dependencies = [ name = "pallet-transaction-payment-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", @@ -6160,7 +6160,7 @@ version = "0.8.0-rc2" dependencies = [ "derive_more", "futures 0.3.4", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", "sc-consensus", @@ -6417,7 +6417,7 @@ dependencies = [ "derive_more", "finality-grandpa", "futures 0.3.4", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -6715,6 +6715,7 @@ dependencies = [ "futures 0.3.4", "futures-timer 3.0.2", "hash-db", + "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "lazy_static", "log", "netstat2", @@ -8145,7 +8146,7 @@ dependencies = [ "env_logger 0.7.1", "frame-system-rpc-runtime-api", "futures 0.3.4", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-core-client", "jsonrpc-derive", "log", diff --git a/bin/node/rpc/Cargo.toml b/bin/node/rpc/Cargo.toml index 00b8be99b1ef1..6a9ada7397d7b 100644 --- a/bin/node/rpc/Cargo.toml +++ b/bin/node/rpc/Cargo.toml @@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sc-client-api = { version = "2.0.0-rc2", path = "../../../client/api" } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } node-primitives = { version = "2.0.0-rc2", path = "../primitives" } node-runtime = { version = "2.0.0-rc2", path = "../runtime" } sp-runtime = { version = "2.0.0-rc2", path = "../../../primitives/runtime" } diff --git a/client/consensus/babe/rpc/Cargo.toml b/client/consensus/babe/rpc/Cargo.toml index 20f7e48758787..2868835b2e7fa 100644 --- a/client/consensus/babe/rpc/Cargo.toml +++ b/client/consensus/babe/rpc/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sc-consensus-babe = { version = "0.8.0-rc2", path = "../" } sc-rpc-api = { version = "0.8.0-rc2", path = "../../../rpc-api" } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" sp-consensus-babe = { version = "0.8.0-rc2", path = "../../../../primitives/consensus/babe" } diff --git a/client/finality-grandpa/rpc/Cargo.toml b/client/finality-grandpa/rpc/Cargo.toml index e1724c6c4e292..efb8f3fd91f1e 100644 --- a/client/finality-grandpa/rpc/Cargo.toml +++ b/client/finality-grandpa/rpc/Cargo.toml @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] sc-finality-grandpa = { version = "0.8.0-rc2", path = "../" } finality-grandpa = { version = "0.12.3", features = ["derive-codec"] } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.3" jsonrpc-derive = "14.0.3" futures = { version = "0.3.4", features = ["compat"] } diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index fc5991bc3f131..74dec6ffca23a 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -26,6 +26,7 @@ test-helpers = [] derive_more = "0.99.2" futures01 = { package = "futures", version = "0.1.29" } futures = { version = "0.3.4", features = ["compat"] } +jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } rand = "0.7.3" parking_lot = "0.10.0" lazy_static = "1.4.0" diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index d921606ea6b16..d400a1350ce1d 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -36,6 +36,7 @@ use futures::{ Future, FutureExt, StreamExt, future::ready, }; +use jsonrpc_pubsub::manager::SubscriptionManager; use sc_keystore::Store as Keystore; use log::{info, warn, error}; use sc_network::config::{Role, FinalityProofProvider, OnDemand, BoxFinalityProofRequestBuilder}; @@ -1185,7 +1186,7 @@ ServiceBuilder< chain_type: chain_spec.chain_type().clone(), }; - let subscriptions = sc_rpc::Subscriptions::new(Arc::new(task_manager.spawn_handle())); + let subscriptions = SubscriptionManager::new(Arc::new(task_manager.spawn_handle())); let (chain, state, child_state) = if let (Some(remote_backend), Some(on_demand)) = (remote_backend.as_ref(), on_demand.as_ref()) { diff --git a/frame/contracts/rpc/Cargo.toml b/frame/contracts/rpc/Cargo.toml index 8ed233ed79f7d..37728687017eb 100644 --- a/frame/contracts/rpc/Cargo.toml +++ b/frame/contracts/rpc/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0" } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" sp-blockchain = { version = "2.0.0-rc2", path = "../../../primitives/blockchain" } diff --git a/frame/transaction-payment/rpc/Cargo.toml b/frame/transaction-payment/rpc/Cargo.toml index 3ca2f4be8e308..2f2401ab4988c 100644 --- a/frame/transaction-payment/rpc/Cargo.toml +++ b/frame/transaction-payment/rpc/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0" } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } diff --git a/utils/frame/rpc/system/Cargo.toml b/utils/frame/rpc/system/Cargo.toml index f757e811fb96d..f86977b36924e 100644 --- a/utils/frame/rpc/system/Cargo.toml +++ b/utils/frame/rpc/system/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] sc-client-api = { version = "2.0.0-rc2", path = "../../../../client/api" } codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.4", features = ["compat"] } -jsonrpc-core = "14.0.3" +jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } jsonrpc-core-client = "14.0.5" jsonrpc-derive = "14.0.3" log = "0.4.8" From d54602fe82c95baaa841c0030c37cb3cab87046a Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 1 Jun 2020 17:32:48 -0400 Subject: [PATCH 04/12] Update client/rpc tests Right now one of the `author` tests is failing, I need to think a bit about how best to fix it. --- client/rpc/src/author/mod.rs | 3 +-- client/rpc/src/author/tests.rs | 8 ++++++-- client/rpc/src/chain/tests.rs | 29 +++++++++++++++++++---------- client/rpc/src/state/tests.rs | 32 +++++++++++++++++++++----------- 4 files changed, 47 insertions(+), 25 deletions(-) diff --git a/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index ecf838dfdd864..46d89fc4f7728 100644 --- a/client/rpc/src/author/mod.rs +++ b/client/rpc/src/author/mod.rs @@ -33,7 +33,7 @@ use rpc::futures::{ use futures::{StreamExt as _, compat::Compat}; use futures::future::{ready, FutureExt, TryFutureExt}; use sc_rpc_api::DenyUnsafe; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::{SubscriptionManager, NumericIdProvider}}; use codec::{Encode, Decode}; use sp_core::{Bytes, traits::BareCryptoStorePtr}; use sp_api::ProvideRuntimeApi; @@ -81,7 +81,6 @@ impl Author { } } - /// Currently we treat all RPC transactions as externals. /// /// Possibly in the future we could allow opt-in for special treatment diff --git a/client/rpc/src/author/tests.rs b/client/rpc/src/author/tests.rs index 8c1b82028bd79..1c80f76d790ca 100644 --- a/client/rpc/src/author/tests.rs +++ b/client/rpc/src/author/tests.rs @@ -81,7 +81,7 @@ impl TestSetup { Author { client: self.client.clone(), pool: self.pool.clone(), - subscriptions: Subscriptions::new(Arc::new(crate::testing::TaskExecutor)), + subscriptions: SubscriptionManager::new(Arc::new(crate::testing::TaskExecutor)), keystore: self.keystore.clone(), deny_unsafe: DenyUnsafe::No, } @@ -134,7 +134,11 @@ fn should_watch_extrinsic() { ); // then - assert_eq!(executor::block_on(id_rx.compat()), Ok(Ok(1.into()))); + assert!(matches!( + executor::block_on(id_rx.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); + // check notifications let replacement = { let tx = Transfer { diff --git a/client/rpc/src/chain/tests.rs b/client/rpc/src/chain/tests.rs index e86d1d547fbde..68d46135e36b1 100644 --- a/client/rpc/src/chain/tests.rs +++ b/client/rpc/src/chain/tests.rs @@ -31,7 +31,7 @@ use crate::testing::TaskExecutor; #[test] fn should_return_header() { let client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); assert_matches!( api.header(Some(client.genesis_hash()).into()).wait(), @@ -63,7 +63,7 @@ fn should_return_header() { #[test] fn should_return_a_block() { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); let block = client.new_block(Default::default()).unwrap().build().unwrap().block; let block_hash = block.hash(); @@ -114,7 +114,7 @@ fn should_return_a_block() { #[test] fn should_return_block_hash() { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); assert_matches!( api.block_hash(None.into()), @@ -158,7 +158,7 @@ fn should_return_block_hash() { #[test] fn should_return_finalized_hash() { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); assert_matches!( api.finalized_head(), @@ -188,12 +188,15 @@ fn should_notify_about_latest_block() { { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); api.subscribe_all_heads(Default::default(), subscriber); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); let block = client.new_block(Default::default()).unwrap().build().unwrap().block; client.import(BlockOrigin::Own, block).unwrap(); @@ -215,12 +218,15 @@ fn should_notify_about_best_block() { { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); api.subscribe_new_heads(Default::default(), subscriber); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); let block = client.new_block(Default::default()).unwrap().build().unwrap().block; client.import(BlockOrigin::Own, block).unwrap(); @@ -242,12 +248,15 @@ fn should_notify_about_finalized_block() { { let mut client = Arc::new(substrate_test_runtime_client::new()); - let api = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let api = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); api.subscribe_finalized_heads(Default::default(), subscriber); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); let block = client.new_block(Default::default()).unwrap().build().unwrap().block; client.import(BlockOrigin::Own, block).unwrap(); diff --git a/client/rpc/src/state/tests.rs b/client/rpc/src/state/tests.rs index a610cbbfc8285..0cc16ce8d5e92 100644 --- a/client/rpc/src/state/tests.rs +++ b/client/rpc/src/state/tests.rs @@ -55,7 +55,7 @@ fn should_return_storage() { .add_extra_child_storage(&child_info, KEY.to_vec(), CHILD_VALUE.to_vec()) .build(); let genesis_hash = client.genesis_hash(); - let (client, child) = new_full(Arc::new(client), Subscriptions::new(Arc::new(TaskExecutor))); + let (client, child) = new_full(Arc::new(client), SubscriptionManager::new(Arc::new(TaskExecutor))); let key = StorageKey(KEY.to_vec()); assert_eq!( @@ -90,7 +90,7 @@ fn should_return_child_storage() { .add_child_storage(&child_info, "key", vec![42_u8]) .build()); let genesis_hash = client.genesis_hash(); - let (_client, child) = new_full(client, Subscriptions::new(Arc::new(TaskExecutor))); + let (_client, child) = new_full(client, SubscriptionManager::new(Arc::new(TaskExecutor))); let child_key = prefixed_storage_key(); let key = StorageKey(b"key".to_vec()); @@ -125,7 +125,7 @@ fn should_return_child_storage() { fn should_call_contract() { let client = Arc::new(substrate_test_runtime_client::new()); let genesis_hash = client.genesis_hash(); - let (client, _child) = new_full(client, Subscriptions::new(Arc::new(TaskExecutor))); + let (client, _child) = new_full(client, SubscriptionManager::new(Arc::new(TaskExecutor))); assert_matches!( client.call("balanceOf".into(), Bytes(vec![1,2,3]), Some(genesis_hash).into()).wait(), @@ -139,12 +139,15 @@ fn should_notify_about_storage_changes() { { let mut client = Arc::new(substrate_test_runtime_client::new()); - let (api, _child) = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let (api, _child) = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); api.subscribe_storage(Default::default(), subscriber, None.into()); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); let mut builder = client.new_block(Default::default()).unwrap(); builder.push_transfer(runtime::Transfer { @@ -170,7 +173,7 @@ fn should_send_initial_storage_changes_and_notifications() { { let mut client = Arc::new(substrate_test_runtime_client::new()); - let (api, _child) = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let (api, _child) = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); let alice_balance_key = blake2_256(&runtime::system::balance_of_key(AccountKeyring::Alice.into())); @@ -179,7 +182,10 @@ fn should_send_initial_storage_changes_and_notifications() { ]).into()); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); let mut builder = client.new_block(Default::default()).unwrap(); builder.push_transfer(runtime::Transfer { @@ -205,7 +211,7 @@ fn should_send_initial_storage_changes_and_notifications() { #[test] fn should_query_storage() { fn run_tests(mut client: Arc, has_changes_trie_config: bool) { - let (api, _child) = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let (api, _child) = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); let mut add_block = |nonce| { let mut builder = client.new_block(Default::default()).unwrap(); @@ -422,7 +428,7 @@ fn should_split_ranges() { #[test] fn should_return_runtime_version() { let client = Arc::new(substrate_test_runtime_client::new()); - let (api, _child) = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let (api, _child) = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); let result = "{\"specName\":\"test\",\"implName\":\"parity-test\",\"authoringVersion\":1,\ \"specVersion\":2,\"implVersion\":2,\"apis\":[[\"0xdf6acb689907609b\",3],\ @@ -445,12 +451,16 @@ fn should_notify_on_runtime_version_initially() { { let client = Arc::new(substrate_test_runtime_client::new()); - let (api, _child) = new_full(client.clone(), Subscriptions::new(Arc::new(TaskExecutor))); + let (api, _child) = new_full(client.clone(), SubscriptionManager::new(Arc::new(TaskExecutor))); api.subscribe_runtime_version(Default::default(), subscriber); // assert id assigned - assert_eq!(executor::block_on(id.compat()), Ok(Ok(SubscriptionId::Number(1)))); + assert!(matches!( + executor::block_on(id.compat()), + Ok(Ok(SubscriptionId::String(_))) + )); + } // assert initial version sent. From 4c3aa0b47c7ca7bd615f17ec850fd2589104e26b Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 1 Jun 2020 17:50:29 -0400 Subject: [PATCH 05/12] Remove Subscriptions manager There's no need for this implementation since we're using the one from `jsonrpc-pubsub` now --- client/rpc-api/src/lib.rs | 1 - client/rpc-api/src/subscriptions.rs | 121 ---------------------------- 2 files changed, 122 deletions(-) delete mode 100644 client/rpc-api/src/subscriptions.rs diff --git a/client/rpc-api/src/lib.rs b/client/rpc-api/src/lib.rs index d58eabcab36ea..cd2608dda92be 100644 --- a/client/rpc-api/src/lib.rs +++ b/client/rpc-api/src/lib.rs @@ -23,7 +23,6 @@ mod errors; mod helpers; mod policy; -mod subscriptions; pub use jsonrpc_core::IoHandlerExtension as RpcExtension; pub use helpers::Receiver; diff --git a/client/rpc-api/src/subscriptions.rs b/client/rpc-api/src/subscriptions.rs deleted file mode 100644 index 7feae662eeb1f..0000000000000 --- a/client/rpc-api/src/subscriptions.rs +++ /dev/null @@ -1,121 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -use std::collections::HashMap; -use std::sync::{Arc, atomic::{self, AtomicUsize}}; - -use log::{error, warn}; -use jsonrpc_pubsub::{SubscriptionId, typed::{Sink, Subscriber}}; -use parking_lot::Mutex; -use jsonrpc_core::futures::sync::oneshot; -use jsonrpc_core::futures::{Future, future}; - -type Id = u64; - -/// Alias for a an implementation of `futures::future::Executor`. -pub type TaskExecutor = Arc + Send>> + Send + Sync>; - -/// Generate unique ids for subscriptions. -#[derive(Clone, Debug)] -pub struct IdProvider { - next_id: Arc, -} -impl Default for IdProvider { - fn default() -> Self { - IdProvider { - next_id: Arc::new(AtomicUsize::new(1)), - } - } -} - -impl IdProvider { - /// Returns next id for the subscription. - pub fn next_id(&self) -> Id { - self.next_id.fetch_add(1, atomic::Ordering::AcqRel) as u64 - } -} - -/// Subscriptions manager. -/// -/// Takes care of assigning unique subscription ids and -/// driving the sinks into completion. -#[derive(Clone)] -pub struct Subscriptions { - next_id: IdProvider, - active_subscriptions: Arc>>>, - executor: TaskExecutor, -} - -impl Subscriptions { - /// Creates new `Subscriptions` object. - pub fn new(executor: TaskExecutor) -> Self { - Subscriptions { - next_id: Default::default(), - active_subscriptions: Default::default(), - executor, - } - } - - /// Borrows the internal task executor. - /// - /// This can be used to spawn additional tasks on the underlying event loop. - pub fn executor(&self) -> &TaskExecutor { - &self.executor - } - - /// Creates new subscription for given subscriber. - /// - /// Second parameter is a function that converts Subscriber sink into a future. - /// This future will be driven to completion by the underlying event loop - /// or will be cancelled in case #cancel is invoked. - pub fn add(&self, subscriber: Subscriber, into_future: G) -> SubscriptionId where - G: FnOnce(Sink) -> R, - R: future::IntoFuture, - F: future::Future + Send + 'static, - { - let id = self.next_id.next_id(); - let subscription_id: SubscriptionId = id.into(); - if let Ok(sink) = subscriber.assign_id(subscription_id.clone()) { - let (tx, rx) = oneshot::channel(); - let future = into_future(sink) - .into_future() - .select(rx.map_err(|e| warn!("Error timeing out: {:?}", e))) - .then(|_| Ok(())); - - self.active_subscriptions.lock().insert(id, tx); - if self.executor.execute(Box::new(future)).is_err() { - error!("Failed to spawn RPC subscription task"); - } - } - - subscription_id - } - - /// Cancel subscription. - /// - /// Returns true if subscription existed or false otherwise. - pub fn cancel(&self, id: SubscriptionId) -> bool { - if let SubscriptionId::Number(id) = id { - if let Some(tx) = self.active_subscriptions.lock().remove(&id) { - let _ = tx.send(()); - return true; - } - } - false - } -} From f7db874a1f1c07186367ce7423161da598ba33b7 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 2 Jun 2020 15:12:26 -0400 Subject: [PATCH 06/12] Fix author RPC test This test used to check for a numerial subscription ID, whereas now it uses a string based ID which is the default provided by `jsonrpc-pubsub`'s subscription manager. --- Cargo.lock | 12 ++++++------ client/rpc/src/author/tests.rs | 35 +++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7727776719dc1..017de80d17d63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2353,7 +2353,7 @@ dependencies = [ [[package]] name = "jsonrpc-core" version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" dependencies = [ "futures 0.1.29", "log", @@ -2399,7 +2399,7 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" dependencies = [ "hyper 0.12.35", "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", @@ -2413,7 +2413,7 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" dependencies = [ "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "log", @@ -2437,7 +2437,7 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" dependencies = [ "bytes 0.4.12", "globset", @@ -2452,7 +2452,7 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#1779dbef95dd5189d73516782e861661b463cd3d" +source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" dependencies = [ "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", "jsonrpc-server-utils", @@ -9026,7 +9026,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "rand 0.7.3", + "rand 0.3.23", ] [[package]] diff --git a/client/rpc/src/author/tests.rs b/client/rpc/src/author/tests.rs index 1c80f76d790ca..f0f92a8e7eae7 100644 --- a/client/rpc/src/author/tests.rs +++ b/client/rpc/src/author/tests.rs @@ -133,11 +133,13 @@ fn should_watch_extrinsic() { uxt(AccountKeyring::Alice, 0).encode().into(), ); - // then - assert!(matches!( - executor::block_on(id_rx.compat()), - Ok(Ok(SubscriptionId::String(_))) - )); + let id = executor::block_on(id_rx.compat()).unwrap().unwrap(); + assert_matches!(id, SubscriptionId::String(_)); + + let id = match id { + SubscriptionId::String(id) => id, + _ => unreachable!(), + }; // check notifications let replacement = { @@ -151,15 +153,22 @@ fn should_watch_extrinsic() { }; AuthorApi::submit_extrinsic(&p, replacement.encode().into()).wait().unwrap(); let (res, data) = executor::block_on(data.into_future().compat()).unwrap(); - assert_eq!( - res, - Some(r#"{"jsonrpc":"2.0","method":"test","params":{"result":"ready","subscription":1}}"#.into()) - ); + + let expected = Some(format!( + r#"{{"jsonrpc":"2.0","method":"test","params":{{"result":"ready","subscription":"{}"}}}}"#, + id, + )); + assert_eq!(res, expected); + let h = blake2_256(&replacement.encode()); - assert_eq!( - executor::block_on(data.into_future().compat()).unwrap().0, - Some(format!(r#"{{"jsonrpc":"2.0","method":"test","params":{{"result":{{"usurped":"0x{}"}},"subscription":1}}}}"#, HexDisplay::from(&h))) - ); + let expected = Some(format!( + r#"{{"jsonrpc":"2.0","method":"test","params":{{"result":{{"usurped":"0x{}"}},"subscription":"{}"}}}}"#, + HexDisplay::from(&h), + id, + )); + + let res = executor::block_on(data.into_future().compat()).unwrap().0; + assert_eq!(res, expected); } #[test] From a8f4b025f89003808ef09fea77f3e9a892c1082d Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 2 Jun 2020 15:14:24 -0400 Subject: [PATCH 07/12] Remove unused NumericIdProvider --- client/rpc/src/author/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index 46d89fc4f7728..da752915f7d6b 100644 --- a/client/rpc/src/author/mod.rs +++ b/client/rpc/src/author/mod.rs @@ -33,7 +33,7 @@ use rpc::futures::{ use futures::{StreamExt as _, compat::Compat}; use futures::future::{ready, FutureExt, TryFutureExt}; use sc_rpc_api::DenyUnsafe; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::{SubscriptionManager, NumericIdProvider}}; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager; use codec::{Encode, Decode}; use sp_core::{Bytes, traits::BareCryptoStorePtr}; use sp_api::ProvideRuntimeApi; From 3129d66fd01313751b1aa60f62272dce5d6822d7 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 2 Jun 2020 15:16:08 -0400 Subject: [PATCH 08/12] Add missing bracket Removed one too many with that last one, lol --- client/rpc/src/author/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index da752915f7d6b..974c1b85e1b39 100644 --- a/client/rpc/src/author/mod.rs +++ b/client/rpc/src/author/mod.rs @@ -33,7 +33,7 @@ use rpc::futures::{ use futures::{StreamExt as _, compat::Compat}; use futures::future::{ready, FutureExt, TryFutureExt}; use sc_rpc_api::DenyUnsafe; -use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager; +use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId, manager::SubscriptionManager}; use codec::{Encode, Decode}; use sp_core::{Bytes, traits::BareCryptoStorePtr}; use sp_api::ProvideRuntimeApi; From 082227d1af90b484cfd36051221a8401fb89f5bf Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 3 Jun 2020 11:59:29 -0400 Subject: [PATCH 09/12] Bump `jsonrpc` to v14.2 There's an exception though. `jsonrpc-derive` cannot be bumped past v14.0.5 just yet since it has a dependency on `quote` pinned to v1.0.1. This means that at the moment it won't build on Substrate since it's using v1.0.3. --- Cargo.lock | 104 +++++++++-------------- bin/node/browser-testing/Cargo.toml | 2 +- bin/node/cli/Cargo.toml | 2 +- bin/node/rpc-client/Cargo.toml | 2 +- bin/node/rpc/Cargo.toml | 2 +- bin/utils/subkey/Cargo.toml | 2 +- client/consensus/babe/rpc/Cargo.toml | 6 +- client/consensus/manual-seal/Cargo.toml | 4 +- client/finality-grandpa/rpc/Cargo.toml | 6 +- client/rpc-api/Cargo.toml | 8 +- client/rpc-servers/Cargo.toml | 8 +- client/rpc/Cargo.toml | 4 +- client/service/Cargo.toml | 2 +- frame/contracts/rpc/Cargo.toml | 6 +- frame/transaction-payment/rpc/Cargo.toml | 6 +- utils/frame/rpc/support/Cargo.toml | 4 +- utils/frame/rpc/system/Cargo.toml | 6 +- 17 files changed, 77 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 017de80d17d63..2727868bd6de5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2335,15 +2335,15 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" -version = "14.1.0" +version = "14.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2307a7e78cf969759e390a8a2151ea12e783849a45bb00aa871b468ba58ea79e" +checksum = "ecbdaacc17243168d9d1fa6b2bd7556a27e1e60a621d8a2a6e590ae2b145d158" dependencies = [ "failure", "futures 0.1.29", "hyper 0.12.35", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-pubsub 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "serde", "serde_json", @@ -2352,21 +2352,9 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" -dependencies = [ - "futures 0.1.29", - "log", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "jsonrpc-core" -version = "14.1.0" +version = "14.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25525f6002338fb4debb5167a89a0b47f727a5a48418417545ad3429758b7fec" +checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" dependencies = [ "futures 0.1.29", "log", @@ -2377,9 +2365,9 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "14.1.0" +version = "14.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f9382e831a6d630c658df103aac3f971da096deb57c136ea2b760d3b4e3f9f" +checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" dependencies = [ "jsonrpc-client-transports", ] @@ -2398,11 +2386,12 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" -version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da906d682799df05754480dac1b9e70ec92e12c19ebafd2662a5ea1c9fd6522" dependencies = [ "hyper 0.12.35", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-server-utils", "log", "net2", @@ -2412,36 +2401,26 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" -dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", - "log", - "parking_lot 0.10.2", - "rand 0.7.3", - "serde", -] - -[[package]] -name = "jsonrpc-pubsub" -version = "14.1.0" +version = "14.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4ca5e391d6c6a2261d4adca029f427fe63ea546ad6cef2957c654c08495ec16" +checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" dependencies = [ - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", "log", "parking_lot 0.10.2", + "rand 0.7.3", "serde", ] [[package]] name = "jsonrpc-server-utils" -version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb" dependencies = [ "bytes 0.4.12", "globset", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "lazy_static", "log", "tokio 0.1.22", @@ -2451,10 +2430,11 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "14.1.0" -source = "git+https://github.com/paritytech/jsonrpc#ef92a481d76802da489f0f57dfdf4d459d7f7f76" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903d3109fe7c4acb932b567e1e607e0f524ed04741b09fb0e61841bc40a022fc" dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-server-utils", "log", "parking_lot 0.10.2", @@ -3413,7 +3393,7 @@ version = "2.0.0-rc2" dependencies = [ "futures 0.3.4", "futures-timer 3.0.2", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", "libp2p", "node-cli", "sc-rpc-api", @@ -3434,7 +3414,7 @@ dependencies = [ "frame-system", "futures 0.3.4", "hex-literal", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", "log", "nix", "node-executor", @@ -3565,7 +3545,7 @@ dependencies = [ name = "node-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "node-primitives", "node-runtime", "pallet-contracts-rpc", @@ -4108,7 +4088,7 @@ dependencies = [ name = "pallet-contracts-rpc" version = "0.8.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "pallet-contracts-primitives", @@ -4664,7 +4644,7 @@ dependencies = [ name = "pallet-transaction-payment-rpc" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", @@ -6160,7 +6140,7 @@ version = "0.8.0-rc2" dependencies = [ "derive_more", "futures 0.3.4", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "sc-consensus", @@ -6202,7 +6182,7 @@ dependencies = [ "derive_more", "env_logger 0.7.1", "futures 0.3.4", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -6417,7 +6397,7 @@ dependencies = [ "derive_more", "finality-grandpa", "futures 0.3.4", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -6624,8 +6604,8 @@ dependencies = [ "futures 0.1.29", "futures 0.3.4", "hash-db", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", - "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", + "jsonrpc-pubsub", "lazy_static", "log", "parity-scale-codec", @@ -6661,10 +6641,10 @@ version = "0.8.0-rc2" dependencies = [ "derive_more", "futures 0.3.4", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", - "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-pubsub", "log", "parity-scale-codec", "parking_lot 0.10.2", @@ -6682,9 +6662,9 @@ dependencies = [ name = "sc-rpc-server" version = "2.0.0-rc2" dependencies = [ - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-http-server", - "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-pubsub", "jsonrpc-ws-server", "log", "serde", @@ -6715,7 +6695,7 @@ dependencies = [ "futures 0.3.4", "futures-timer 3.0.2", "hash-db", - "jsonrpc-pubsub 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-pubsub", "lazy_static", "log", "netstat2", @@ -8131,7 +8111,7 @@ dependencies = [ "frame-system", "futures 0.3.4", "jsonrpc-client-transports", - "jsonrpc-core 14.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core", "parity-scale-codec", "sc-rpc-api", "serde", @@ -8146,7 +8126,7 @@ dependencies = [ "env_logger 0.7.1", "frame-system-rpc-runtime-api", "futures 0.3.4", - "jsonrpc-core 14.1.0 (git+https://github.com/paritytech/jsonrpc)", + "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "log", @@ -9026,7 +9006,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "rand 0.3.23", + "rand 0.7.3", ] [[package]] diff --git a/bin/node/browser-testing/Cargo.toml b/bin/node/browser-testing/Cargo.toml index 7628582fbb047..bbd33782b7523 100644 --- a/bin/node/browser-testing/Cargo.toml +++ b/bin/node/browser-testing/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" [dependencies] futures-timer = "3.0.2" libp2p = { version = "0.19.1", default-features = false } -jsonrpc-core = "14.0.5" +jsonrpc-core = "14.2" serde = "1.0.106" serde_json = "1.0.48" wasm-bindgen = { version = "=0.2.62", features = ["serde-serialize"] } diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index f2b25068edfd8..b820cef270163 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -38,7 +38,7 @@ codec = { package = "parity-scale-codec", version = "1.3.0" } serde = { version = "1.0.102", features = ["derive"] } futures = { version = "0.3.1", features = ["compat"] } hex-literal = "0.2.1" -jsonrpc-core = "14.0.3" +jsonrpc-core = "14.2" log = "0.4.8" rand = "0.7.2" structopt = { version = "0.3.8", optional = true } diff --git a/bin/node/rpc-client/Cargo.toml b/bin/node/rpc-client/Cargo.toml index 0b529d116c6d4..c6cd7d40406d9 100644 --- a/bin/node/rpc-client/Cargo.toml +++ b/bin/node/rpc-client/Cargo.toml @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] env_logger = "0.7.0" futures = "0.1.29" hyper = "0.12.35" -jsonrpc-core-client = { version = "14.0.5", default-features = false, features = ["http"] } +jsonrpc-core-client = { version = "14.2", default-features = false, features = ["http"] } log = "0.4.8" node-primitives = { version = "2.0.0-rc2", path = "../primitives" } sc-rpc = { version = "2.0.0-rc2", path = "../../../client/rpc" } diff --git a/bin/node/rpc/Cargo.toml b/bin/node/rpc/Cargo.toml index 6a9ada7397d7b..2eb7e83beb498 100644 --- a/bin/node/rpc/Cargo.toml +++ b/bin/node/rpc/Cargo.toml @@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sc-client-api = { version = "2.0.0-rc2", path = "../../../client/api" } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-core = "14.2" node-primitives = { version = "2.0.0-rc2", path = "../primitives" } node-runtime = { version = "2.0.0-rc2", path = "../runtime" } sp-runtime = { version = "2.0.0-rc2", path = "../../../primitives/runtime" } diff --git a/bin/utils/subkey/Cargo.toml b/bin/utils/subkey/Cargo.toml index c955ac3dd1241..e8de6be92e030 100644 --- a/bin/utils/subkey/Cargo.toml +++ b/bin/utils/subkey/Cargo.toml @@ -31,7 +31,7 @@ rpassword = "4.0.1" itertools = "0.8.2" derive_more = { version = "0.99.2" } sc-rpc = { version = "2.0.0-rc2", path = "../../../client/rpc" } -jsonrpc-core-client = { version = "14.0.3", features = ["http"] } +jsonrpc-core-client = { version = "14.2", features = ["http"] } hyper = "0.12.35" libp2p = "0.19.1" serde_json = "1.0" diff --git a/client/consensus/babe/rpc/Cargo.toml b/client/consensus/babe/rpc/Cargo.toml index 2868835b2e7fa..c35bed2a6587a 100644 --- a/client/consensus/babe/rpc/Cargo.toml +++ b/client/consensus/babe/rpc/Cargo.toml @@ -14,9 +14,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sc-consensus-babe = { version = "0.8.0-rc2", path = "../" } sc-rpc-api = { version = "0.8.0-rc2", path = "../../../rpc-api" } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.5" -jsonrpc-derive = "14.0.3" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" sp-consensus-babe = { version = "0.8.0-rc2", path = "../../../../primitives/consensus/babe" } serde = { version = "1.0.104", features=["derive"] } sp-blockchain = { version = "2.0.0-rc2", path = "../../../../primitives/blockchain" } diff --git a/client/consensus/manual-seal/Cargo.toml b/client/consensus/manual-seal/Cargo.toml index de2bf68d76745..5a10c72e8c47b 100644 --- a/client/consensus/manual-seal/Cargo.toml +++ b/client/consensus/manual-seal/Cargo.toml @@ -14,8 +14,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] derive_more = "0.99.2" futures = "0.3.4" -jsonrpc-core = "14.0.5" -jsonrpc-core-client = "14.0.5" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" jsonrpc-derive = "14.0.5" log = "0.4.8" parking_lot = "0.10.0" diff --git a/client/finality-grandpa/rpc/Cargo.toml b/client/finality-grandpa/rpc/Cargo.toml index efb8f3fd91f1e..78eecc7605f86 100644 --- a/client/finality-grandpa/rpc/Cargo.toml +++ b/client/finality-grandpa/rpc/Cargo.toml @@ -10,9 +10,9 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] sc-finality-grandpa = { version = "0.8.0-rc2", path = "../" } finality-grandpa = { version = "0.12.3", features = ["derive-codec"] } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.3" -jsonrpc-derive = "14.0.3" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" futures = { version = "0.3.4", features = ["compat"] } serde = { version = "1.0.105", features = ["derive"] } serde_json = "1.0.50" diff --git a/client/rpc-api/Cargo.toml b/client/rpc-api/Cargo.toml index d4642e8711d6b..5f36d497b089e 100644 --- a/client/rpc-api/Cargo.toml +++ b/client/rpc-api/Cargo.toml @@ -15,10 +15,10 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } derive_more = "0.99.2" futures = { version = "0.3.1", features = ["compat"] } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.5" -jsonrpc-derive = "14.0.3" -jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" +jsonrpc-pubsub = "14.2" log = "0.4.8" parking_lot = "0.10.0" sp-core = { version = "2.0.0-rc2", path = "../../primitives/core" } diff --git a/client/rpc-servers/Cargo.toml b/client/rpc-servers/Cargo.toml index e0d01c88f0a13..9e52ccae588c6 100644 --- a/client/rpc-servers/Cargo.toml +++ b/client/rpc-servers/Cargo.toml @@ -12,13 +12,13 @@ description = "Substrate RPC servers." targets = ["x86_64-unknown-linux-gnu"] [dependencies] -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-core = "14.2" +pubsub = { package = "jsonrpc-pubsub", version = "14.2" } log = "0.4.8" serde = "1.0.101" serde_json = "1.0.41" sp-runtime = { version = "2.0.0-rc2", path = "../../primitives/runtime" } [target.'cfg(not(target_os = "unknown"))'.dependencies] -http = { package = "jsonrpc-http-server", git = "https://github.com/paritytech/jsonrpc" } -ws = { package = "jsonrpc-ws-server", git = "https://github.com/paritytech/jsonrpc" } +http = { package = "jsonrpc-http-server", version = "14.2" } +ws = { package = "jsonrpc-ws-server", version = "14.2" } diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 3ba0907fb9611..60c4a24cd0e6a 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -17,10 +17,10 @@ sc-client-api = { version = "2.0.0-rc2", path = "../api" } sp-api = { version = "2.0.0-rc2", path = "../../primitives/api" } codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.1", features = ["compat"] } -jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-pubsub = "14.2" log = "0.4.8" sp-core = { version = "2.0.0-rc2", path = "../../primitives/core" } -rpc = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } +rpc = { package = "jsonrpc-core", version = "14.2" } sp-version = { version = "2.0.0-rc2", path = "../../primitives/version" } serde_json = "1.0.41" sp-session = { version = "2.0.0-rc2", path = "../../primitives/session" } diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 74dec6ffca23a..c72f8226feb80 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -26,7 +26,7 @@ test-helpers = [] derive_more = "0.99.2" futures01 = { package = "futures", version = "0.1.29" } futures = { version = "0.3.4", features = ["compat"] } -jsonrpc-pubsub = { package = "jsonrpc-pubsub", git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-pubsub = "14.2" rand = "0.7.3" parking_lot = "0.10.0" lazy_static = "1.4.0" diff --git a/frame/contracts/rpc/Cargo.toml b/frame/contracts/rpc/Cargo.toml index 37728687017eb..53d6d574d3a0c 100644 --- a/frame/contracts/rpc/Cargo.toml +++ b/frame/contracts/rpc/Cargo.toml @@ -13,9 +13,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0" } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.5" -jsonrpc-derive = "14.0.3" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" sp-blockchain = { version = "2.0.0-rc2", path = "../../../primitives/blockchain" } sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } diff --git a/frame/transaction-payment/rpc/Cargo.toml b/frame/transaction-payment/rpc/Cargo.toml index 2f2401ab4988c..6f721467c2d3d 100644 --- a/frame/transaction-payment/rpc/Cargo.toml +++ b/frame/transaction-payment/rpc/Cargo.toml @@ -13,9 +13,9 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "1.3.0" } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.5" -jsonrpc-derive = "14.0.3" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } serde = { version = "1.0.101", features = ["derive"] } diff --git a/utils/frame/rpc/support/Cargo.toml b/utils/frame/rpc/support/Cargo.toml index 006372eb364e7..a64b23b6a987c 100644 --- a/utils/frame/rpc/support/Cargo.toml +++ b/utils/frame/rpc/support/Cargo.toml @@ -13,8 +13,8 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] futures = { version = "0.3.0", features = ["compat"] } -jsonrpc-client-transports = { version = "14.0.5", default-features = false, features = ["http"] } -jsonrpc-core = "14" +jsonrpc-client-transports = { version = "14.2", default-features = false, features = ["http"] } +jsonrpc-core = "14.2" codec = { package = "parity-scale-codec", version = "1" } serde = "1" frame-support = { version = "2.0.0-rc2", path = "../../../../frame/support" } diff --git a/utils/frame/rpc/system/Cargo.toml b/utils/frame/rpc/system/Cargo.toml index f86977b36924e..80a77518e3340 100644 --- a/utils/frame/rpc/system/Cargo.toml +++ b/utils/frame/rpc/system/Cargo.toml @@ -15,9 +15,9 @@ targets = ["x86_64-unknown-linux-gnu"] sc-client-api = { version = "2.0.0-rc2", path = "../../../../client/api" } codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.4", features = ["compat"] } -jsonrpc-core = { package = "jsonrpc-core", git = "https://github.com/paritytech/jsonrpc" } -jsonrpc-core-client = "14.0.5" -jsonrpc-derive = "14.0.3" +jsonrpc-core = "14.2" +jsonrpc-core-client = "14.2" +jsonrpc-derive = "14.0.5" log = "0.4.8" serde = { version = "1.0.101", features = ["derive"] } sp-runtime = { version = "2.0.0-rc2", path = "../../../../primitives/runtime" } From 71d59ef993e893bab4a3605c46321ee7ac7e138c Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 3 Jun 2020 12:54:46 -0400 Subject: [PATCH 10/12] Track `jsonrpc-derive` master branch --- client/consensus/babe/rpc/Cargo.toml | 2 +- client/consensus/manual-seal/Cargo.toml | 2 +- client/finality-grandpa/rpc/Cargo.toml | 2 +- client/rpc-api/Cargo.toml | 2 +- frame/contracts/rpc/Cargo.toml | 2 +- frame/transaction-payment/rpc/Cargo.toml | 2 +- utils/frame/rpc/system/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/consensus/babe/rpc/Cargo.toml b/client/consensus/babe/rpc/Cargo.toml index c35bed2a6587a..5cb1643218c8a 100644 --- a/client/consensus/babe/rpc/Cargo.toml +++ b/client/consensus/babe/rpc/Cargo.toml @@ -16,7 +16,7 @@ sc-consensus-babe = { version = "0.8.0-rc2", path = "../" } sc-rpc-api = { version = "0.8.0-rc2", path = "../../../rpc-api" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } sp-consensus-babe = { version = "0.8.0-rc2", path = "../../../../primitives/consensus/babe" } serde = { version = "1.0.104", features=["derive"] } sp-blockchain = { version = "2.0.0-rc2", path = "../../../../primitives/blockchain" } diff --git a/client/consensus/manual-seal/Cargo.toml b/client/consensus/manual-seal/Cargo.toml index 5a10c72e8c47b..f9c0cd0a648e6 100644 --- a/client/consensus/manual-seal/Cargo.toml +++ b/client/consensus/manual-seal/Cargo.toml @@ -16,7 +16,7 @@ derive_more = "0.99.2" futures = "0.3.4" jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } log = "0.4.8" parking_lot = "0.10.0" serde = { version = "1.0", features=["derive"] } diff --git a/client/finality-grandpa/rpc/Cargo.toml b/client/finality-grandpa/rpc/Cargo.toml index 78eecc7605f86..f89ad3b111666 100644 --- a/client/finality-grandpa/rpc/Cargo.toml +++ b/client/finality-grandpa/rpc/Cargo.toml @@ -12,7 +12,7 @@ sc-finality-grandpa = { version = "0.8.0-rc2", path = "../" } finality-grandpa = { version = "0.12.3", features = ["derive-codec"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } futures = { version = "0.3.4", features = ["compat"] } serde = { version = "1.0.105", features = ["derive"] } serde_json = "1.0.50" diff --git a/client/rpc-api/Cargo.toml b/client/rpc-api/Cargo.toml index 5f36d497b089e..512308a351965 100644 --- a/client/rpc-api/Cargo.toml +++ b/client/rpc-api/Cargo.toml @@ -17,7 +17,7 @@ derive_more = "0.99.2" futures = { version = "0.3.1", features = ["compat"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } jsonrpc-pubsub = "14.2" log = "0.4.8" parking_lot = "0.10.0" diff --git a/frame/contracts/rpc/Cargo.toml b/frame/contracts/rpc/Cargo.toml index 53d6d574d3a0c..b17cc80433640 100644 --- a/frame/contracts/rpc/Cargo.toml +++ b/frame/contracts/rpc/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } sp-blockchain = { version = "2.0.0-rc2", path = "../../../primitives/blockchain" } sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } diff --git a/frame/transaction-payment/rpc/Cargo.toml b/frame/transaction-payment/rpc/Cargo.toml index 6f721467c2d3d..fe4e895623548 100644 --- a/frame/transaction-payment/rpc/Cargo.toml +++ b/frame/transaction-payment/rpc/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } serde = { version = "1.0.101", features = ["derive"] } diff --git a/utils/frame/rpc/system/Cargo.toml b/utils/frame/rpc/system/Cargo.toml index 80a77518e3340..dd56e2bc8c5c4 100644 --- a/utils/frame/rpc/system/Cargo.toml +++ b/utils/frame/rpc/system/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.4", features = ["compat"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = "14.0.5" +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } log = "0.4.8" serde = { version = "1.0.101", features = ["derive"] } sp-runtime = { version = "2.0.0-rc2", path = "../../../../primitives/runtime" } From cfbf06ce489cb07059f8ccb3df50739d8e6ed566 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 3 Jun 2020 13:00:03 -0400 Subject: [PATCH 11/12] Bump `quote` version to v1.0.6 --- Cargo.lock | 97 +++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2727868bd6de5..b57dcde7414fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" dependencies = [ - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -321,7 +321,7 @@ dependencies = [ "log", "peeking_take_while", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "regex", "rustc-hash", "shlex", @@ -997,7 +997,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47c5e5ac752e18207b12e16b10631ae5f7f68f8805f335f9b817ead83d9ffce1" dependencies = [ - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1047,7 +1047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1149,7 +1149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ed9afacaea0301eefb738c9deea725e6d53938004597cdc518a8cf9a7aa2f03" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1302,7 +1302,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "synstructure", ] @@ -1493,7 +1493,7 @@ version = "2.0.0-rc2" dependencies = [ "frame-support-procedural-tools", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1504,7 +1504,7 @@ dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1513,7 +1513,7 @@ name = "frame-support-procedural-tools-derive" version = "2.0.0-rc2" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -1729,7 +1729,7 @@ checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" dependencies = [ "proc-macro-hack", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -2250,7 +2250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -2374,13 +2374,12 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "14.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8609af8f63b626e8e211f52441fcdb6ec54f1a446606b10d5c89ae9bf8a20058" +version = "14.2.0" +source = "git+https://github.com/paritytech/jsonrpc#a615225ea5b8c8c24fd68ffa77a76c3aa25d8f63" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -2664,7 +2663,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f09548626b737ed64080fde595e06ce1117795b8b9fc4d2629fa36561c583171" dependencies = [ - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -4574,7 +4573,7 @@ version = "2.0.0-rc2" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "sp-runtime", "syn 1.0.17", ] @@ -4807,7 +4806,7 @@ checksum = "5a0ec292e92e8ec7c58e576adacc1e3f399c597c8f263c42f18420abe58e7245" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -4926,7 +4925,7 @@ checksum = "a62486e111e571b1e93b710b61e8f493c0013be39629b714cb166bdb06aa5a8a" dependencies = [ "proc-macro-hack", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -4990,7 +4989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8988430ce790d8682672117bc06dda364c0be32d3abd738234f19f3240bad99a" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -5110,7 +5109,7 @@ checksum = "98e9e4b82e0ef281812565ea4751049f1bdcdfccda7d3f459f2e138a40c08678" dependencies = [ "proc-macro-error-attr", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "version_check", ] @@ -5122,7 +5121,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "syn-mid", "version_check", @@ -5215,7 +5214,7 @@ dependencies = [ "anyhow", "itertools", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -5283,9 +5282,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" [[package]] name = "quote" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" dependencies = [ "proc-macro2", ] @@ -5583,7 +5582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "602eb59cda66fcb9aec25841fb76bc01d2b34282dcdd705028da297db6f3eec8" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -5767,7 +5766,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -5920,7 +5919,7 @@ version = "2.0.0-rc2" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -6941,7 +6940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8584eea9b9ff42825b46faf46a8c24d2cff13ec152fa2a50df788b87c07ee28" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7037,7 +7036,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7157,7 +7156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7259,7 +7258,7 @@ dependencies = [ "blake2-rfc", "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7519,7 +7518,7 @@ name = "sp-debug-derive" version = "2.0.0-rc2" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7636,7 +7635,7 @@ version = "2.0.0-rc2" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -7709,7 +7708,7 @@ dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8003,7 +8002,7 @@ dependencies = [ "heck", "proc-macro-error", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8024,7 +8023,7 @@ checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" dependencies = [ "heck", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8394,7 +8393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "unicode-xid 0.2.0", ] @@ -8405,7 +8404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8425,7 +8424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "unicode-xid 0.2.0", ] @@ -8488,7 +8487,7 @@ checksum = "a605baa797821796a751f4a959e1206079b24a4b7e1ed302b7d785d81a9276c9" dependencies = [ "lazy_static", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "version_check", ] @@ -8518,7 +8517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca972988113b7715266f91250ddb98070d033c62a011fa0fcc57434a649310dd" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8724,7 +8723,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -8902,7 +8901,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fbad39da2f9af1cae3016339ad7f2c7a9e870f12e8fd04c4fd7ef35b30c0d2b" dependencies = [ - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", ] @@ -9234,7 +9233,7 @@ dependencies = [ "lazy_static", "log", "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "wasm-bindgen-shared", ] @@ -9257,7 +9256,7 @@ version = "0.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cd85aa2c579e8892442954685f0d801f9129de24fa2136b2c6a539c76b65776" dependencies = [ - "quote 1.0.3", + "quote 1.0.6", "wasm-bindgen-macro-support", ] @@ -9268,7 +9267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb197bd3a47553334907ffd2f16507b4f4f01bbec3ac921a7719e0decdfe72a" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -9301,7 +9300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", ] [[package]] @@ -9589,7 +9588,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" dependencies = [ "proc-macro2", - "quote 1.0.3", + "quote 1.0.6", "syn 1.0.17", "synstructure", ] From 07a5eb4891f31c926b17c24d70a757d893b1156f Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 3 Jun 2020 13:31:22 -0400 Subject: [PATCH 12/12] Bump `jsonrpc-derive` to v14.2.1 This includes support for `quote` v1.0.6 --- Cargo.lock | 5 +++-- client/consensus/babe/rpc/Cargo.toml | 2 +- client/consensus/manual-seal/Cargo.toml | 2 +- client/finality-grandpa/rpc/Cargo.toml | 2 +- client/rpc-api/Cargo.toml | 2 +- frame/contracts/rpc/Cargo.toml | 2 +- frame/transaction-payment/rpc/Cargo.toml | 2 +- utils/frame/rpc/system/Cargo.toml | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b57dcde7414fa..cc4be56e37039 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2374,8 +2374,9 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "14.2.0" -source = "git+https://github.com/paritytech/jsonrpc#a615225ea5b8c8c24fd68ffa77a76c3aa25d8f63" +version = "14.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/client/consensus/babe/rpc/Cargo.toml b/client/consensus/babe/rpc/Cargo.toml index 5cb1643218c8a..0986eea2b177f 100644 --- a/client/consensus/babe/rpc/Cargo.toml +++ b/client/consensus/babe/rpc/Cargo.toml @@ -16,7 +16,7 @@ sc-consensus-babe = { version = "0.8.0-rc2", path = "../" } sc-rpc-api = { version = "0.8.0-rc2", path = "../../../rpc-api" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" sp-consensus-babe = { version = "0.8.0-rc2", path = "../../../../primitives/consensus/babe" } serde = { version = "1.0.104", features=["derive"] } sp-blockchain = { version = "2.0.0-rc2", path = "../../../../primitives/blockchain" } diff --git a/client/consensus/manual-seal/Cargo.toml b/client/consensus/manual-seal/Cargo.toml index f9c0cd0a648e6..6b77829803ef4 100644 --- a/client/consensus/manual-seal/Cargo.toml +++ b/client/consensus/manual-seal/Cargo.toml @@ -16,7 +16,7 @@ derive_more = "0.99.2" futures = "0.3.4" jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" log = "0.4.8" parking_lot = "0.10.0" serde = { version = "1.0", features=["derive"] } diff --git a/client/finality-grandpa/rpc/Cargo.toml b/client/finality-grandpa/rpc/Cargo.toml index f89ad3b111666..365875896077f 100644 --- a/client/finality-grandpa/rpc/Cargo.toml +++ b/client/finality-grandpa/rpc/Cargo.toml @@ -12,7 +12,7 @@ sc-finality-grandpa = { version = "0.8.0-rc2", path = "../" } finality-grandpa = { version = "0.12.3", features = ["derive-codec"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" futures = { version = "0.3.4", features = ["compat"] } serde = { version = "1.0.105", features = ["derive"] } serde_json = "1.0.50" diff --git a/client/rpc-api/Cargo.toml b/client/rpc-api/Cargo.toml index 512308a351965..db992eed04b04 100644 --- a/client/rpc-api/Cargo.toml +++ b/client/rpc-api/Cargo.toml @@ -17,7 +17,7 @@ derive_more = "0.99.2" futures = { version = "0.3.1", features = ["compat"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" jsonrpc-pubsub = "14.2" log = "0.4.8" parking_lot = "0.10.0" diff --git a/frame/contracts/rpc/Cargo.toml b/frame/contracts/rpc/Cargo.toml index b17cc80433640..d521be6d2a226 100644 --- a/frame/contracts/rpc/Cargo.toml +++ b/frame/contracts/rpc/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" sp-blockchain = { version = "2.0.0-rc2", path = "../../../primitives/blockchain" } sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } diff --git a/frame/transaction-payment/rpc/Cargo.toml b/frame/transaction-payment/rpc/Cargo.toml index fe4e895623548..adecfd0aabb84 100644 --- a/frame/transaction-payment/rpc/Cargo.toml +++ b/frame/transaction-payment/rpc/Cargo.toml @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "1.3.0" } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" sp-core = { version = "2.0.0-rc2", path = "../../../primitives/core" } sp-rpc = { version = "2.0.0-rc2", path = "../../../primitives/rpc" } serde = { version = "1.0.101", features = ["derive"] } diff --git a/utils/frame/rpc/system/Cargo.toml b/utils/frame/rpc/system/Cargo.toml index dd56e2bc8c5c4..d4878a4f289c1 100644 --- a/utils/frame/rpc/system/Cargo.toml +++ b/utils/frame/rpc/system/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "1.3.0" } futures = { version = "0.3.4", features = ["compat"] } jsonrpc-core = "14.2" jsonrpc-core-client = "14.2" -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc" } +jsonrpc-derive = "14.2.1" log = "0.4.8" serde = { version = "1.0.101", features = ["derive"] } sp-runtime = { version = "2.0.0-rc2", path = "../../../../primitives/runtime" }