Expand description
Actor-based subscription manager for WebSocket eth_subscribe connections.
The SubscriptionManager is a GenServer actor that owns all subscription
state. It receives NewHead messages from block producers / fork choice
handlers and fans out notifications to all connected WebSocket clients
through per-connection mpsc channels.
Using an actor removes the need for a broadcast channel and eliminates
the “lagged subscriber” problem: when a connection drops, its sender is
removed during the next new_head fan-out rather than silently accumulating
unread messages.
Modules§
Structs§
- Subscription
Manager - Actor that manages all active WebSocket subscriptions.
Constants§
- MAX_
SUBSCRIPTIONS_ PER_ CONNECTION - Maximum number of active subscriptions allowed per WebSocket connection.
- MAX_
TOTAL_ SUBSCRIPTIONS - Maximum number of active subscriptions across all connections.
- SUBSCRIBER_
CHANNEL_ CAPACITY - Maximum number of buffered notifications per subscriber. If a subscriber’s channel is full (slow WebSocket client), the notification is dropped rather than blocking the actor. Matches Geth’s approach of dropping slow clients (Geth uses 20,000; we use a smaller buffer since each notification is already serialized JSON).
Traits§
- Subscription
Manager Protocol - Messages understood by the
SubscriptionManager. - ToSubscription
Manager Ref
Type Aliases§
- Subscription
Manager Ref - Type-erased reference to any actor implementing
SubscriptionManagerProtocol.