Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

rpc: backpressured RPC server (bump jsonrpsee 0.20) #13992

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d9e1bce
companion for jsonrpsee v0.17
niklasad1 Feb 9, 2023
0a29b07
dummy debug
niklasad1 Feb 24, 2023
e22f92a
rewrite me
niklasad1 Feb 24, 2023
7963722
adjust to custom subscription close type
niklasad1 Mar 20, 2023
5c2f8e6
Merge remote-tracking branch 'origin/na-jsonrpsee-v0.17-dev' into na-…
niklasad1 Mar 20, 2023
1e74b39
hack hack
niklasad1 Mar 20, 2023
8e9ad00
update jsonrpsee
niklasad1 Apr 18, 2023
d3ff524
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.17-dev
niklasad1 Apr 18, 2023
637ad0a
jsonrpsee v0.18
niklasad1 Apr 18, 2023
186cf03
Update client/rpc-servers/src/lib.rs
niklasad1 Apr 24, 2023
4944827
Update client/rpc-servers/src/lib.rs
niklasad1 Apr 24, 2023
da26f68
cleanup
niklasad1 Apr 25, 2023
63f6324
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 Apr 25, 2023
26aee9a
Update client/rpc/src/chain/chain_full.rs
niklasad1 Apr 25, 2023
7e01e10
fix rpcv2 tests
niklasad1 Apr 25, 2023
829bfad
Merge remote-tracking branch 'origin/na-jsonrpsee-v0.18' into na-json…
niklasad1 Apr 25, 2023
467493e
fix compile warns
niklasad1 Apr 25, 2023
2473f9e
update jsonrpsee branch
niklasad1 Apr 26, 2023
a67132c
update jsonrpsee v0.18.1
niklasad1 Apr 27, 2023
67cd9a6
remove ugly todo's
niklasad1 Apr 27, 2023
7283a0b
use subscription task executor
niklasad1 Apr 28, 2023
2cdd93f
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 Apr 28, 2023
1254b6b
update remote externalities
niklasad1 Apr 28, 2023
1dc07a5
fix nits
niklasad1 Apr 28, 2023
f6e4d86
Update client/rpc/src/lib.rs
niklasad1 Apr 28, 2023
c0f48c0
fix tests
niklasad1 Apr 28, 2023
de38a42
Merge remote-tracking branch 'origin/na-jsonrpsee-v0.18' into na-json…
niklasad1 Apr 28, 2023
cc06028
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 May 9, 2023
959ebf0
fix tests
niklasad1 May 9, 2023
da0d083
make it possible to configure buf capacity
niklasad1 May 9, 2023
6ca0bb2
Update client/cli/src/config.rs
niklasad1 May 10, 2023
4e0eff7
Update client/rpc/src/lib.rs
niklasad1 May 10, 2023
c77a429
Update client/cli/src/config.rs
niklasad1 May 10, 2023
cb2697f
Update client/cli/src/config.rs
niklasad1 May 10, 2023
b74462e
address grumbles
niklasad1 May 10, 2023
9e31b66
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 May 10, 2023
b5f6d8c
jsonrpsee v0.18.2
niklasad1 May 11, 2023
32c267b
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
May 11, 2023
b2d5b9b
Remove the `Copy` bound on `CollectionId` in the uniques pallet (#14111)
koute May 10, 2023
c360e4b
Timeout only if the referendum is not queued (#14106)
gavofyork May 10, 2023
c4bacfc
Include `node-template-release` in workspace (#14103)
ggwpez May 10, 2023
b8ed4bf
Bump `kvdb-rocksdb` to 0.19.0 (#14113)
tdimitrov May 10, 2023
008cef2
Remove `#[pallet::generate_storage_info]` from docs (#14116)
ggwpez May 10, 2023
e9057bc
Bump `Cargo.lock` (#14121)
rcny May 10, 2023
104d269
Prepare `sc-network` for `ProtocolController`/`NotificationService` (…
altonen May 11, 2023
a994ea6
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
May 12, 2023
1e4a58f
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 May 17, 2023
84c2d99
pin jsonrpsee to commit
niklasad1 May 17, 2023
978b2dd
decrease message buffer to 16
niklasad1 May 17, 2023
4c5a1c1
Merge remote-tracking branch 'origin/na-jsonrpsee-v0.18' into na-json…
niklasad1 May 17, 2023
68ddbc3
rpc helper: unwrap -> unwrap_or
niklasad1 May 18, 2023
d9fa3f7
update jsonrpsee
niklasad1 May 30, 2023
a419864
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 May 31, 2023
c3a2bb9
rpc: subscribe_storage use spawn_blocking
niklasad1 Jun 17, 2023
b431bd4
change default rpc message buffer
niklasad1 Jun 17, 2023
5f9e023
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 Jun 17, 2023
29b7589
fix nit
niklasad1 Jun 17, 2023
8e16ee0
add some debug logs
niklasad1 Jun 24, 2023
8af945e
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 Jun 24, 2023
c7e3e78
Merge remote-tracking branch 'origin/master' into na-jsonrpsee-v0.18
niklasad1 Jun 24, 2023
520aa85
update jsonrpsee
niklasad1 Jun 24, 2023
86f2938
revert me
niklasad1 Jun 27, 2023
0d1544e
update jsonrpsee
niklasad1 Jun 30, 2023
176500e
jsonrpsee v0.19
niklasad1 Jul 31, 2023
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
110 changes: 80 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,6 @@ inherits = "release"
lto = "fat"
# https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
codegen-units = 1

[patch.crates-io]
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee", branch = "na-server-throw-away-permit" }
2 changes: 1 addition & 1 deletion bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ frame-system = { version = "4.0.0-dev", path = "../../../frame/system" }
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = "../../../frame/transaction-payment" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.16.2", features = ["server"] }
jsonrpsee = { version = "0.18.2", 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 @@ -39,7 +39,7 @@ array-bytes = "4.1"
clap = { version = "4.2.5", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.2.2" }
serde = { version = "1.0.136", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
jsonrpsee = { version = "0.18.2", features = ["server"] }
futures = "0.3.21"
log = "0.4.17"
rand = "0.8"
Expand Down
1 change: 1 addition & 0 deletions bin/node/cli/benches/block_production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
rpc_id_provider: Default::default(),
rpc_max_subs_per_conn: Default::default(),
rpc_port: 9944,
rpc_message_buffer_capacity: Default::default(),
prometheus_config: None,
telemetry_endpoints: None,
default_heap_pages: None,
Expand Down
1 change: 1 addition & 0 deletions bin/node/cli/benches/transaction_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
rpc_id_provider: Default::default(),
rpc_max_subs_per_conn: Default::default(),
rpc_port: 9944,
rpc_message_buffer_capacity: Default::default(),
prometheus_config: None,
telemetry_endpoints: None,
default_heap_pages: None,
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 @@ -13,7 +13,7 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.16.2", features = ["server"] }
jsonrpsee = { version = "0.18.2", features = ["server"] }
node-primitives = { version = "2.0.0", path = "../primitives" }
pallet-transaction-payment-rpc = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/rpc/" }
mmr-rpc = { version = "4.0.0-dev", path = "../../../client/merkle-mountain-range/rpc/" }
Expand Down
19 changes: 17 additions & 2 deletions client/cli/src/commands/run_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
},
CliConfiguration, PrometheusParams, RuntimeParams, TelemetryParams,
RPC_DEFAULT_MAX_CONNECTIONS, RPC_DEFAULT_MAX_REQUEST_SIZE_MB, RPC_DEFAULT_MAX_RESPONSE_SIZE_MB,
RPC_DEFAULT_MAX_SUBS_PER_CONN,
RPC_DEFAULT_MAX_SUBS_PER_CONN, RPC_DEFAULT_MESSAGE_CAPACITY_PER_CONN,
};
use clap::Parser;
use regex::Regex;
Expand Down Expand Up @@ -87,7 +87,7 @@ pub struct RunCmd {
#[arg(long, default_value_t = RPC_DEFAULT_MAX_RESPONSE_SIZE_MB)]
pub rpc_max_response_size: u32,

/// Set the the maximum concurrent subscriptions per connection.
/// Set the maximum concurrent subscriptions per connection.
#[arg(long, default_value_t = RPC_DEFAULT_MAX_SUBS_PER_CONN)]
pub rpc_max_subscriptions_per_connection: u32,

Expand All @@ -107,6 +107,17 @@ pub struct RunCmd {
#[arg(long, value_name = "ORIGINS", value_parser = parse_cors)]
pub rpc_cors: Option<Cors>,

/// The number of messages the RPC server is allowed to keep in memory.
///
/// If the buffer becomes full then the server will not process
/// new messages until the connected client start reading the
/// underlying messages.
///
/// This applies per connection which includes both
/// JSON-RPC methods calls and subscriptions.
#[arg(long, default_value_t = RPC_DEFAULT_MESSAGE_CAPACITY_PER_CONN)]
pub rpc_message_buffer_capacity_per_connection: u32,

/// The human-readable name for this node.
/// It's used as network node name.
#[arg(long, value_name = "NAME")]
Expand Down Expand Up @@ -365,6 +376,10 @@ impl CliConfiguration for RunCmd {
Ok(self.rpc_max_subscriptions_per_connection)
}

fn rpc_buffer_capacity_per_connection(&self) -> Result<u32> {
Ok(self.rpc_message_buffer_capacity_per_connection)
}

fn transaction_pool(&self, is_dev: bool) -> Result<TransactionPoolOptions> {
Ok(self.pool_config.transaction_pool(is_dev))
}
Expand Down
Loading