diff --git a/Cargo.lock b/Cargo.lock index bdb6bd9868f..7826885e64a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2247,7 +2247,7 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "futures", - "jsonrpsee-core", + "jsonrpsee-core 0.16.2", "parity-scale-codec", "polkadot-overseer", "sc-client-api", @@ -2305,7 +2305,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.16.2", "lru 0.9.0", "parity-scale-codec", "polkadot-overseer", @@ -4119,7 +4119,7 @@ dependencies = [ "rustls 0.20.8", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "webpki-roots", ] @@ -4434,13 +4434,26 @@ version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", + "jsonrpsee-client-transport 0.16.2", + "jsonrpsee-core 0.16.2", "jsonrpsee-http-client", - "jsonrpsee-proc-macros", + "jsonrpsee-proc-macros 0.16.2", "jsonrpsee-server", - "jsonrpsee-types", - "jsonrpsee-ws-client", + "jsonrpsee-types 0.16.2", + "jsonrpsee-ws-client 0.16.2", + "tracing", +] + +[[package]] +name = "jsonrpsee" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b971ce0f6cd1521ede485afc564b95b2c8e7079b9da41d4273bd9b55140a55d" +dependencies = [ + "jsonrpsee-core 0.17.1", + "jsonrpsee-proc-macros 0.17.1", + "jsonrpsee-types 0.17.1", + "jsonrpsee-ws-client 0.17.1", "tracing", ] @@ -4452,19 +4465,38 @@ checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" dependencies = [ "futures-util", "http", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.2", + "jsonrpsee-types 0.16.2", "pin-project", "rustls-native-certs", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-util", "tracing", "webpki-roots", ] +[[package]] +name = "jsonrpsee-client-transport" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca00d975eda834826b04ad57d4e690c67439bb51b02eb0f8b7e4c30fcef8ab9" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core 0.17.1", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.24.0", + "tokio-util", + "tracing", +] + [[package]] name = "jsonrpsee-core" version = "0.16.2" @@ -4481,7 +4513,7 @@ dependencies = [ "futures-util", "globset", "hyper", - "jsonrpsee-types", + "jsonrpsee-types 0.16.2", "parking_lot 0.12.1", "rand 0.8.5", "rustc-hash", @@ -4493,6 +4525,28 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-core" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b83cca7a5a7899eed8b2935d5f755c8c4052ad66ab5b328bd34ac2b3ffd3515f" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "jsonrpsee-types 0.17.1", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "jsonrpsee-http-client" version = "0.16.2" @@ -4502,8 +4556,8 @@ dependencies = [ "async-trait", "hyper", "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.2", + "jsonrpsee-types 0.16.2", "rustc-hash", "serde", "serde_json", @@ -4525,6 +4579,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d814a21d9a819f8de1a41b819a263ffd68e4bb5f043d936db1c49b54684bde0a" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", +] + [[package]] name = "jsonrpsee-server" version = "0.16.2" @@ -4535,8 +4602,8 @@ dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.2", + "jsonrpsee-types 0.16.2", "serde", "serde_json", "soketto", @@ -4561,6 +4628,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-types" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd301ccc3e08718393432d1961539d78c4580dcca86014dfe6769c308b2c08b2" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "jsonrpsee-ws-client" version = "0.16.2" @@ -4568,9 +4649,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" dependencies = [ "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.16.2", + "jsonrpsee-core 0.16.2", + "jsonrpsee-types 0.16.2", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a69852133d549b07cb37ff2d0ec540eae0d20abb75ae923f5d39bc7536d987" +dependencies = [ + "http", + "jsonrpsee-client-transport 0.17.1", + "jsonrpsee-core 0.17.1", + "jsonrpsee-types 0.17.1", ] [[package]] @@ -5598,7 +5691,7 @@ dependencies = [ "clap 4.2.4", "frame-benchmarking", "frame-benchmarking-cli", - "jsonrpsee", + "jsonrpsee 0.16.2", "millau-runtime", "mmr-rpc", "node-inspect", @@ -5749,7 +5842,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "anyhow", - "jsonrpsee", + "jsonrpsee 0.16.2", "parity-scale-codec", "serde", "sp-api", @@ -7255,7 +7348,7 @@ name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.2", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -8488,7 +8581,7 @@ name = "polkadot-rpc" version = "0.9.39" source = "git+https://github.com/paritytech/polkadot?branch=master#ae96e09e6ad1810b8d04d4530c07173e604a763d" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.2", "mmr-rpc", "pallet-transaction-payment-rpc", "polkadot-primitives", @@ -9685,7 +9778,7 @@ dependencies = [ "frame-support", "frame-system", "futures", - "jsonrpsee", + "jsonrpsee 0.17.1", "log", "num-traits", "pallet-balances", @@ -9831,7 +9924,7 @@ dependencies = [ "cumulus-relay-chain-interface", "frame-benchmarking", "frame-benchmarking-cli", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "pallet-transaction-payment-rpc", "parity-scale-codec", @@ -10284,6 +10377,18 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07180898a28ed6a7f7ba2311594308f595e3dd2e3c3812fa0a80a47b45f17e5d" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" version = "0.6.2" @@ -10305,6 +10410,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -10644,7 +10759,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.16.2", "sc-consensus-babe", "sc-consensus-epochs", "sc-rpc-api", @@ -10701,7 +10816,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -10774,7 +10889,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c dependencies = [ "finality-grandpa", "futures", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "sc-client-api", @@ -11156,7 +11271,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -11185,7 +11300,7 @@ name = "sc-rpc-api" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.2", "parity-scale-codec", "sc-chain-spec", "sc-transaction-pool-api", @@ -11205,7 +11320,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "http", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "serde_json", "substrate-prometheus-endpoint", @@ -11223,7 +11338,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -11250,7 +11365,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -11338,7 +11453,7 @@ name = "sc-sync-state-rpc" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.2", "parity-scale-codec", "sc-chain-spec", "sc-client-api", @@ -13002,7 +13117,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "sc-rpc-api", @@ -13139,7 +13254,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ "async-trait", - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "sc-rpc-api", "serde", @@ -13151,7 +13266,7 @@ name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#a6cb6d0fb79c303c9af513e856abfb61fc6d8d74" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.2", "log", "parity-scale-codec", "sc-client-api", @@ -13237,7 +13352,7 @@ dependencies = [ "frame-metadata", "heck 0.4.1", "hex", - "jsonrpsee", + "jsonrpsee 0.16.2", "parity-scale-codec", "proc-macro-error", "proc-macro2 1.0.56", @@ -13615,6 +13730,16 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "tokio-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +dependencies = [ + "rustls 0.21.0", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.12" diff --git a/bin/rialto/runtime/src/lib.rs b/bin/rialto/runtime/src/lib.rs index aeb0a3a7c57..b325332acba 100644 --- a/bin/rialto/runtime/src/lib.rs +++ b/bin/rialto/runtime/src/lib.rs @@ -495,7 +495,7 @@ construct_runtime!( Scheduler: polkadot_runtime_parachains::scheduler::{Pallet, Storage}, Paras: polkadot_runtime_parachains::paras::{Pallet, Call, Storage, Event, Config}, Initializer: polkadot_runtime_parachains::initializer::{Pallet, Call, Storage}, - Dmp: polkadot_runtime_parachains::dmp::{Pallet, Call, Storage}, + Dmp: polkadot_runtime_parachains::dmp::{Pallet, Storage}, Ump: polkadot_runtime_parachains::ump::{Pallet, Call, Storage, Event}, Hrmp: polkadot_runtime_parachains::hrmp::{Pallet, Call, Storage, Event, Config}, SessionInfo: polkadot_runtime_parachains::session_info::{Pallet, Storage}, diff --git a/relays/client-substrate/Cargo.toml b/relays/client-substrate/Cargo.toml index 2a79832bf9d..90904ab9be1 100644 --- a/relays/client-substrate/Cargo.toml +++ b/relays/client-substrate/Cargo.toml @@ -10,7 +10,7 @@ async-std = { version = "1.6.5", features = ["attributes"] } async-trait = "0.1" codec = { package = "parity-scale-codec", version = "3.1.5" } futures = "0.3.28" -jsonrpsee = { version = "0.16", features = ["macros", "ws-client"] } +jsonrpsee = { version = "0.17", features = ["macros", "ws-client"] } log = "0.4.17" num-traits = "0.2" rand = "0.8" diff --git a/relays/client-substrate/src/client.rs b/relays/client-substrate/src/client.rs index 27af7d7d77f..91ff7b9a214 100644 --- a/relays/client-substrate/src/client.rs +++ b/relays/client-substrate/src/client.rs @@ -231,7 +231,7 @@ impl Client { let client = tokio .spawn(async move { RpcClientBuilder::default() - .max_notifs_per_subscription(MAX_SUBSCRIPTION_CAPACITY) + .max_buffer_capacity_per_subscription(MAX_SUBSCRIPTION_CAPACITY) .build(&uri) .await }) diff --git a/relays/client-substrate/src/error.rs b/relays/client-substrate/src/error.rs index 54247c5dc17..40015c122bb 100644 --- a/relays/client-substrate/src/error.rs +++ b/relays/client-substrate/src/error.rs @@ -138,13 +138,11 @@ impl Error { impl MaybeConnectionError for Error { fn is_connection_error(&self) -> bool { match *self { - Error::RpcError(RpcError::Transport(_)) - // right now if connection to the ws server is dropped (after it is already established), - // we're getting this error - | Error::RpcError(RpcError::Internal(_)) - | Error::RpcError(RpcError::RestartNeeded(_)) - | Error::ClientNotSynced(_) => true, - Error::FailedToReadBestFinalizedHeaderHash { ref error, .. } => error.is_connection_error(), + Error::RpcError(RpcError::Transport(_)) | + Error::RpcError(RpcError::RestartNeeded(_)) | + Error::ClientNotSynced(_) => true, + Error::FailedToReadBestFinalizedHeaderHash { ref error, .. } => + error.is_connection_error(), Error::FailedToReadBestHeader { ref error, .. } => error.is_connection_error(), Error::FailedToReadHeaderByHash { ref error, .. } => error.is_connection_error(), Error::ErrorExecutingRuntimeCall { ref error, .. } => error.is_connection_error(), diff --git a/relays/client-substrate/src/rpc.rs b/relays/client-substrate/src/rpc.rs index 083b1dea761..94726e49187 100644 --- a/relays/client-substrate/src/rpc.rs +++ b/relays/client-substrate/src/rpc.rs @@ -73,7 +73,7 @@ pub(crate) trait SubstrateAuthor { async fn pending_extrinsics(&self) -> RpcResult>; /// Submit and watch for extrinsic state. #[subscription(name = "submitAndWatchExtrinsic", unsubscribe = "unwatchExtrinsic", item = TransactionStatusOf)] - fn submit_and_watch_extrinsic(&self, extrinsic: Bytes); + async fn submit_and_watch_extrinsic(&self, extrinsic: Bytes); } /// RPC methods of Substrate `state` namespace, that we are using. @@ -118,7 +118,7 @@ pub trait SubstrateFinalityClient { pub(crate) trait SubstrateGrandpa { /// Subscribe to GRANDPA justifications. #[subscription(name = "subscribeJustifications", unsubscribe = "unsubscribeJustifications", item = Bytes)] - fn subscribe_justifications(&self); + async fn subscribe_justifications(&self); } /// RPC finality methods of Substrate `grandpa` namespace, that we are using. @@ -136,7 +136,7 @@ impl SubstrateFinalityClient for SubstrateGrandpaFinalit pub(crate) trait SubstrateBeefy { /// Subscribe to BEEFY justifications. #[subscription(name = "subscribeJustifications", unsubscribe = "unsubscribeJustifications", item = Bytes)] - fn subscribe_justifications(&self); + async fn subscribe_justifications(&self); } /// RPC finality methods of Substrate `beefy` namespace, that we are using.