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

[TRA-70] Add state migrations for isolated markets #1155

Merged
merged 6 commits into from
Mar 8, 2024
Merged

[TRA-70] Add state migrations for isolated markets #1155

merged 6 commits into from
Mar 8, 2024

Conversation

shrenujb
Copy link
Contributor

@shrenujb shrenujb commented Mar 7, 2024

Changelist

Add state migration to have all perpetuals marked as MARKET_TYPE_CROSS

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.

Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
Copy link

linear bot commented Mar 7, 2024

Copy link

coderabbitai bot commented Mar 7, 2024

Walkthrough

The update enhances the perpetuals market handling within the protocol by setting all existing perpetuals to a cross-market type during upgrades. This involves introducing a new function in the upgrade handler to facilitate this update and adding functions to manage market types for perpetuals in storage. These changes streamline the process of updating perpetuals and ensure consistency across different market types.

Changes

Files Change Summary
protocol/app/upgrades/v5.0.0/upgrade.go Introduces perpetualsUpgrade function to update perpetuals to a cross market type.
protocol/mocks/PerpetualsKeeper.go Adds GetAllPerpetuals function for retrieving all perpetuals and SetPerpetualMarketType function.
protocol/x/perpetuals/keeper/perpetual.go Adds SetPerpetualMarketType function to update market type in storage.
protocol/x/perpetuals/keeper/perpetual_test.go Adds tests for SetPerpetualMarketType to ensure proper functionality.

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.
    • 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 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 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: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 909c47f and 7d63b0a.
Files selected for processing (5)
  • protocol/app/upgrades.go (2 hunks)
  • protocol/app/upgrades/v5.0.0/constants.go (1 hunks)
  • protocol/app/upgrades/v5.0.0/upgrade.go (1 hunks)
  • protocol/x/perpetuals/keeper/perpetual.go (1 hunks)
  • protocol/x/perpetuals/types/types.go (1 hunks)
Additional comments: 3
protocol/app/upgrades/v5.0.0/constants.go (1)
  • 17-17: The addition of vaulttypes.StoreKey to the Added field of the Upgrade struct is a crucial step for the upgrade process. Ensure that the new store key is unique and adheres to the protocol's naming conventions.
protocol/x/perpetuals/types/types.go (1)
  • 106-113: The addition of SetPerpetualMarketType and GetAllPerpetuals methods to the PerpetualsKeeper interface is essential for the upgrade process. Ensure that all existing implementations of the PerpetualsKeeper interface are updated to include these new methods to avoid compilation errors.
protocol/app/upgrades.go (1)
  • 33-33: The modification to include the app.PerpetualsKeeper parameter in the v5_0_0.CreateUpgradeHandler call is crucial for the upgrade process. Ensure that the PerpetualsKeeper is properly initialized and available at this point in the application lifecycle to avoid runtime errors.

Comment on lines 189 to 215
func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {

if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("market type %v", marketType),
)
}

// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}

// Modify perpetual.
perpetual.Params.MarketType = marketType

// Store the modified perpetual.
k.setPerpetual(ctx, perpetual)

return perpetual, nil
}
Copy link

Choose a reason for hiding this comment

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

The implementation of SetPerpetualMarketType correctly updates the market type of a perpetual and stores the modified perpetual in the context. However, there are a few areas for improvement and considerations:

  • Error Handling: The function returns a generic error if the specified market type is PERPETUAL_MARKET_TYPE_UNSPECIFIED. It might be helpful to provide a more descriptive error message indicating that an unspecified market type is not allowed.
  • Performance: The function retrieves the perpetual from storage, modifies it, and then writes it back. This is efficient for the task at hand. However, consider caching mechanisms if this function is called frequently in a transaction to minimize storage access.
  • Validation: Before setting the new market type, it's crucial to validate that the perpetual exists. This is correctly done by calling k.GetPerpetual. Additional validation, such as checking if the new market type is different from the current one, could save unnecessary storage operations.
  • Event Emission: Consider emitting an event after successfully changing the market type. This would be useful for off-chain services or UIs tracking changes to perpetuals.

