-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Orderbook Fills protos #1446
Orderbook Fills protos #1446
Conversation
WalkthroughThe recent updates focus on enhancing the Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (3)
Files skipped from review as they are similar to previous changes (1)
Additional Context UsedPath-based Instructions (2)
Additional comments not posted (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (2)
protocol/streaming/grpc/grpc_streaming_manager.go (2)
Line range hint
50-62
: Ensure proper error handling in theSubscribe
method. Currently, it returns a generic error without specific handling or logging. Consider adding detailed error messages and logging for better debuggability.- return clobtypes.ErrInvalidGrpcStreamingRequest + return fmt.Errorf("invalid request: %w", clobtypes.ErrInvalidGrpcStreamingRequest)
Line range hint
150-160
: Consider optimizing theGetUninitializedClobPairIds
method by caching the results or reducing the frequency of lock acquisitions, as this could potentially be a performance bottleneck in high-throughput scenarios.
streamUpdates := clobtypes.StreamUpdate{ | ||
UpdateMessage: &clobtypes.StreamUpdate_OrderbookUpdate{ | ||
OrderbookUpdate: &clobtypes.StreamOrderbookUpdate{ | ||
Updates: updatesToSend, | ||
Snapshot: snapshot, | ||
}, | ||
}, | ||
} | ||
if err := subscription.srv.Send( | ||
&clobtypes.StreamOrderbookUpdatesResponse{ | ||
Updates: updatesToSend, | ||
Snapshot: snapshot, | ||
Updates: []clobtypes.StreamUpdate{streamUpdates}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of sending updates in the SendOrderbookUpdates
method appears correct. However, consider adding more robust error handling and logging to improve system resilience and maintainability.
- panic(err)
+ log.Errorf("Failed to unmarshal offchain updates: %v", err)
+ return err
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
streamUpdates := clobtypes.StreamUpdate{ | |
UpdateMessage: &clobtypes.StreamUpdate_OrderbookUpdate{ | |
OrderbookUpdate: &clobtypes.StreamOrderbookUpdate{ | |
Updates: updatesToSend, | |
Snapshot: snapshot, | |
}, | |
}, | |
} | |
if err := subscription.srv.Send( | |
&clobtypes.StreamOrderbookUpdatesResponse{ | |
Updates: updatesToSend, | |
Snapshot: snapshot, | |
Updates: []clobtypes.StreamUpdate{streamUpdates}, | |
streamUpdates := clobtypes.StreamUpdate{ | |
UpdateMessage: &clobtypes.StreamUpdate_OrderbookUpdate{ | |
OrderbookUpdate: &clobtypes.StreamOrderbookUpdate{ | |
Updates: updatesToSend, | |
Snapshot: snapshot, | |
}, | |
}, | |
} | |
if err := subscription.srv.Send( | |
&clobtypes.StreamOrderbookUpdatesResponse{ | |
Updates: []clobtypes.StreamUpdate{streamUpdates}, | |
log.Errorf("Failed to unmarshal offchain updates: %v", err) | |
return err |
* new protos * fix prev use case * proto lint
@Mergifyio backport release/protocol/v4.1.x |
✅ Backports have been created
|
* new protos * fix prev use case * proto lint (cherry picked from commit 7e87c2e) # Conflicts: # indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts # protocol/x/clob/types/query.pb.go
Co-authored-by: Jonathan Fung <[email protected]> Co-authored-by: Jonathan Fung <[email protected]>
@Mergifyio backport release/protocol/v5.x |
❌ No backport have been created
GitHub error: |
✅ Backports have been created
|
* new protos * fix prev use case * proto lint (cherry picked from commit 7e87c2e) # Conflicts: # indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts # protocol/x/clob/types/query.pb.go
Summary by CodeRabbit
streamOrderbookUpdates
method to clarify the types of updates streamed.StreamOrderbookUpdatesResponse
to use the newStreamUpdate
type for more detailed orderbook updates.