-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
effort: S 2-3 dayspriority: highShould be addressed soonShould be addressed soontype: featureNew functionalityNew functionality
Description
Problem
Currently, RobustProvider::unsubscribe(id) does not properly cancel a RobustSubscription.
Root Cause
Alloy's PubSubFrontend::unsubscribe (source) only sends a PubSubInstruction::Unsubscribe to the backend, which removes the subscription from local tracking. It does not make an eth_unsubscribe RPC call.
When RobustProvider::unsubscribe(sub_id) is called:
- It calls
provider.unsubscribe(id)on the underlyingRootProvider - This removes the subscription from the pubsub frontend's internal tracking
- However, the
RobustSubscriptionstill holds its ownSubscription<N::HeaderResponse>object - The stream continues to receive blocks because the underlying websocket subscription is still active
Expected Behavior
After calling unsubscribe, the stream should return None (closed).
Proposed Solution
RobustSubscription needs its own unsubscribe method that:
- Cancels the internal subscription
- Signals the stream to close
Options:
- Add an
unsubscribe()method directly onRobustSubscription - Use a cancellation token/channel that
RobustProvider::unsubscribecan signal - Track active subscriptions in
RobustProviderand notify them on unsubscribe
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort: S 2-3 dayspriority: highShould be addressed soonShould be addressed soontype: featureNew functionalityNew functionality