Overall, the function achieves its intended purpose. Enhancements around error messaging, validation, and event emission could further improve its robustness and usability.

protocol/app/upgrades/v5.0.0/upgrade.go Outdated Show resolved Hide resolved
Comment on lines +45 to +47
// Set all perpetuals to cross market type
perpetualsUpgrade(sdkCtx, perpetualsKeeper)

Copy link

Choose a reason for hiding this comment

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

The call to perpetualsUpgrade within CreateUpgradeHandler does not handle potential errors. Consider capturing and handling any errors returned by perpetualsUpgrade to ensure that the upgrade process can respond appropriately to failures.

Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7d63b0a and 142696a.
Files selected for processing (3)
  • protocol/app/upgrades/v5.0.0/upgrade.go (1 hunks)
  • protocol/mocks/PerpetualsKeeper.go (2 hunks)
  • protocol/x/perpetuals/keeper/perpetual.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/app/upgrades/v5.0.0/upgrade.go
Additional comments: 2
protocol/mocks/PerpetualsKeeper.go (2)
  • 73-87: The implementation of GetAllPerpetuals correctly follows the pattern established by other methods in this mock class, using the Called method from the testify/mock package to simulate the behavior of the actual PerpetualsKeeper method it's mocking. This method is crucial for retrieving all perpetuals, likely to be used in the migration process to set all perpetuals to the cross market type. The method's signature and return type align with expectations based on the PR objectives.
  • 302-324: The SetPerpetualMarketType method addition to the PerpetualsKeeper mock is consistent with the objective of migrating all perpetuals to a single market type. The method's implementation follows the established mocking pattern, using the Called method to simulate the behavior of the actual PerpetualsKeeper method. This method is essential for setting the market type of a perpetual, facilitating the migration process. The method's signature, including the context, perpetual ID, and market type parameters, is appropriate for its intended use.

Comment on lines 189 to 214
func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("market type %v", marketType),
)
}

// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}

// Modify perpetual.
perpetual.Params.MarketType = marketType

// Store the modified perpetual.
k.setPerpetual(ctx, perpetual)

return perpetual, nil
}
Copy link

@coderabbitai coderabbitai bot Mar 7, 2024

Choose a reason for hiding this comment

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

The SetPerpetualMarketType function correctly implements the logic to update the market type of a perpetual. However, there are a few areas that could be improved for better maintainability and error handling:

  • Error Handling: When the market type is PERPETUAL_MARKET_TYPE_UNSPECIFIED, the function returns a wrapped error indicating an invalid market type. It's good practice to include the perpetual ID in the error message for easier debugging.
  • Logging: Consider adding logging for critical operations, such as updating the market type of a perpetual. This can be helpful for auditing and troubleshooting.
  • Validation: The function assumes that the provided marketType is either valid or unspecified. If there are more market types added in the future, this function might silently fail or behave unexpectedly. It might be beneficial to validate against all known market types explicitly.
func (k Keeper) SetPerpetualMarketType(
	ctx sdk.Context,
	perpetualId uint32,
	marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
	if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
		return types.Perpetual{}, errorsmod.Wrap(
			types.ErrInvalidMarketType,
-			fmt.Sprintf("market type %v", marketType),
+			fmt.Sprintf("invalid market type %v for perpetual %d", marketType, perpetualId),
		)
	}
	...
}

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.

Suggested change
func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("market type %v", marketType),
)
}
// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}
// Modify perpetual.
perpetual.Params.MarketType = marketType
// Store the modified perpetual.
k.setPerpetual(ctx, perpetual)
return perpetual, nil
}
func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("invalid market type %v for perpetual %d", marketType, perpetualId),
)
}
// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}
// Modify perpetual.
perpetual.Params.MarketType = marketType
// Store the modified perpetual.
k.setPerpetual(ctx, perpetual)
return perpetual, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good suggestion

Copy link

Choose a reason for hiding this comment

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

@shrenujb: I'm glad you found the suggestion helpful! If you have any more questions or need further assistance, feel free to ask. 😊


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 142696a and 321628d.
Files selected for processing (2)
  • protocol/x/perpetuals/keeper/perpetual.go (1 hunks)
  • protocol/x/perpetuals/keeper/perpetual_test.go (1 hunks)
Additional comments: 5
protocol/x/perpetuals/keeper/perpetual.go (1)
  • 189-214: The implementation of SetPerpetualMarketType function generally follows good practices in terms of parameter validation and updating the perpetual's market type. However, there are a few areas that could be improved or need attention:
  1. Parameter Validation: The validation for marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED is appropriate to ensure that an unspecified market type is not set. However, considering the previous comments from vincentwschau about only setting the type if it's not already set to CROSS/ISOLATED, it might be beneficial to add a check to see if the perpetual's market type is already set to the desired value before proceeding with the update. This would prevent unnecessary writes to the storage.

  2. Error Handling and Logging: While the function handles errors from getting the perpetual, it might be useful to add more detailed logging or error messages, especially when the update operation fails. This would help in debugging and maintaining the code.

  3. Testing: As mentioned by vincentwschau, adding simple tests for this function would be preferred. Testing scenarios should include successful market type updates, attempts to set an unspecified market type, and attempts to update non-existent perpetuals.

  4. Performance Considerations: If this function is expected to be called frequently, consider the impact of repeatedly fetching and updating perpetuals from storage. While not directly applicable to this specific function without more context, it's something to keep in mind for the overall system performance.

  5. Security Considerations: Ensure that only authorized entities can call this function, especially since it modifies the state of perpetuals. This is more of a broader architectural consideration but is worth mentioning.

  • Consider adding a check to prevent unnecessary storage updates if the perpetual's market type is already set to the desired value.
  • Enhance error handling and logging for better maintainability.
  • Add unit tests to cover various scenarios for this function.
  • Review the function's authorization mechanism to ensure only authorized calls are allowed.
protocol/x/perpetuals/keeper/perpetual_test.go (4)
  • 323-345: The test TestSetPerpetualMarketType_Success correctly sets up a perpetual, modifies its market type to PERPETUAL_MARKET_TYPE_CROSS, and asserts the change. This test is well-structured and covers the success scenario effectively.
  • 347-365: The test TestSetPerpetualMarketType_Failure is designed to verify the behavior when setting an invalid market type (PERPETUAL_MARKET_TYPE_UNSPECIFIED). It correctly expects an error and validates the error message. This test ensures robust error handling in the keeper method.
  • 323-365: Both TestSetPerpetualMarketType_Success and TestSetPerpetualMarketType_Failure tests are well-implemented, covering the success and failure scenarios of setting a perpetual market type. These tests ensure that the functionality behaves as expected under different conditions, contributing to the robustness of the perpetuals keeper implementation.
  • 367-367: It's commendable that the file includes a comprehensive suite of tests covering various scenarios, including success, failure, and edge cases. This thorough testing approach is crucial for maintaining the reliability and stability of the perpetuals keeper functionality.

Comment on lines 186 to 218
return perpetual, nil
}

func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("invalid market type %v for perpetual %d", marketType, perpetualId),
)
}

// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}

// Modify perpetual.
perpetual.Params.MarketType = marketType

// Store the modified perpetual.
k.setPerpetual(ctx, perpetual)

return perpetual, nil
}

