feat: add IndexerSnapshot WebSocket support for RCManager#287
Closed
feat: add IndexerSnapshot WebSocket support for RCManager#287
Conversation
999b2b1 to
a6dad68
Compare
- Add controller reference to RCManager for state access - Add buildIndexerSnapshot method to create state snapshots - Define IndexerSnapshot and DexPrice proto messages for efficient binary serialization over WebSocket 🏷️ feat: add IndexerSnapshot proto message and extract swap methods - Define IndexerSnapshot message in block.proto for WebSocket streaming - Extract SellOrder.IsLocked, SellOrder.Copy, OrderBook.Copy to swap_ext.go to prevent loss during proto regeneration
a6dad68 to
09aa073
Compare
Replace silent error suppression with warning logs for all data fetching and marshaling operations in buildIndexerSnapshot. This improves debuggability while maintaining the non-fatal behavior where errors result in nil values rather than function failure.
Add /v1/subscribe-block-data WebSocket endpoint that streams IndexerSnapshot data to connected clients on each block commit. - Add BlockDataSubscriber struct and lifecycle management - Add PublishBlockData method to RCManagerI interface - Hook PublishBlockData into CommitCertificate flows - Send initial snapshot when clients connect
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.
Summary
buildIndexerSnapshotmethod to RCManager for building comprehensive state snapshotsIndexerSnapshotprotobuf message in block.proto for wire format/v1/subscribe-block-dataWebSocket endpoint for streaming block dataPublishBlockDatainto block commit flow to broadcast snapshots automaticallySellOrder.IsLocked(),SellOrder.Copy(), andOrderBook.Copy()helper methodsbuildIndexerSnapshotNew WebSocket Endpoint
GET /v1/subscribe-block-data- StreamsIndexerSnapshotdata to connected clientsData Included in IndexerSnapshot