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

Replace subscriptionConfigurationHash with RpcRequest in RpcSubscriptionsPlan #3406

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

lorisleiva
Copy link
Contributor

@lorisleiva lorisleiva commented Oct 21, 2024

This PR replaces the subscriptionConfigurationHash attribute from the RpcSubscriptionsPlan type by a request attribute of type RpcRequest representing the user intent to request to an RPC Subscription.

The main issue with having a subscriptionConfigurationHash attribute defined in the interfaces of RPC Subscriptions is that it is mainly useful to create a coalescer transport decorator and, therefore, is application-specific. By providing the full RpcRequest instead, transports can decide to use this information however they see fit. For instance, a coalescer transport may hash all of the request data whereas a sharding transport may only use the method name of the request. Notice how the @solana/fast-stable-stringify package has now moved from the API package to the package that defines the coalescer transport.

Additionally, this PR replaces the getSubscriptionConfigurationHash function of the RpcSubscriptionsApiConfig type by an RpcRequestTransformer. That way, the createRpcSubscriptionsApi function can prepare the raw request (from the proxy), transform it using the provided request transformer and pass the transformed request into the plan executor.

Copy link

changeset-bot bot commented Oct 21, 2024

🦋 Changeset detected

Latest commit: 4eab8d5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva lorisleiva force-pushed the loris/replace-hash-with-request-in-api-plan branch from c215fcb to 3559496 Compare October 21, 2024 17:30
@lorisleiva lorisleiva changed the base branch from loris/use-rpc-request-in-plan-executor to loris/add-changeset-for-rpc-request-response-changes October 21, 2024 17:30
@lorisleiva lorisleiva marked this pull request as ready for review October 22, 2024 09:07
Copy link
Contributor

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

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

Awesome, this looks way cleaner!

Copy link
Collaborator

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

Added via Giphy

Copy link
Contributor Author

lorisleiva commented Oct 23, 2024

Merge activity

  • Oct 23, 4:43 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 23, 5:09 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 23, 5:10 AM EDT: A user merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from loris/add-changeset-for-rpc-request-response-changes to graphite-base/3406 October 23, 2024 09:01
@lorisleiva lorisleiva changed the base branch from graphite-base/3406 to master October 23, 2024 09:07
@lorisleiva lorisleiva force-pushed the loris/replace-hash-with-request-in-api-plan branch from 3559496 to 4eab8d5 Compare October 23, 2024 09:08
@lorisleiva lorisleiva merged commit 4c7224d into master Oct 23, 2024
6 checks passed
@lorisleiva lorisleiva deleted the loris/replace-hash-with-request-in-api-plan branch October 23, 2024 09:10
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants