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

feat: rpc::Client #4140

Merged
merged 20 commits into from
Apr 8, 2024
Merged

feat: rpc::Client #4140

merged 20 commits into from
Apr 8, 2024

Conversation

aatifsyed
Copy link
Contributor

@aatifsyed aatifsyed commented Apr 4, 2024

Summary of changes

  • rpc::Client uses and wraps jsonrpsee's clients instead of rolling our own, acts as a client for all RPC calls
    • ApiInfo::call used global_http_client for http requests, and used jsonrpsee::ws_client for websocket requests.
      This was a contributor to ApiInfo::call is bugged #4076.
    • rpc::Client::from(_: ApiInfo), so that RPC calls can be migrated in the interim.
      In [tracking] RPC refactoring wishlist #4032, all instances of ApiInfo should be replaced by rpc::Client.
    • rpc::Client operates on Urls, since that's what jsonrpsee's clients expect.
      • multiaddr2url has been changed to behave like multiaddr::from_url
      • running websocket_tests is now opportunistic if lotus and forest schemes are websockets.
  • Add RpcMethod::API_VERSION so that requests know which URL they are destined for.
  • Add RpcMethodExt::call so that implementors of RpcMethod can actually make API calls
  • Delete mpool_ops

Other information and links

#4032

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@aatifsyed aatifsyed changed the base branch from main to aatifsyed/mpool-uses-rpcmethod April 4, 2024 03:43
Base automatically changed from aatifsyed/mpool-uses-rpcmethod to main April 4, 2024 14:32
@aatifsyed aatifsyed marked this pull request as ready for review April 4, 2024 19:32
@aatifsyed aatifsyed requested a review from a team as a code owner April 4, 2024 19:32
@aatifsyed aatifsyed requested review from LesnyRumcajs and sudo-shashank and removed request for a team April 4, 2024 19:32
@aatifsyed aatifsyed force-pushed the aatifsyed/rpc-client branch from 4df7bbc to 081dcc8 Compare April 4, 2024 20:05
@aatifsyed aatifsyed enabled auto-merge April 5, 2024 09:01
src/rpc/client.rs Outdated Show resolved Hide resolved
src/rpc/client.rs Show resolved Hide resolved
src/rpc/client.rs Show resolved Hide resolved
@aatifsyed aatifsyed force-pushed the aatifsyed/rpc-client branch from badebee to ff2a81a Compare April 8, 2024 10:13
@aatifsyed aatifsyed force-pushed the aatifsyed/rpc-client branch from ff2a81a to 901ff3d Compare April 8, 2024 10:14
@aatifsyed
Copy link
Contributor Author

This reversed some of the good work done in #4148 because jsonrpsee still uses backlevel hyper and http versions.
paritytech/jsonrpsee#1257

@aatifsyed aatifsyed added this pull request to the merge queue Apr 8, 2024
Merged via the queue into main with commit 8fd41b1 Apr 8, 2024
27 checks passed
@aatifsyed aatifsyed deleted the aatifsyed/rpc-client branch April 8, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants