-
Notifications
You must be signed in to change notification settings - Fork 913
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
Replace subscriptionConfigurationHash with RpcRequest in RpcSubscriptionsPlan #3406
Conversation
🦋 Changeset detectedLatest 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 |
c215fcb
to
3559496
Compare
There was a problem hiding this 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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3559496
to
4eab8d5
Compare
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. |
This PR replaces the
subscriptionConfigurationHash
attribute from theRpcSubscriptionsPlan
type by arequest
attribute of typeRpcRequest
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 fullRpcRequest
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 theRpcSubscriptionsApiConfig
type by anRpcRequestTransformer
. That way, thecreateRpcSubscriptionsApi
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.