// GetPerpetual returns a perpetual from its id.
func (k Keeper) GetPerpetual(
ctx sdk.Context,
Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [6-6]

The use of math/rand is noted in the imports. It's important to consider the context in which random values are used within this file. If the randomness is used in a security-sensitive context, such as generating unique identifiers or secrets that could affect the protocol's integrity, it's recommended to use crypto/rand instead of math/rand for cryptographically secure random number generation.

Consider replacing math/rand with crypto/rand if the randomness is used in security-sensitive contexts. This change enhances the security of the generated random values against predictability attacks.

Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 321628d and f7d05e3.
Files selected for processing (2)
  • protocol/x/perpetuals/keeper/perpetual.go (5 hunks)
  • protocol/x/perpetuals/keeper/perpetual_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/x/perpetuals/keeper/perpetual_test.go
Additional comments: 3
protocol/x/perpetuals/keeper/perpetual.go (3)
  • 114-114: The usage of SetPerpetual function across various parts of the codebase (lines 114, 168, 218, 1218, and 1244) indicates its critical role in updating the perpetual state within the store. A few points to consider:
  • Correctness and Logic: The function is used correctly to update the perpetual's state after modifications. This ensures that any changes made to a perpetual's parameters are persisted in the store.
  • Performance: Given the nature of blockchain and state management, the usage of this function is expected and does not raise performance concerns.
  • Maintainability: The renaming of setPerpetual to SetPerpetual for consistency improves the maintainability of the code by adhering to naming conventions and making the function's purpose more explicit.

Overall, the changes related to the SetPerpetual function are appropriate and align with best practices for state management within the Cosmos SDK framework.

Also applies to: 168-168, 218-218, 1218-1218, 1244-1244

  • 111-117: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [6-6]

The usage of math/rand for generating random numbers is identified in the import section. For cryptographic operations or any operation requiring a higher degree of randomness and security, it's recommended to use crypto/rand instead of math/rand. However, after reviewing the code, it appears that math/rand is not actively used within the provided code segments. This might be a remnant of previous code versions or used in parts of the code not included in the review. If math/rand is not needed, consider removing the import to clean up the code.

  • 111-117: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [6-6]

The file imports both math/big and math/rand, where math/rand is flagged by static analysis tools. Given the context of blockchain and financial calculations, the use of math/big is justified for handling large numbers and precise arithmetic operations. However, as mentioned earlier, if math/rand is not used within the code, it should be removed to avoid unnecessary imports and potential security concerns in scenarios where cryptographic randomness is required.

Comment on lines +189 to +221
func (k Keeper) SetPerpetualMarketType(
ctx sdk.Context,
perpetualId uint32,
marketType types.PerpetualMarketType,
) (types.Perpetual, error) {
if marketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("invalid market type %v for perpetual %d", marketType, perpetualId),
)
}

// Get perpetual.
perpetual, err := k.GetPerpetual(ctx, perpetualId)
if err != nil {
return perpetual, err
}

if perpetual.Params.MarketType != types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED {
return types.Perpetual{}, errorsmod.Wrap(
types.ErrInvalidMarketType,
fmt.Sprintf("perpetual %d already has market type %v", perpetualId, perpetual.Params.MarketType),
)
}

// Modify perpetual.
perpetual.Params.MarketType = marketType

// Store the modified perpetual.
k.SetPerpetual(ctx, perpetual)

return perpetual, nil
}
Copy link

Choose a reason for hiding this comment

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

The implementation of SetPerpetualMarketType function has several aspects to consider:

  • Correctness and Logic: The function correctly checks for an unspecified market type and returns an error if encountered. However, the logic to prevent changing an already specified market type (line 207-212) seems to contradict the PR objectives and previous discussions. The condition checks if the market type is not unspecified and returns an error, which means it's impossible to change the market type once set. This contradicts the intention to migrate perpetuals to a specific market type and the discussion about adding a restriction and then removing it in future releases.
  • Performance: The function performs a GetPerpetual call to fetch the current state of the perpetual before updating it. This is necessary and does not pose a performance issue given the context.
  • Security/PII Leakage: No PII or sensitive data handling is involved in this function.
  • Error Handling: Errors are correctly wrapped with context, providing clarity on the operation that failed.
  • Maintainability: The function is straightforward and maintains consistency with the existing codebase structure. However, the logic might need revisiting based on the intended functionality regarding market type updates.

