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

Trial support for new RPC API #732

Closed
lexnv opened this issue Nov 24, 2022 · 2 comments
Closed

Trial support for new RPC API #732

lexnv opened this issue Nov 24, 2022 · 2 comments
Assignees

Comments

@lexnv
Copy link
Collaborator

lexnv commented Nov 24, 2022

Create a PoC for integrating the new RPC Spec V2 API into subxt.

The integration will provide further user feedback on the new API, and identify its strengths and weaknesses.

The implementation should leverage the newly exposed APIs from the chainHead.

Provide a user ergonomic API for subscribing to chainHead_unstable_follow notifications.

The follow subscription must be extended with the ability to:

As well as dropping the provided blocks using the chainHead_unstable_unpin method to avoid suspending the follow subscription upon exceeding the number of pinned blocks.

@jsdw
Copy link
Collaborator

jsdw commented Jul 11, 2023

Just to add more detail for how I think we should go about this:

  1. In rpc.rs, remove all references to the "old" RPC methods, and only expose new methods (don't have an "unstable" prtefix in thier names.
  2. The interfaces for these will try to match that of the new RPC API as closely as possible.
  3. The implementations of these will:
    • if an unstable-rpc-v2 feature flag is enabled, directly call the new RPC methods
    • if not, we will "shim" them by calling the old methods instead and converting the results into the format expected for the new APIs.
    • Things like "pinning" can be exposed but will simply be a no-op when unstable-rpc-v2 is disabled
    • We may run into the odd thing that the new API makes possible which is not possible via the old API. For now, we will hide such things and only expose behaviours we can shim using the old APIs.
  4. Tests can run with and without this unstable-rpc-v2 feature flag enabled to ensure that the shims and not-shims both produce the expected results, and help catch cases where the new APIs are changed or something.
  5. When the new APIs are eventually stabilised (with feedback from ourselves as a result of this to help), we can remove the feature flag and remove the shims, leaving only the "new" implementations, and hopefully leading to no real semver breakages in Subxt.
  6. Eventually we can add in any behaviours we had to omit to benefit from the full power of the new APIs (eg the newer storage bits).

@jsdw
Copy link
Collaborator

jsdw commented Oct 19, 2023

Closed in #1161

@jsdw jsdw closed this as completed Oct 19, 2023
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

No branches or pull requests

2 participants