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

rpc: Update jsonrpsee v0.15.1 #11939

Merged
merged 25 commits into from
Aug 2, 2022
Merged

rpc: Update jsonrpsee v0.15.1 #11939

merged 25 commits into from
Aug 2, 2022

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Jul 29, 2022

This PR updates the jsonrpsee crate from v0.14.0 to v0.15.1.

Jsonrpsee Changes

For full list of changes check: jsonrpsee/releases).

  • Middleware trait has been split into HttpMiddleware and WsMiddleware to better capture their differences.
  • Return error from subscription callbacks for better ergonomics and removed the PendingSink concept (you can still manually accept or reject a sink, but otherwise it'll be accepted automatically if you send a message down it).

// cc @jsdw @niklasad1

polkadot companion: paritytech/polkadot#5846
comulus companion: paritytech/cumulus#1487

lexnv added 11 commits July 29, 2022 14:03
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Jul 29, 2022
@lexnv lexnv requested review from bkchr, jsdw and niklasad1 July 29, 2022 15:29
@lexnv lexnv added A7-needspolkadotpr B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jul 29, 2022
lexnv added 2 commits July 29, 2022 19:13
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

great LGTM,

as a follow-up we should update the rpc-api with the client trait overrides and feature-gate the client stuff such that
other crates such as subxt can re-use the API definitions from sc-rpc-api without having to bring lots needless dependencies such as the jsonrpsee server stuff.

lexnv added 2 commits August 1, 2022 13:58
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@jsdw
Copy link
Contributor

jsdw commented Aug 1, 2022

as a follow-up we should update the rpc-api with the client trait overrides and feature-gate the client stuff such that
other crates such as subxt can re-use the API definitions from sc-rpc-api without having to bring lots needless dependencies such as the jsonrpsee server stuff.

Interesting thought; I added an issue in subxt to point at this. Not sure whether we'd want it or not there yet but worth a thought :) paritytech/subxt#605

client/rpc/src/state/mod.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM but let's remove the middleware code duplication :)

Cargo.lock Outdated Show resolved Hide resolved
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

Can you revert the unrelated changes in Cargo.lock?
Lots of unrelated bumps that may cause regressions.

Would be better to take care of that in another PR

lexnv added 7 commits August 1, 2022 17:27
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

👍

@lexnv
Copy link
Contributor Author

lexnv commented Aug 2, 2022

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 9b01569 into master Aug 2, 2022
@paritytech-processbot paritytech-processbot bot deleted the jsonrpsee_v0.15.1 branch August 2, 2022 17:00
DaviRain-Su pushed a commit to octopus-network/substrate that referenced this pull request Aug 23, 2022
* Bump jsonrpsee to v0.15.1

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update cargo.lock

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc-servers: Adjust RpcMiddleware to WS and HTTP traits

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/author: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/chain: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/state:  Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/finality-grandpa: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/beefy: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client: Extract RPC string result from queries

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Apply rust-fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix warnings

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix testing

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/tests: Remove trailing comma

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Use `SubscriptionResult` for implementations

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Remove comment

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Delegate middleware calls to `RpcMiddleware`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Remove comment

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Revert Cargo.lock

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update Cargo.lock with minimal changes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Update imports for `SubscriptionResult`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Apply cargo fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/tests: Submit raw json requests to validate DenyUnsafe

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Bump jsonrpsee to v0.15.1

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update cargo.lock

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc-servers: Adjust RpcMiddleware to WS and HTTP traits

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/author: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/chain: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/state:  Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/finality-grandpa: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/beefy: Use `SubscriptionSink`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client: Extract RPC string result from queries

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Apply rust-fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix warnings

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix testing

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/tests: Remove trailing comma

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Use `SubscriptionResult` for implementations

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Remove comment

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Delegate middleware calls to `RpcMiddleware`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Remove comment

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Revert Cargo.lock

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update Cargo.lock with minimal changes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc: Update imports for `SubscriptionResult`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Apply cargo fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/tests: Submit raw json requests to validate DenyUnsafe

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants