Understand the `slotsUpdatesSubscribe` WebSocket RPC
mainThe slotsUpdatesSubscribe (and its counterpart slotsUpdatesUnsubscribe) is a WebSocket RPC method designed to stream tagged slot-lifecycle updates to clients. This method follows the Solana reference specification, providing notifications for specific lifecycle events as the chain advances.
Supported Slot Update Variants
Because Surfpool uses a simulated execution model without a shred/gossip layer, it supports a specific subset of the standard Solana SlotUpdate variants:
CreatedBankFrozenOptimisticConfirmationRoot
Note: FirstShredReceived, Completed, and Dead are not currently produced by Surfpool's execution model.
Wire Format and Payload
The notification payload follows the solana_rpc_client_api::response::SlotUpdate schema. Crucially, the payload is not wrapped in an RpcResponse<...> object; instead, the SlotUpdate object is sent directly under params.result in the JSON-RPC notification.
To ensure compatibility, the implementation uses #[serde(tag = "type", rename_all = "camelCase")] for serialization.