Conversation
leafaar
reviewed
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current issues
Leaky uncustomizable Generic Interceptor type : our client type GeyserGrpcClient expect an "interceptor" to inject
x-token. This generic type is leaked all over our API, though users (customers) cannot customize this type at all, so it pollutes everyone else code because of this and integrate poorly with NAPI sdk which does not handle generic type verywell and forces us to do unsafe downcasting casting.Leaky abstraction around subscribe
impl Sinkwhose error types is fixed tofutures::channel::error::SendError. In other words, because of the error type, we are leaking this underlying channel implementation. It is not abstract at all.Moreover, we use anonymous types which has more constraint at compile time than having the concrete type in the first place.
As we are building auto reconnect feature in STR-404: Yellowstone-grpc-client stream auto-reconnect #717 , it's easier to implement generic connector logic if the
Streamreturned bysubscribeis not an anonymous type.After the PR
GeyserGrpcClientimpl Sink<SubscribeRequest, Error = mpsc::SendError> + use<F>withSubscribeRequestSinktype.impl Stream<Item = Result<SubscribeUpdate, Status>> + use<F>withGeyserStreamtype.SubscribeRequestSinknow returnsSubscribeRequestSinkErrorinstead ofmpsc::SendError.client.rsin our example folder.GeyserGrpcClientError::SubscribeSendErrorvariant as no code branch could raise this error.TL;DR: instead of returning leaky anonymous types like
impl Sinkandimpl Streamwe will return concrete types which will hide the underlying sink or stream. This will give us the flexibility to change the implementation when we want without breaking API in the future while providing a cleaner API with concrete types.