Files
pezkuwi-subxt/cumulus/test/service/Cargo.toml
T
Niklas Adolfsson e16ef0861f rpc: backpressured RPC server (bump jsonrpsee 0.20) (#1313)
This is a rather big change in jsonrpsee, the major things in this bump
are:
- Server backpressure (the subscription impls are modified to deal with
that)
- Allow custom error types / return types (remove jsonrpsee::core::Error
and jsonrpee::core::CallError)
- Bug fixes (graceful shutdown in particular not used by substrate
anyway)
   - Less dependencies for the clients in particular
   - Return type requires Clone in method call responses
   - Moved to tokio channels
   - Async subscription API (not used in this PR)

Major changes in this PR:
- The subscriptions are now bounded and if subscription can't keep up
with the server it is dropped
- CLI: add parameter to configure the jsonrpc server bounded message
buffer (default is 64)
- Add our own subscription helper to deal with the unbounded streams in
substrate

The most important things in this PR to review is the added helpers
functions in `substrate/client/rpc/src/utils.rs` and the rest is pretty
much chore.

Regarding the "bounded buffer limit" it may cause the server to handle
the JSON-RPC calls
slower than before.

The message size limit is bounded by "--rpc-response-size" thus "by
default 10MB * 64 = 640MB"
but the subscription message size is not covered by this limit and could
be capped as well.

Hopefully the last release prior to 1.0, sorry in advance for a big PR

Previous attempt: https://github.com/paritytech/substrate/pull/13992

Resolves https://github.com/paritytech/polkadot-sdk/issues/748, resolves
https://github.com/paritytech/polkadot-sdk/issues/627
2024-01-23 08:55:13 +00:00

147 lines
5.9 KiB
TOML

[package]
name = "cumulus-test-service"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
publish = false
[lints]
workspace = true
[[bin]]
name = "test-parachain"
path = "src/main.rs"
[dependencies]
async-trait = "0.1.74"
clap = { version = "4.4.18", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
criterion = { version = "0.5.1", features = ["async_tokio"] }
jsonrpsee = { version = "0.20.3", features = ["server"] }
rand = "0.8.5"
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
tokio = { version = "1.32.0", features = ["macros"] }
tracing = "0.1.37"
url = "2.4.0"
tempfile = "3.8.0"
# Substrate
frame-system = { path = "../../../substrate/frame/system" }
frame-system-rpc-runtime-api = { path = "../../../substrate/frame/system/rpc/runtime-api" }
pallet-transaction-payment = { path = "../../../substrate/frame/transaction-payment" }
sc-basic-authorship = { path = "../../../substrate/client/basic-authorship" }
sc-chain-spec = { path = "../../../substrate/client/chain-spec" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-consensus = { path = "../../../substrate/client/consensus/common" }
sc-executor = { path = "../../../substrate/client/executor" }
sc-network = { path = "../../../substrate/client/network" }
sc-service = { path = "../../../substrate/client/service" }
sc-tracing = { path = "../../../substrate/client/tracing" }
sc-transaction-pool = { path = "../../../substrate/client/transaction-pool" }
sc-transaction-pool-api = { path = "../../../substrate/client/transaction-pool/api" }
sc-telemetry = { path = "../../../substrate/client/telemetry" }
sp-arithmetic = { path = "../../../substrate/primitives/arithmetic" }
sp-blockchain = { path = "../../../substrate/primitives/blockchain" }
sp-core = { path = "../../../substrate/primitives/core" }
sp-io = { path = "../../../substrate/primitives/io" }
sp-api = { path = "../../../substrate/primitives/api" }
sp-keyring = { path = "../../../substrate/primitives/keyring" }
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
sp-state-machine = { path = "../../../substrate/primitives/state-machine" }
sp-tracing = { path = "../../../substrate/primitives/tracing" }
sp-timestamp = { path = "../../../substrate/primitives/timestamp" }
sp-consensus = { path = "../../../substrate/primitives/consensus/common" }
substrate-test-client = { path = "../../../substrate/test-utils/client" }
sc-cli = { path = "../../../substrate/client/cli" }
sc-block-builder = { path = "../../../substrate/client/block-builder" }
sc-executor-wasmtime = { path = "../../../substrate/client/executor/wasmtime" }
sc-executor-common = { path = "../../../substrate/client/executor/common" }
# Polkadot
polkadot-primitives = { path = "../../../polkadot/primitives" }
polkadot-service = { path = "../../../polkadot/node/service" }
polkadot-test-service = { path = "../../../polkadot/node/test/service" }
polkadot-cli = { path = "../../../polkadot/cli" }
polkadot-node-subsystem = { path = "../../../polkadot/node/subsystem" }
polkadot-overseer = { path = "../../../polkadot/node/overseer" }
# Cumulus
cumulus-client-cli = { path = "../../client/cli" }
parachains-common = { path = "../../parachains/common" }
cumulus-client-consensus-common = { path = "../../client/consensus/common" }
cumulus-client-consensus-relay-chain = { path = "../../client/consensus/relay-chain" }
cumulus-client-parachain-inherent = { path = "../../client/parachain-inherent" }
cumulus-client-service = { path = "../../client/service" }
cumulus-primitives-core = { path = "../../primitives/core" }
cumulus-relay-chain-inprocess-interface = { path = "../../client/relay-chain-inprocess-interface" }
cumulus-relay-chain-interface = { path = "../../client/relay-chain-interface" }
cumulus-test-runtime = { path = "../runtime" }
cumulus-relay-chain-minimal-node = { path = "../../client/relay-chain-minimal-node" }
cumulus-client-pov-recovery = { path = "../../client/pov-recovery" }
cumulus-test-relay-sproof-builder = { path = "../relay-sproof-builder" }
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook"] }
pallet-timestamp = { path = "../../../substrate/frame/timestamp" }
[dev-dependencies]
futures = "0.3.28"
portpicker = "0.1.1"
rococo-parachain-runtime = { path = "../../parachains/runtimes/testing/rococo-parachain" }
pallet-im-online = { path = "../../../substrate/frame/im-online" }
sp-consensus-grandpa = { path = "../../../substrate/primitives/consensus/grandpa" }
sp-authority-discovery = { path = "../../../substrate/primitives/authority-discovery" }
cumulus-test-client = { path = "../client" }
# Polkadot dependencies
polkadot-test-service = { path = "../../../polkadot/node/test/service" }
# Substrate dependencies
sc-cli = { path = "../../../substrate/client/cli" }
substrate-test-utils = { path = "../../../substrate/test-utils" }
[features]
runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"cumulus-test-client/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"polkadot-test-service/runtime-benchmarks",
"rococo-parachain-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
[[bench]]
name = "transaction_throughput"
harness = false
[[bench]]
name = "block_import"
harness = false
[[bench]]
name = "block_production"
harness = false
[[bench]]
name = "block_production_glutton"
harness = false
[[bench]]
name = "block_import_glutton"
harness = false
[[bench]]
name = "validate_block"
harness = false
[[bench]]
name = "validate_block_glutton"
harness = false