Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chainHead: Allow methods to be called from within a single connection context and limit connections #3481

Merged
merged 40 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d99e173
Update jsonrpsee to branch PR
lexnv Feb 23, 2024
dd0a68f
rpc-v2: Implement connection limiter struct
lexnv Feb 26, 2024
09b7fc6
chainHead/api: Register raw methods for chainHead methods
lexnv Feb 26, 2024
7c682a4
chainHead: Allow chainHead to be called from a single connection
lexnv Feb 26, 2024
a38df08
chainHead/tests: Check multiple connection calls
lexnv Feb 26, 2024
ec9dd79
chainHead/tests: Ensure single connection works
lexnv Feb 26, 2024
e47477a
chainHead/tests: Ensure unpin does not work from different connections
lexnv Feb 26, 2024
64ee521
Cargo: Update jsonrpsee to 0.22.2 unreleased
lexnv Mar 5, 2024
683ecca
chainHead: Use connection details instead of connection id
lexnv Mar 5, 2024
e6547d6
cargo: Use jsonrpsee from crates.io
lexnv Mar 5, 2024
f215aa9
Merge branch 'master' into lexnv/single-chain-head-connection
lexnv Mar 15, 2024
1a503d2
chainHead/tests: Fix merge conflict with master
lexnv Mar 15, 2024
ad98383
rpc-v2/common: Limit the number of subscriptions for a connection ID
lexnv Mar 19, 2024
07a18a6
chainHead/config: Add max follow subscriptions per connection
lexnv Mar 19, 2024
d3fc06a
chainHead: Limit number of chainHead_follow subscriptions
lexnv Mar 19, 2024
493f933
chainHead: Add RAII wrappers for managing registering tokens
lexnv Mar 19, 2024
4b34a3b
chainHead/tests: Adjust testing
lexnv Mar 19, 2024
e726a51
chainHead/follow: Early detection when chainHead client is disconnected
lexnv Mar 19, 2024
539291d
chainHead/tests: Check connection limits
lexnv Mar 19, 2024
d5ce140
Update substrate/client/rpc-spec-v2/Cargo.toml
lexnv Mar 19, 2024
378d9b9
Update cargo lock
lexnv Mar 19, 2024
36e986f
chainHead: Clarify connection context for methods
lexnv Mar 19, 2024
9405b8a
chainHead: Adjust comment wrt jsonrpc future
lexnv Mar 19, 2024
e506c6a
chainHead: Generate runtime call event after the future is propagated
lexnv Mar 19, 2024
fe460db
chainHead/tests: Adjust testing to use jsonrpsee macro interface
lexnv Mar 19, 2024
827254c
Merge branch 'master' into lexnv/single-chain-head-connection
lexnv Mar 19, 2024
512d816
Update cargo.lock
lexnv Mar 19, 2024
109d2b7
rpc-v2/connections: Check empty connection cleans the connection ID
lexnv Mar 20, 2024
71cbfeb
chainHead: Encapsulate rpc connections with subscription management
lexnv Mar 20, 2024
0e015ab
subscription/tests: Check resource cleanup on drop
lexnv Mar 20, 2024
65e26e4
Update substrate/client/rpc-spec-v2/src/common/connections.rs
lexnv Mar 20, 2024
aae5a11
chainHead/connections: Detect duplicate tokens
lexnv Mar 20, 2024
f06138b
chainHead/connections: Change connection names
lexnv Mar 20, 2024
f78d74b
chainHead: Add comment for limit reached on invalid subscription ID
lexnv Mar 26, 2024
9b9d196
chainHead: Guard fn with cfg test
lexnv Mar 27, 2024
9e7803e
chainHead/tests: Adjust comment
lexnv Mar 27, 2024
f56316a
rpc-v2/connections: Remove data on empty identifiers as well
lexnv Mar 27, 2024
8a11f0e
Merge remote-tracking branch 'origin/master' into lexnv/single-chain-…
lexnv Mar 27, 2024
5d4d494
Merge branch 'master' into lexnv/single-chain-head-connection
lexnv Apr 2, 2024
5195aa9
rpc-v2/cargo: Fix taplo check
lexnv Apr 2, 2024
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
160 changes: 131 additions & 29 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tokio-util = { version = "0.7.8", features = ["compat"] }
futures = "0.3.28"
futures-timer = "3.0.2"
parity-scale-codec = "3.6.4"
jsonrpsee = { version = "0.22", features = ["ws-client"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["ws-client"] }
niklasad1 marked this conversation as resolved.
Show resolved Hide resolved
tracing = "0.1.37"
async-trait = "0.1.74"
url = "2.4.0"
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clap = { version = "4.5.1", features = ["derive"] }
log = { workspace = true, default-features = true }
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { features = ["derive"], workspace = true, default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
futures = "0.3.28"
serde_json = { workspace = true, default-features = true }

Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ coretime-rococo-runtime = { path = "../parachains/runtimes/coretime/coretime-roc
coretime-westend-runtime = { path = "../parachains/runtimes/coretime/coretime-westend" }
bridge-hub-westend-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-westend" }
penpal-runtime = { path = "../parachains/runtimes/testing/penpal" }
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
people-rococo-runtime = { path = "../parachains/runtimes/people/people-rococo" }
people-westend-runtime = { path = "../parachains/runtimes/people/people-westend" }
parachains-common = { path = "../parachains/common" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async-trait = "0.1.74"
clap = { version = "4.5.1", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
criterion = { version = "0.5.1", features = ["async_tokio"] }
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
rand = "0.8.5"
serde = { features = ["derive"], workspace = true, default-features = true }
serde_json = { workspace = true, default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Polkadot specific RPC functionality."
workspace = true

[dependencies]
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
polkadot-primitives = { path = "../primitives" }
sc-client-api = { path = "../../substrate/client/api" }
sp-blockchain = { path = "../../substrate/primitives/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/minimal/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name = "minimal-node"
clap = { version = "4.5.1", features = ["derive"] }
futures = { version = "0.3.21", features = ["thread-pool"] }
futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
serde_json = { workspace = true, default-features = true }

sc-cli = { path = "../../../client/cli" }
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ frame-system = { path = "../../../frame/system" }
pallet-transaction-payment = { path = "../../../frame/transaction-payment", default-features = false }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
sp-api = { path = "../../../primitives/api" }
sc-rpc-api = { path = "../../../client/rpc-api" }
sp-blockchain = { path = "../../../primitives/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ array-bytes = "6.1"
clap = { version = "4.5.1", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1" }
serde = { features = ["derive"], workspace = true, default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
futures = "0.3.21"
log = { workspace = true, default-features = true }
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.22", features = ["server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["server"] }
node-primitives = { path = "../primitives" }
pallet-transaction-payment-rpc = { path = "../../../frame/transaction-payment/rpc" }
mmr-rpc = { path = "../../../client/merkle-mountain-range/rpc" }
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/consensus/babe/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.22", features = ["client-core", "macros", "server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["client-core", "macros", "server"] }
futures = "0.3.21"
serde = { features = ["derive"], workspace = true, default-features = true }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/consensus/beefy/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
futures = "0.3.21"
jsonrpsee = { version = "0.22", features = ["client-core", "macros", "server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["client-core", "macros", "server"] }
log = { workspace = true, default-features = true }
parking_lot = "0.12.1"
serde = { features = ["derive"], workspace = true, default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/consensus/grandpa/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workspace = true
[dependencies]
finality-grandpa = { version = "0.16.2", features = ["derive-codec"] }
futures = "0.3.16"
jsonrpsee = { version = "0.22", features = ["client-core", "macros", "server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["client-core", "macros", "server"] }
log = { workspace = true, default-features = true }
parity-scale-codec = { version = "3.6.1", features = ["derive"] }
serde = { features = ["derive"], workspace = true, default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/consensus/manual-seal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.22", features = ["client-core", "macros", "server"] }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee.git", branch = "lexnv/low-level-context-api-v2", features = ["client-core", "macros", "server"] }
assert_matches = "1.3.0"
async-trait = "0.1.74"
codec = { package = "parity-scale-codec", version = "3.6.1" }
Expand Down
Loading
Loading