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

[CT-645] Move off chain updates and v1 to a different package #1131

Merged
merged 3 commits into from
Mar 2, 2024
Merged

Conversation

jayy04
Copy link
Contributor

@jayy04 jayy04 commented Mar 1, 2024

Changelist

  • move off_chain_updates and v1 to a separate package to avoid circular import

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Copy link

linear bot commented Mar 1, 2024

Copy link

coderabbitai bot commented Mar 1, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Commits Files that changed from the base of the PR and between 1df8a76 and da98350.
Files ignored due to path filters (3)
  • protocol/indexer/events/events.pb.go is excluded by: !**/*.pb.go
  • protocol/indexer/off_chain_updates/types/off_chain_updates.pb.go is excluded by: !**/*.pb.go
  • protocol/indexer/shared/types/removal_reason.pb.go is excluded by: !**/*.pb.go
Files selected for processing (18)
  • proto/dydxprotocol/indexer/shared/removal_reason.proto (1 hunks)
  • protocol/indexer/events/stateful_order.go (2 hunks)
  • protocol/indexer/events/stateful_order_test.go (2 hunks)
  • protocol/indexer/off_chain_updates/off_chain_updates.go (9 hunks)
  • protocol/indexer/off_chain_updates/off_chain_updates_test.go (6 hunks)
  • protocol/indexer/shared/order_removal_reason.go (3 hunks)
  • protocol/indexer/shared/order_removal_reason_test.go (2 hunks)
  • protocol/testing/e2e/gov/wind_down_market_test.go (1 hunks)
  • protocol/testutil/memclob/offchain_updates.go (2 hunks)
  • protocol/x/clob/abci.go (1 hunks)
  • protocol/x/clob/abci_test.go (1 hunks)
  • protocol/x/clob/keeper/clob_pair_test.go (1 hunks)
  • protocol/x/clob/keeper/final_settlement.go (1 hunks)
  • protocol/x/clob/keeper/msg_server_cancel_orders.go (1 hunks)
  • protocol/x/clob/keeper/msg_server_cancel_orders_test.go (1 hunks)
  • protocol/x/clob/keeper/orders.go (2 hunks)
  • protocol/x/clob/memclob/memclob.go (12 hunks)
  • protocol/x/clob/memclob/memclob_test_util.go (8 hunks)

Walkthrough

The overarching change involves a significant update to the package structure within the dYdX Protocol codebase, specifically targeting Go package references for better organization and clarity. This restructure mainly affects the off_chain_updates and protocol/v1 components, with updates extending to test files and utility functions. The modifications include updating package paths to include a /types suffix for clearer type distinction and adjusting references across various files to align with these new paths.

Changes

File(s) Change Summary
proto/dydxprotocol/.../off_chain_updates.proto
proto/dydxprotocol/.../clob.proto
proto/dydxprotocol/.../subaccount.proto
Updated go_package option to append /types for clearer type distinction.
protocol/indexer/events/perpetual_market_create_test.go
protocol/indexer/.../v1_mappers_test.go
Renamed imported package to v1types for consistency with new package structure.
protocol/indexer/off_chain_updates/off_chain_updates.go
protocol/indexer/off_chain_updates/off_chain_updates_test.go
protocol/testutil/memclob/offchain_updates.go
protocol/x/clob/keeper/orders.go
protocol/x/clob/memclob/memclob.go
protocol/x/clob/memclob/memclob_test_util.go
Replaced references and imports to use ocutypes from the newly structured /types directory, affecting functions and tests related to off-chain updates.
protocol/indexer/protocol/v1/v1_mappers.go Updated declarations to use v1types package prefix, aligning with new package structure.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9850cb4 and 1df8a76.
Files ignored due to path filters (4)
  • protocol/indexer/events/events.pb.go is excluded by: !**/*.pb.go
  • protocol/indexer/off_chain_updates/types/off_chain_updates.pb.go is excluded by: !**/*.pb.go
  • protocol/indexer/protocol/v1/types/clob.pb.go is excluded by: !**/*.pb.go
  • protocol/indexer/protocol/v1/types/subaccount.pb.go is excluded by: !**/*.pb.go
Files selected for processing (12)
  • proto/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto (1 hunks)
  • proto/dydxprotocol/indexer/protocol/v1/clob.proto (1 hunks)
  • proto/dydxprotocol/indexer/protocol/v1/subaccount.proto (1 hunks)
  • protocol/indexer/events/perpetual_market_create_test.go (2 hunks)
  • protocol/indexer/off_chain_updates/off_chain_updates.go (9 hunks)
  • protocol/indexer/off_chain_updates/off_chain_updates_test.go (5 hunks)
  • protocol/indexer/protocol/v1/v1_mappers.go (10 hunks)
  • protocol/indexer/protocol/v1/v1_mappers_test.go (19 hunks)
  • protocol/testutil/memclob/offchain_updates.go (2 hunks)
  • protocol/x/clob/keeper/orders.go (2 hunks)
  • protocol/x/clob/memclob/memclob.go (12 hunks)
  • protocol/x/clob/memclob/memclob_test_util.go (8 hunks)
Additional comments: 62
protocol/indexer/events/perpetual_market_create_test.go (2)
  • 6-6: The change in import alias from v1 to v1types aligns with the PR's objective of reorganizing packages to avoid circular imports. This is a good practice for maintaining clarity and modularity in the codebase.
  • 30-30: Using the v1types alias to reference ClobPairStatus_CLOB_PAIR_STATUS_ACTIVE is correct and aligns with the updated import. Ensure that this naming convention is consistently applied across the entire codebase for clarity and maintainability.
Verification successful

The verification process, based on the provided script outputs, supports the consistent use of the v1types alias in the examined instances within the codebase. The examples show correct usage, and the import path for v1types is clearly identified, with no evidence of other aliases for this path in the provided context. This suggests that the naming convention is indeed being applied consistently in the areas checked.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify consistent usage of the `v1types` alias across the codebase.
rg --type go 'v1types\.' | wc -l

Length of output: 37



Script:

#!/bin/bash
# Extract a few lines around a subset of `v1types` occurrences to assess usage.
rg --type go -C 3 'v1types\.' | head -n 30

Length of output: 2372


Script:

#!/bin/bash
# Identify the import path associated with `v1types` and search for other aliases for the same path.
rg --type go '^import' -A 10 | grep 'v1types' -B 10 -A 1

Length of output: 2595

protocol/testutil/memclob/offchain_updates.go (2)
  • 9-9: The addition of the ocutypes import aligns with the PR's objective of reorganizing packages. This change enhances modularity by clearly separating types into their respective packages.
  • 32-32: The usage of the ocutypes alias to reference OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED is correct. Ensure that this constant exists in the newly organized package and that the ocutypes alias is used consistently across the codebase.
Verification successful

The verification process has confirmed the existence of the constant OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the newly organized package, with 20 occurrences found. Additionally, the ocutypes alias is used 53 times across the codebase in Go files, indicating a consistent usage pattern. While this does not definitively prove that every instance of constants from the package uses the ocutypes alias, the evidence suggests a significant and consistent usage. Therefore, the review comment is considered verified based on the provided evidence.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the existence of the referenced constant in the new package.
rg --type go 'OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED' | wc -l
# Verify consistent usage of the `ocutypes` alias across the codebase.
rg --type go 'ocutypes\.' | wc -l

Length of output: 120

proto/dydxprotocol/indexer/protocol/v1/subaccount.proto (1)
  • 7-7: Updating the go_package option to include /types is consistent with the PR's objective of reorganizing packages to avoid circular imports. Ensure that this change is consistently applied across all relevant proto files.
proto/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto (1)
  • 7-7: The update to the go_package option in off_chain_updates.proto to include /types aligns with the PR's objectives. Ensure this change is consistently applied across all proto files for clarity and modularity.
protocol/indexer/protocol/v1/v1_mappers.go (2)
  • 7-7: The update to use the v1types package prefix for type references in v1_mappers.go is consistent with the PR's objectives of reorganizing packages. This enhances clarity and modularity in the codebase.
  • 94-128: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [14-181]

Throughout v1_mappers.go, the usage of the v1types prefix to reference various types is correct. Ensure that these types exist in the v1types package and that the v1types prefix is used consistently across the codebase.

proto/dydxprotocol/indexer/protocol/v1/clob.proto (1)
  • 7-7: Updating the go_package option in clob.proto to include /types is consistent with the PR's objectives. Ensure this change is consistently applied across all proto files for clarity and modularity.
protocol/indexer/off_chain_updates/off_chain_updates_test.go (9)
  • 10-10: The import of ocutypes is correctly added to accommodate the new package structure and types for off-chain updates. This change aligns with the PR objectives of reorganizing packages to avoid circular imports and enhancing the orderbook streaming service.
  • 28-30: The declaration of status and defaultRemovalReason using ocutypes ensures consistency with the new package structure. This change is crucial for maintaining type safety and clarity in the context of order removal operations.
  • 31-34: The initialization of offchainUpdateOrderPlace with ocutypes.OrderPlaceV1 struct is correctly implemented. This change is part of the enhancements to the orderbook streaming service, ensuring that order place operations use the updated types.
  • 39-40: The initialization of offchainUpdateOrderUpdate with ocutypes.OrderUpdateV1 struct is correctly implemented. This update is essential for the correct handling of order update operations within the new streaming service framework.
  • 47-48: The initialization of offchainUpdateOrderRemove with ocutypes.OrderRemoveV1 struct is correctly implemented. This change ensures that order removal operations are handled using the updated types, aligning with the PR's objectives to enhance the orderbook streaming service.
  • 56-57: The initialization of offchainUpdateOrderRemoveWithDefaultRemovalReason with ocutypes.OrderRemoveV1 struct is correctly implemented. This variant of the order remove operation allows for specifying a default removal reason, enhancing flexibility in order removal scenarios.
  • 216-216: The declaration and initialization of actualUpdate using ocutypes.OffChainUpdateV1 in TestNewOrderPlaceMessage is correctly implemented. This ensures that the test accurately reflects the changes made to the order place message structure.
  • 238-238: The declaration and initialization of actualUpdate using ocutypes.OffChainUpdateV1 in TestNewOrderUpdateMessage is correctly implemented. This change is crucial for testing the updated order update message structure within the new streaming service framework.
  • 260-260: The declaration and initialization of actualUpdate using ocutypes.OffChainUpdateV1 in TestNewOrderRemoveMessage is correctly implemented. This ensures that the test accurately reflects the changes made to the order remove message structure, aligning with the PR's objectives.
protocol/indexer/off_chain_updates/off_chain_updates.go (9)
  • 12-12: The import of ocutypes is correctly added to accommodate the new package structure and types for off-chain updates. This change is essential for the reorganization of packages and the enhancement of the orderbook streaming service.
  • 118-118: The update of the removalStatus parameter type to ocutypes.OrderRemoveV1_OrderRemovalStatus in MustCreateOrderRemoveMessageWithReason is correctly implemented. This change ensures type consistency and clarity in the context of order removal operations.
  • 133-133: The update of the removalStatus parameter type to ocutypes.OrderRemoveV1_OrderRemovalStatus in CreateOrderRemoveMessageWithReason is correctly implemented. This change is crucial for maintaining type safety and clarity in the context of order removal operations.
  • 172-172: The update of the removalStatus parameter type to ocutypes.OrderRemoveV1_OrderRemovalStatus in MustCreateOrderRemoveMessage is correctly implemented. This ensures that the function signature aligns with the updated types, enhancing the clarity and maintainability of the code.
  • 188-188: The update of the removalStatus parameter type to ocutypes.OrderRemoveV1_OrderRemovalStatus in CreateOrderRemoveMessage is correctly implemented. This change is essential for the correct handling of order removal operations within the new streaming service framework.
  • 215-215: The update of the removalStatus parameter type to ocutypes.OrderRemoveV1_OrderRemovalStatus in CreateOrderRemoveMessageWithDefaultReason is correctly implemented. This variant of the order remove operation allows for specifying a default removal reason, enhancing flexibility in order removal scenarios.
  • 248-253: The initialization of update with ocutypes.OffChainUpdateV1 and ocutypes.OrderPlaceV1 in newOrderPlaceMessage is correctly implemented. This change is part of the enhancements to the orderbook streaming service, ensuring that order place operations use the updated types.
  • 266-271: The initialization of update with ocutypes.OffChainUpdateV1 and ocutypes.OrderRemoveV1 in newOrderRemoveMessage is correctly implemented. This ensures that order removal operations are handled using the updated types, aligning with the PR's objectives to enhance the orderbook streaming service.
  • 289-291: The initialization of update with ocutypes.OffChainUpdateV1 and ocutypes.OrderUpdateV1 in newOrderUpdateMessage is correctly implemented. This update is essential for the correct handling of order update operations within the new streaming service framework.
protocol/indexer/protocol/v1/v1_mappers_test.go (12)
  • 9-9: The import alias v1types is correctly introduced to reflect the new package structure. This change aligns with the PR objectives of reorganizing packages to avoid circular imports and is consistent with Go best practices for handling package imports and aliases.
  • 18-18: The renaming of types from v1 to v1types within the TestSubaccountIdToIndexerSubaccountId function is correctly implemented. This change is necessary to reflect the updated package structure and ensures that the test function uses the correct types from the newly organized packages.
  • 35-35: The changes within TestPerpetualPositionToIndexerPerpetualPosition to use v1types instead of v1 for type references are correctly applied. This adjustment is part of the broader effort to reorganize the package structure and avoid circular imports, ensuring that the test function aligns with the new structure.
  • 62-62: The renaming of types within TestPerpetualPositionsToIndexerPerpetualPositions to use v1types is correctly done. This change is consistent with the PR's objective of reorganizing the package structure to improve modularity and maintainability of the codebase.
  • 133-133: The changes in TestAssetPositionToIndexerAssetPosition to use v1types for type references are correctly implemented. This renaming is part of the package reorganization effort and ensures that the test function is aligned with the updated package structure.
  • 155-155: The renaming of types within TestAssetPositionsToIndexerAssetPositions to use v1types is correctly applied. This change supports the PR's goal of reorganizing the package structure to enhance the codebase's modularity and scalability.
  • 197-197: The changes in TestOrderIdToIndexerOrderId to use v1types for type references are correctly implemented. This adjustment is necessary for aligning the test function with the new package structure, reflecting the PR's objectives of improving the codebase's organization.
  • 220-220: The renaming of types within TestOrderSideToIndexerOrderSide to use v1types is correctly done. This change is part of the broader effort to reorganize the package structure and is consistent with the PR's objectives of enhancing the codebase's modularity.
  • 250-250: The changes in TestOrderTimeInForceToIndexerOrderTimeInForce to use v1types for type references are correctly implemented. This renaming aligns with the updated package structure and supports the PR's goal of reorganizing packages to improve the codebase's organization.
  • 280-280: The renaming of types within TestOrderConditionTypeToIndexerOrderConditionType to use v1types is correctly applied. This change is consistent with the PR's objective of reorganizing the package structure to avoid circular imports and enhance the codebase's modularity.
  • 313-313: The changes in TestOrderToIndexerOrderV1 to use v1types for type references are correctly implemented. This adjustment is part of the package reorganization effort and ensures that the test function aligns with the updated package structure, reflecting the PR's objectives.
  • 389-389: The changes in TestConvertToClobPairStatus to use v1types for type references are correctly implemented. This renaming is necessary for aligning the test function with the new package structure and supports the PR's goal of reorganizing packages to improve the codebase's organization and avoid circular imports.
protocol/x/clob/keeper/orders.go (3)
  • 16-16: The addition of the ocutypes import aligns with the PR's objective to reorganize packages to avoid circular imports and to support the new streaming service for orderbook updates. This change seems correctly implemented and necessary for the updated reference that follows.
  • 487-487: Updating the reference from off_chain_updates.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED to ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED is consistent with the PR's goal of reorganizing package structures to improve modularity and avoid circular imports. This change correctly reflects the new package path after moving off_chain_updates and v1 to a separate package. Ensure that all other references throughout the codebase are also updated to maintain consistency.
  • 13-19: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-487]

Given the complexity and critical nature of the operations handled in this file, it's essential to ensure comprehensive test coverage, especially for the newly added or modified functionality. The PR description mentions testing and validation but lacks specific details. It would be beneficial to verify that unit tests and integration tests adequately cover the changes and consider edge cases to ensure the robustness and reliability of the order management system.

protocol/x/clob/memclob/memclob_test_util.go (8)
  • 13-13: The import alias ocutypes for github.com/dydxprotocol/v4-chain/protocol/indexer/off_chain_updates/types is correctly added to accommodate the reorganization of packages. This change aligns with the PR objectives to avoid circular imports and enhance modularity.
  • 1330-1330: The replacement of off_chain_updates.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED with ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED correctly reflects the new package structure and aliasing. This change ensures consistency in referencing the constant across the file.
  • 1359-1359: The usage of ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the context of generating an OrderRemove message with a specific reason is correctly updated to use the new package alias. This maintains the logical flow and correctness of the code.
  • 1388-1388: Again, the update to use ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED for generating an OrderRemove message due to undercollateralization is correctly applied. This change is consistent with the reorganization objectives and ensures the code remains functional.
  • 1446-1446: The consistent use of ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED for generating an OrderRemove message due to a self-trade error further demonstrates the correct application of the package reorganization. This ensures that the codebase remains coherent and modular.
  • 1545-1545: The application of ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the context of generating an OrderRemove message for orders crossing with a liquidation order is correctly implemented. This usage aligns with the package reorganization and maintains the integrity of the code.
  • 1560-1560: The use of ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED for generating an OrderRemove message when an order fails collateralization checks during matching is correctly updated. This change is in line with the reorganization objectives and ensures the code's correctness.
  • 1479-1479: Lastly, the update to use ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED for generating an OrderRemove message when an order placement does not result in an error but has a non-success status is correctly applied. This maintains the logical consistency and functionality of the code.
protocol/x/clob/memclob/memclob.go (12)
  • 17-17: The import of ocutypes from off_chain_updates/types is correctly updated to reflect the new package structure, which is part of the reorganization to avoid circular imports.
  • 132-132: The update of the reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED from off_chain_updates to ocutypes in the CancelOrder function is correctly done, aligning with the package reorganization objectives.
  • 468-468: The reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the PlaceOrder function is correctly updated to use ocutypes, which is consistent with the package reorganization and import changes.
  • 519-519: The usage of OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED from ocutypes in the error handling part of the PlaceOrder function is appropriate and follows the new package structure.
  • 541-541: The reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the PlaceOrder function for handling the case where the order has no remaining size after matching is correctly updated to use ocutypes.
  • 588-588: The update of the reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the PlaceOrder function for handling Immediate-or-Cancel orders is correctly done, aligning with the package reorganization.
  • 623-623: The usage of OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the PlaceOrder function for handling the add order to orderbook collateralization check failure is correctly updated to use ocutypes.
  • 795-795: The reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the mustPerformTakerOrderMatching function for handling maker orders that failed collateralization checks is correctly updated to use ocutypes.
  • 1120-1120: The usage of OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the GenerateOffchainUpdatesForReplayPlaceOrder helper function is correctly updated to use ocutypes, which is consistent with the package reorganization.
  • 1271-1271: The reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_CANCELED in the PurgeInvalidMemclobState function for handling expired stateful orders is correctly updated to use ocutypes. It's worth noting that this status differs from the others as it uses ORDER_REMOVAL_STATUS_CANCELED instead of BEST_EFFORT_CANCELED, which is appropriate for expired orders.
  • 1290-1290: The usage of OrderRemoveV1_ORDER_REMOVAL_STATUS_CANCELED in the PurgeInvalidMemclobState function for handling expired Short-Term orders is correctly updated to use ocutypes. This is consistent with the handling of expired stateful orders and aligns with the package reorganization.
  • 2104-2104: The reference to OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED in the maybeCancelReduceOnlyOrders function for handling the cancellation of reduce-only orders when the position side changes is correctly updated to use ocutypes.

@jayy04 jayy04 changed the title [CT-645] Add protos for orderbook stream query service [CT-645] Move off chain updates and v1 to a different package Mar 1, 2024
* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build
@jayy04 jayy04 merged commit 7c6b3d9 into main Mar 2, 2024
32 of 33 checks passed
@jayy04 jayy04 deleted the jy/ct-645 branch March 2, 2024 03:34
jayy04 added a commit that referenced this pull request Mar 15, 2024
* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build
jayy04 added a commit that referenced this pull request Mar 15, 2024
* [CT-645] Move off chain updates and v1 to a different package (#1131)

* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build

* [CT-644] instantiate grpc stream manager (#1134)

* [CT-644] instantiate grpc stream manager

* update type

* update channel type

* [CT-646] stream offchain updates through stream manager (#1138)

* [CT-646] stream offchain updates through stream manager

* comments

* fix lint

* get rid of finished

* comments

* comments

* [CT-652] add command line flag for full node streaming (#1145)

* [CT-647] construct the initial orderbook snapshot (#1147)

* [CT-647] construct the initial orderbook snapshot

* [CT-647] initialize new streams and send orderbook snapshot (#1152)

* [CT-647] initialize new streams and send orderbook snapshot

* use sync once

* comments

* fix test
jayy04 added a commit that referenced this pull request Mar 28, 2024
* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build
jayy04 added a commit that referenced this pull request Mar 28, 2024
* [CT-645] Move off chain updates and v1 to a different package (#1131)

* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build

* [CT-644] instantiate grpc stream manager (#1134)

* [CT-644] instantiate grpc stream manager

* update type

* update channel type

* [CT-646] stream offchain updates through stream manager (#1138)

* [CT-646] stream offchain updates through stream manager

* comments

* fix lint

* get rid of finished

* comments

* comments

* [CT-652] add command line flag for full node streaming (#1145)

* [CT-647] construct the initial orderbook snapshot (#1147)

* [CT-647] construct the initial orderbook snapshot

* [CT-647] initialize new streams and send orderbook snapshot (#1152)

* [CT-647] initialize new streams and send orderbook snapshot

* use sync once

* comments

* [CT-700] separate indexer and grpc streaming events (#1209)

* [CT-700] separate indexer and grpc streaming events

* fix tests

* comments

* update

* [CT-700] only send response when there is at least one update (#1216)

* [CT-712] send order update when short term order state fill amounts are pruned (#1241)

* [CT-712] send fill amount updates for reverted operations (#1240)

* [CT-723] add block number + stage to grpc updates (#1252)

* [CT-723] add block number + stage to grpc updates

* add indexer changes

* [CT-727] avoid state reads when sending updates (#1261)
dydxwill pushed a commit that referenced this pull request Apr 8, 2024
* [CT-645] Move off chain updates and v1 to a different package (#1131)

* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build

* [CT-644] instantiate grpc stream manager (#1134)

* [CT-644] instantiate grpc stream manager

* update type

* update channel type

* [CT-646] stream offchain updates through stream manager (#1138)

* [CT-646] stream offchain updates through stream manager

* comments

* fix lint

* get rid of finished

* comments

* comments

* [CT-652] add command line flag for full node streaming (#1145)

* [CT-647] construct the initial orderbook snapshot (#1147)

* [CT-647] construct the initial orderbook snapshot

* [CT-647] initialize new streams and send orderbook snapshot (#1152)

* [CT-647] initialize new streams and send orderbook snapshot

* use sync once

* comments

* [CT-700] separate indexer and grpc streaming events (#1209)

* [CT-700] separate indexer and grpc streaming events

* fix tests

* comments

* update

* [CT-700] only send response when there is at least one update (#1216)

* [CT-712] send order update when short term order state fill amounts are pruned (#1241)

* [CT-712] send fill amount updates for reverted operations (#1240)

* [CT-723] add block number + stage to grpc updates (#1252)

* [CT-723] add block number + stage to grpc updates

* add indexer changes

* [CT-727] avoid state reads when sending updates (#1261)
dydxwill added a commit that referenced this pull request Apr 8, 2024
* [OTE-221] Add query for PendingSendPacket (backport #1176) (#1221)


---------

Co-authored-by: Teddy Ding <teddy@dydx.exchange>
(cherry picked from commit e545bbf)

# Conflicts:
#	indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
#	indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts
#	indexer/packages/v4-protos/src/codegen/google/bundle.ts
#	protocol/go.mod

* fix protos

* update go.mod

---------

Co-authored-by: Mohammed Affan <affanmd@nyu.edu>
Co-authored-by: affan <affan@dydx.exchange>

* [Backport v4.x] backport full node streaming to v4.x branch (#1270)

* [CT-645] Move off chain updates and v1 to a different package (#1131)

* [CT-645] Add protos for orderbook stream query service

* move removal reasons to a separate package

* [CT-645] Add protos for orderbook stream query service (#1133)

* [CT-645] Add protos for orderbook stream query service

* make update not nullable

* fix build

* [CT-644] instantiate grpc stream manager (#1134)

* [CT-644] instantiate grpc stream manager

* update type

* update channel type

* [CT-646] stream offchain updates through stream manager (#1138)

* [CT-646] stream offchain updates through stream manager

* comments

* fix lint

* get rid of finished

* comments

* comments

* [CT-652] add command line flag for full node streaming (#1145)

* [CT-647] construct the initial orderbook snapshot (#1147)

* [CT-647] construct the initial orderbook snapshot

* [CT-647] initialize new streams and send orderbook snapshot (#1152)

* [CT-647] initialize new streams and send orderbook snapshot

* use sync once

* comments

* [CT-700] separate indexer and grpc streaming events (#1209)

* [CT-700] separate indexer and grpc streaming events

* fix tests

* comments

* update

* [CT-700] only send response when there is at least one update (#1216)

* [CT-712] send order update when short term order state fill amounts are pruned (#1241)

* [CT-712] send fill amount updates for reverted operations (#1240)

* [CT-723] add block number + stage to grpc updates (#1252)

* [CT-723] add block number + stage to grpc updates

* add indexer changes

* [CT-727] avoid state reads when sending updates (#1261)

* [CT-712] send updates for both normal order matches and liquidation (#1280) (#1281)

* Fix lib.ErrorLogWithError: properly pass in args (#1306) (#1310)

(cherry picked from commit a91c1ca)

Co-authored-by: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>

* fix broken tests (#1312) (#1316)

(cherry picked from commit 5ec37d2)

Co-authored-by: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Mohammed Affan <affanmd@nyu.edu>
Co-authored-by: affan <affan@dydx.exchange>
Co-authored-by: jayy04 <103467857+jayy04@users.noreply.github.com>
Co-authored-by: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants