Skip to content
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

FNS protos - add taker order in stream update oneof #2021

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

jonfung-dydx
Copy link
Contributor

@jonfung-dydx jonfung-dydx commented Aug 5, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new takerOrderStatus property to provide enhanced insights into taker order status within real-time order updates.
    • Expanded the StreamUpdate message to include StreamTakerOrderStatus, improving the message structure for orderbook updates.
    • Added a takerOrder property to the StreamUpdate message, allowing detailed information about taker orders.
  • Bug Fixes

    • Updated field numbers for block_height and exec_mode to maintain consistency with new features, ensuring accurate message interpretation.

@jonfung-dydx jonfung-dydx requested a review from dydxwill August 5, 2024 06:22
Copy link
Contributor

coderabbitai bot commented Aug 5, 2024

Walkthrough

The recent changes enhance the StreamUpdate structure in the dYdX protocol by introducing new properties, takerOrderStatus and takerOrder. These additions improve the encoding and decoding processes, allowing for more comprehensive updates on taker order statuses and details. Adjustments to field numbering in the protocol ensure consistency while accommodating the expanded message capabilities, ultimately enhancing real-time order information relay.

Changes

Files Change Summary
indexer/packages/v4-protos/src/codegen/... Added takerOrderStatus and takerOrder to StreamUpdate and StreamUpdateSDKType; updated initialization, encoding, and decoding logic.
proto/dydxprotocol/clob/query.proto Expanded StreamUpdate with StreamTakerOrderStatus and StreamTakerOrder; renumbered block_height and exec_mode.

Poem

🐇 In the realm of code where orders dance,
New statuses bloom, a chance for a chance.
Taker orders sing, their voices now clear,
Updates flow swiftly, no need for fear.
With hops and with skips, let progress be known,
In the garden of code, we’ve beautifully grown! 🌱


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
proto/dydxprotocol/clob/query.proto (1)

181-185: Add documentation for StreamTakerOrderStatus.

The new StreamTakerOrderStatus field has been added to the oneof block. Ensure that this field is well-documented to provide clarity on its usage and significance.

indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (2)

290-290: Add documentation for takerOrderStatus.

The new takerOrderStatus field has been added to the StreamUpdate interface. Ensure that this field is well-documented to provide clarity on its usage and significance.


306-306: Add documentation for taker_order_status.

The new taker_order_status field has been added to the StreamUpdateSDKType interface. Ensure that this field is well-documented to provide clarity on its usage and significance.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9608e19 and 9dd97a5.

Files ignored due to path filters (1)
  • protocol/x/clob/types/query.pb.go is excluded by !**/*.pb.go
Files selected for processing (2)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (6 hunks)
  • proto/dydxprotocol/clob/query.proto (1 hunks)
Additional comments not posted (4)
proto/dydxprotocol/clob/query.proto (1)

189-192: Verify field renumbering consistency.

The block_height field has been renumbered from 3 to 4, and the exec_mode field from 4 to 5. Ensure that these changes are reflected consistently across all related code and documentation.

Verification successful

Field renumbering consistency verified.

The renumbering of the block_height field from 3 to 4 and the exec_mode field from 4 to 5 is consistent across the related code and documentation.

  • block_height appears with different numbers in various contexts, which is expected.
  • exec_mode is correctly numbered as 5 in the relevant file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of field renumbering for `block_height` and `exec_mode`.

# Test: Search for field usage. Expect: Consistent field numbers across all related code and documentation.
rg --type proto -A 3 $'block_height'
rg --type proto -A 3 $'exec_mode'

Length of output: 128


Script:

#!/bin/bash
# Description: Verify consistency of field renumbering for `block_height` and `exec_mode`.

# Test: Search for field usage in .proto files. Expect: Consistent field numbers across all related code and documentation.
rg 'block_height' --glob '*.proto' -A 3
rg 'exec_mode' --glob '*.proto' -A 3

Length of output: 3571

indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (3)

1289-1289: LGTM!

The takerOrderStatus field is correctly initialized to undefined in the createBaseStreamUpdate function.


1305-1307: LGTM!

The takerOrderStatus field is correctly included in the encoding logic of the StreamUpdate function.


1338-1343: LGTM!

The takerOrderStatus field is correctly included in the decoding logic of the StreamUpdate function.

}

// Block height of the update.
uint32 block_height = 3;
uint32 block_height = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make sure - is this schema backwards compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is emitted in fns only, no need for it to be backwards compatible?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9dd97a5 and 24b8167.

Files ignored due to path filters (1)
  • protocol/x/clob/types/query.pb.go is excluded by !**/*.pb.go
Files selected for processing (2)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (6 hunks)
  • proto/dydxprotocol/clob/query.proto (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts
  • proto/dydxprotocol/clob/query.proto

@jonfung-dydx jonfung-dydx merged commit 403fc9b into main Aug 5, 2024
31 of 33 checks passed
@jonfung-dydx jonfung-dydx deleted the jonfung/streamingProtos branch August 5, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants