Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update jsonrpsee
  • Loading branch information
niklasad1 committed Feb 3, 2022
commit fea60dd26e203e7871bc4c549300b1cdd6d70e65
198 changes: 132 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" }
sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
sc-rpc = { version = "4.0.0-dev", path = "../../../client/rpc" }
sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sc-rpc-api = { version = "0.10.0-dev", path = "../../../client/rpc-api" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clap = { version = "3.0", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "2.0.0" }
serde = { version = "1.0.132", features = ["derive"] }
futures = "0.3.16"
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
hex-literal = "0.3.4"
log = "0.4.8"
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion bin/node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
node-primitives = { version = "2.0.0", path = "../primitives" }
pallet-contracts-rpc = { version = "4.0.0-dev", path = "../../../frame/contracts/rpc/" }
pallet-mmr-rpc = { version = "3.0.0", path = "../../../frame/merkle-mountain-range/rpc/" }
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parking_lot = "0.11"
thiserror = "1.0"
serde = { version = "1.0.132", features = ["derive"] }

jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }

codec = { version = "2.2.0", package = "parity-scale-codec", features = ["derive"] }

Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
sc-consensus-babe = { version = "0.10.0-dev", path = "../" }
sc-rpc-api = { version = "0.10.0-dev", path = "../../../rpc-api" }
sp-consensus-babe = { version = "0.10.0-dev", path = "../../../../primitives/consensus/babe" }
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/manual-seal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
thiserror = "1.0"
futures = "0.3.9"

jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
log = "0.4"
codec = { package = "parity-scale-codec", version = "2.0.0" }
serde = { version = "1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion client/finality-grandpa/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain"
sp-core = { version = "5.0.0", path = "../../../primitives/core" }
sp-runtime = { version = "5.0.0", path = "../../../primitives/runtime" }
finality-grandpa = { version = "0.14.4", features = ["derive-codec"] }
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
futures = "0.3.4"
serde = { version = "1.0.105", features = ["derive"] }
serde_json = "1.0.50"
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ serde_json = "1.0.74"
sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/api" }
sp-rpc = { version = "5.0.0", path = "../../primitives/rpc" }
sp-tracing = { version = "4.0.0", path = "../../primitives/tracing" }
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
2 changes: 1 addition & 1 deletion client/rpc-servers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
anyhow = "1"
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
log = "0.4.8"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.10.0-dev"}
serde_json = "1.0.74"
Expand Down
11 changes: 8 additions & 3 deletions client/rpc-servers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use jsonrpsee::{
http_server::{AccessControlBuilder, HttpServerBuilder, HttpServerHandle},
ws_server::{IdProvider, WsServerBuilder, WsServerHandle},
ws_server::{IdProvider, RandomStringIdProvider, WsServerBuilder, WsServerHandle},
RpcModule,
};
use std::net::SocketAddr;
Expand Down Expand Up @@ -95,7 +95,7 @@ pub fn start_ws<M: Send + Sync + 'static>(
metrics: Option<RpcMetrics>,
rpc_api: RpcModule<M>,
rt: tokio::runtime::Handle,
_id_provider: Option<Box<dyn IdProvider>>,
id_provider: Option<Box<dyn IdProvider>>,
) -> Result<WsServerHandle, anyhow::Error> {
let max_request_body_size = max_payload_mb
.map(|mb| mb.saturating_mul(MEGABYTE))
Expand All @@ -105,9 +105,14 @@ pub fn start_ws<M: Send + Sync + 'static>(
let mut builder = WsServerBuilder::new()
.max_request_body_size(max_request_body_size as u32)
.max_connections(max_connections as u64)
//.set_id_provider(id_provider.unwrap())
.custom_tokio_runtime(rt.clone());

if let Some(provider) = id_provider {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this to avoid to have to Box<RandomStringIdProvider>, a little awkward but...

builder = builder.set_id_provider(provider);
} else {
builder = builder.set_id_provider(RandomStringIdProvider::new(16));
};

if let Some(cors) = cors {
// Whitelist listening address.
// NOTE: set_allowed_hosts will whitelist both ports but only one will used.
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sc-tracing = { version = "4.0.0-dev", path = "../tracing" }
hash-db = { version = "0.15.2", default-features = false }
parking_lot = "0.11.2"
lazy_static = { version = "1.4.0", optional = true }
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
sc-transaction-pool-api = { version = "4.0.0-dev", path = "../transaction-pool/api" }
tokio = { version = "1.15.0", optional = true }

Expand Down
2 changes: 1 addition & 1 deletion client/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wasmtime = ["sc-executor/wasmtime"]
test-helpers = []

[dependencies]
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
thiserror = "1.0.30"
futures = "0.3.16"
rand = "0.7.3"
Expand Down
4 changes: 2 additions & 2 deletions client/service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

//! Service configuration.

use jsonrpsee::ws_server::IdProvider;
pub use jsonrpsee::ws_server::IdProvider;
pub use sc_client_api::execution_extensions::{ExecutionStrategies, ExecutionStrategy};
pub use sc_client_db::{Database, DatabaseSource, KeepBlocks, PruningMode, TransactionStorageMode};
pub use sc_executor::WasmExecutionMethod;
Expand All @@ -44,7 +44,7 @@ use std::{
use tempfile::TempDir;

/// Service configuration.
//#[derive(Debug)]
#[derive(Debug)]
pub struct Configuration {
/// Implementation name
pub impl_name: String,
Expand Down
2 changes: 1 addition & 1 deletion client/sync-state-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
thiserror = "1.0.30"
anyhow = "1"
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
sc-chain-spec = { version = "4.0.0-dev", path = "../chain-spec" }
sc-client-api = { version = "4.0.0-dev", path = "../api" }
sc-consensus-babe = { version = "0.10.0-dev", path = "../consensus/babe" }
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2" }
anyhow = "1"
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
serde = { version = "1", features = ["derive"] }

# Substrate Dependencies
Expand Down
2 changes: 1 addition & 1 deletion frame/merkle-mountain-range/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }
serde_json = "1.0.74"
serde = { version = "1.0.132", features = ["derive"] }

Expand Down
2 changes: 1 addition & 1 deletion frame/transaction-payment/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
anyhow = "1"
codec = { package = "parity-scale-codec", version = "2.0.0" }

jsonrpsee = { version = "0.8.0", features = ["server", "macros"] }
jsonrpsee = { version = "0.9", features = ["server", "macros"] }

sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion utils/frame/remote-externalities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.8", features = ["ws-client", "macros"] }
jsonrpsee = { version = "0.9", features = ["ws-client", "macros"] }

env_logger = "0.9"
frame-support = { path = "../../../frame/support", optional = true, version = "4.0.0-dev" }
Expand Down
4 changes: 2 additions & 2 deletions utils/frame/rpc/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
futures = "0.3.16"
jsonrpsee = { version = "0.8.0", features = ["jsonrpsee-types"] }
jsonrpsee = { version = "0.9", features = ["jsonrpsee-types"] }
codec = { package = "parity-scale-codec", version = "2.0.0" }
serde = "1"
frame-support = { version = "4.0.0-dev", path = "../../../../frame/support" }
Expand All @@ -26,5 +26,5 @@ sc-rpc-api = { version = "0.10.0-dev", path = "../../../../client/rpc-api" }
[dev-dependencies]
frame-system = { version = "4.0.0-dev", path = "../../../../frame/system" }
scale-info = "1.0"
jsonrpsee = { version = "0.8.0", features = ["ws-client", "jsonrpsee-types"] }
jsonrpsee = { version = "0.9", features = ["ws-client", "jsonrpsee-types"] }
tokio = { version = "1.15.0", features = ["macros"] }
2 changes: 1 addition & 1 deletion utils/frame/rpc/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ serde_json = "1"
sc-client-api = { version = "4.0.0-dev", path = "../../../../client/api" }
codec = { package = "parity-scale-codec", version = "2.0.0" }
futures = "0.3.16"
jsonrpsee = { version = "0.8.0", features = ["server"] }
jsonrpsee = { version = "0.9", features = ["server"] }
log = "0.4.8"
sp-runtime = { version = "5.0.0", path = "../../../../primitives/runtime" }
sp-api = { version = "4.0.0-dev", path = "../../../../primitives/api" }
Expand Down
2 changes: 1 addition & 1 deletion utils/frame/try-runtime/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ sp-externalities = { version = "0.11.0", path = "../../../../primitives/external
sp-version = { version = "4.0.0-dev", path = "../../../../primitives/version" }

remote-externalities = { version = "0.10.0-dev", path = "../../remote-externalities" }
jsonrpsee = { version = "0.8.0", default-features = false, features = ["ws-client"] }
jsonrpsee = { version = "0.9", default-features = false, features = ["ws-client"] }