Consider revisiting the implementation logic concerning the ability to update the market type of a perpetual, especially in light of the discussions and objectives outlined in the PR and previous comments.

Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
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 f7d05e3 and 19a71ad.
Files selected for processing (1)
  • protocol/x/perpetuals/keeper/perpetual_test.go (1 hunks)

@shrenujb shrenujb merged commit 454cb0c into main Mar 8, 2024
17 checks passed
@shrenujb shrenujb deleted the tra70 branch March 8, 2024 22:30
Eric-Warehime pushed a commit to skip-mev/v4-chain that referenced this pull request Mar 12, 2024
Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
Signed-off-by: Eric <eric.warehime@gmail.com>
Eric-Warehime added a commit to skip-mev/v4-chain that referenced this pull request Mar 12, 2024
commit d98f859
Author: Eric <eric.warehime@gmail.com>
Date:   Mon Mar 11 12:46:53 2024 -0700

    Update sample pregenesis

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 7f178fe
Author: Mohammed Affan <affanmd@nyu.edu>
Date:   Mon Mar 11 13:46:08 2024 -0400

    [OTE-209] Emit metrics gated through execution mode (dydxprotocol#1157)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 47e365d
Author: dydxwill <119354122+dydxwill@users.noreply.github.com>
Date:   Mon Mar 11 13:43:16 2024 -0400

    add aggregate comlink response code stats (dydxprotocol#1162)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 7774ad9
Author: shrenujb <98204323+shrenujb@users.noreply.github.com>
Date:   Fri Mar 8 17:30:49 2024 -0500

    [TRA-70] Add state migrations for isolated markets (dydxprotocol#1155)

    Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 89c7405
Author: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>
Date:   Thu Mar 7 17:28:06 2024 -0500

    [CT-517] E2E tests batch cancel (dydxprotocol#1149)

    * more end to end test

    * extraprint

    * more e2e test

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 41a3a41
Author: Teddy Ding <teddy@dydx.exchange>
Date:   Thu Mar 7 15:42:30 2024 -0500

    [OTE-200] OIMF protos (dydxprotocol#1125)

    * OIMF protos

    * add default genesis value, modify methods interface

    * fix genesis file

    * fix integration test

    * lint

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 2a062b1
Author: Teddy Ding <teddy@dydx.exchange>
Date:   Thu Mar 7 15:24:15 2024 -0500

    Add `v5` upgrade handler and set up container upgrade test (dydxprotocol#1153)

    * wip

    * update preupgrade_genesis

    * fix preupgrade_genesis.json

    * nit

    * setupUpgradeStoreLoaders for v5.0.0

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit b7942b3
Author: jayy04 <103467857+jayy04@users.noreply.github.com>
Date:   Thu Mar 7 13:43:48 2024 -0500

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

    * [CT-647] construct the initial orderbook snapshot

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

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

    * use sync once

    * comments

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit c67a3c6
Author: shrenujb <98204323+shrenujb@users.noreply.github.com>
Date:   Thu Mar 7 12:40:37 2024 -0500

    [TRA-84] Move SA module address transfers to use perpetual based SA accounts (dydxprotocol#1146)

    Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange
    Signed-off-by: Eric <eric.warehime@gmail.com>

commit dba23e0
Author: Mohammed Affan <affanmd@nyu.edu>
Date:   Thu Mar 7 10:34:11 2024 -0500

    update readme link to point to the right page (dydxprotocol#1151)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit b5870d5
Author: Tian <tian@dydx.exchange>
Date:   Wed Mar 6 16:43:04 2024 -0500

    [TRA-86] scaffold x/vault (dydxprotocol#1148)

    * scaffold x/vault

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 0eca041
Author: jayy04 <103467857+jayy04@users.noreply.github.com>
Date:   Wed Mar 6 10:48:42 2024 -0500

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

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit b319cb8
Author: jayy04 <103467857+jayy04@users.noreply.github.com>
Date:   Tue Mar 5 21:58:35 2024 -0500

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

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

    * comments

    * fix lint

    * get rid of finished

    * comments

    * comments

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 1c54620
Author: shrenujb <98204323+shrenujb@users.noreply.github.com>
Date:   Tue Mar 5 16:34:19 2024 -0500

    [TRA-78] Add function to retrieve collateral pool addr for a subaccount (dydxprotocol#1142)

    Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
    Signed-off-by: Eric <eric.warehime@gmail.com>

commit b8c1d62
Author: dydxwill <119354122+dydxwill@users.noreply.github.com>
Date:   Tue Mar 5 15:03:28 2024 -0500

    [OTE-141] implement post /compliance/geoblock (dydxprotocol#1129)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit ab8c570
Author: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>
Date:   Tue Mar 5 11:19:53 2024 -0500

    Fix mock-gen dydxprotocol#1140

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 12506a1
Author: shrenujb <98204323+shrenujb@users.noreply.github.com>
Date:   Mon Mar 4 21:33:28 2024 -0500

    [TRA-64] Use market specific insurance fund for cross or isolated markets (dydxprotocol#1132)

    Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 929f09e
Author: Jonathan Fung <121899091+jonfung-dydx@users.noreply.github.com>
Date:   Mon Mar 4 13:48:04 2024 -0800

    [CT-514] Clob `MsgBatchCancel` functionality (dydxprotocol#1110)

    * wip implementation

    * use new cometbft

    * Revert "use new cometbft"

    This reverts commit e5b8a03.

    * go mod tidy

    * basic e2e test

    * more msgBatchCancels in code

    * repeated fixed32 -> uint32

    * remove debug prints

    * update cometbft replace go.mod sha

    * one more debug print

    * typo

    * regen indexer protos

    * update comment on proto

    * proto comment changes

    * extract stateful validation into own fn

    * pr format comments

    * clean up test file

    * new return type with success and failure

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 41de83e
Author: dydxwill <119354122+dydxwill@users.noreply.github.com>
Date:   Mon Mar 4 12:22:16 2024 -0500

    add index to address read replica lag (dydxprotocol#1137)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 735d9a8
Author: dydxwill <119354122+dydxwill@users.noreply.github.com>
Date:   Mon Mar 4 11:56:59 2024 -0500

    rename (dydxprotocol#1136)

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 86617dd
Author: jayy04 <103467857+jayy04@users.noreply.github.com>
Date:   Mon Mar 4 10:43:31 2024 -0500

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

    * [CT-644] instantiate grpc stream manager

    * update type

    * update channel type

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit 32afd64
Author: Eric <eric.warehime@gmail.com>
Date:   Mon Mar 11 12:41:06 2024 -0700

    Update go version in Dockerfile

    Signed-off-by: Eric <eric.warehime@gmail.com>

commit ba27204
Author: Eric <eric.warehime@gmail.com>
Date:   Fri Mar 8 09:44:04 2024 -0800

    Add slinky utils, use that to convert between market and currency pair

commit 667a804
Author: Eric <eric.warehime@gmail.com>
Date:   Wed Mar 6 20:43:40 2024 -0800

    Update error messages

commit d53292c
Author: Eric <eric.warehime@gmail.com>
Date:   Wed Mar 6 20:16:01 2024 -0800

    Update docstrings, rename OracleClient

commit daad125
Author: Eric <eric.warehime@gmail.com>
Date:   Mon Mar 4 10:51:23 2024 -0800

    VoteExtension slinky logic
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