-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Create endpoint manager for websockets #251
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
base: plat-6492-add-network-and-models
Are you sure you want to change the base?
feat: Create endpoint manager for websockets #251
Conversation
_retry_policy: ExponentialBackoff, | ||
_retry_strategy: Option<TransientErrorRetryStrategy>, | ||
) -> Result<(), anyhow::Error> { | ||
Err(anyhow::anyhow!( |
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.
Do we need this to maintain consistency with other transport implementations?
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.
That's right, it implements BlockchainTransport where we only need get_current_url and send_raw_request.
We don't need retry policy logic and update_endpoint_manager because our websocket implementwtion doesn't have a middleware client, as opposed to http implementation, which has the reqwest middleware client. Mainly because of how connections are handled in http vs websockets.
As you can see, we don't actually have a client associated in the endpoint manager for ws to update. It simply manages rotation based on weights. Whereas for http it's a bit more complex, where we can configure different retry strategies based on error codes etc.. I hope that makes sense.
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.
Makes sense! thanks for the explanation Nami!
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.
LGTM!
Summary
https://linear.app/openzeppelin-development/issue/PLAT-6659/refactor-rpc-calls-to-use-substrate-client-with-websocket
TODO (in follow up PRs):
midnight_jsonBlock
andmidnight_decodeEvents
RPC calls with substrate client callsTesting Process
Checklist