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-617] Integrate PML and Megavault #2331

Merged
merged 13 commits into from
Sep 25, 2024
Merged

[TRA-617] Integrate PML and Megavault #2331

merged 13 commits into from
Sep 25, 2024

Conversation

shrenujb
Copy link
Contributor

@shrenujb shrenujb commented Sep 24, 2024

Changelist

These are the changes to integrate Megavault into PML.
Every market listing will deposit a min amount into the megavault in order to provide immediate liquidity into the market

Test Plan

Added tests

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.

Summary by CodeRabbit

  • New Features
    • Introduced a new field for vault deposit parameters in the GenesisState, enhancing configuration options for market listings.
    • Updated market cap limits to a new threshold of 500.
    • Added functionality to deposit funds into a megavault for new PML markets, including locking shares for a specified duration.
  • Bug Fixes
    • Enhanced deposit functionality for PML markets, ensuring accurate fund allocation and locking mechanisms.
  • Tests
    • Added comprehensive tests for the new deposit functionality, improving coverage and reliability of the listing features.

@shrenujb shrenujb requested a review from a team as a code owner September 24, 2024 17:02
Copy link

linear bot commented Sep 24, 2024

Copy link
Contributor

coderabbitai bot commented Sep 24, 2024

Warning

Rate limit exceeded

@shrenujb has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between f82e1a6 and 9aa85a3.

Walkthrough

The changes introduce enhancements to the vault management system within the protocol, focusing on new fields and methods related to vault deposit parameters. Key updates include modifications to the GenesisState, the addition of a deposit function for a megavault, and improvements to the testing framework, all aimed at refining the management of vaults, deposits, and market listings across various modules.

Changes

File Path Change Summary
proto/dydxprotocol/listing/genesis.proto Added import statements and a new field listing_vault_deposit_params to GenesisState, marked as non-nullable.
protocol/app/testdata/default_genesis_state.json Updated hard_cap_for_markets from 0 to 500 and added listing_vault_deposit_params with specific parameters.
protocol/scripts/genesis/sample_pregenesis.json Updated hard_cap_for_markets from 0 to 500 and added listing_vault_deposit_params with specific parameters.
protocol/testing/genesis.sh Modified the edit_genesis function to include new parameters for vault deposits and market caps.
protocol/testutil/constants/genesis.go Updated the hard_cap_for_markets constant from 0 to 500 and added the listing_vault_deposit_params structure with new fields.
protocol/x/clob/keeper/clob_pair.go Removed validation check for duplicate ClobPair IDs in CreateClobPair method, moved state writing to SetClobPair, and renamed the method to reflect public access.
protocol/x/listing/keeper/listing.go Introduced DepositToMegavaultforPML function for depositing funds into a megavault.
protocol/x/listing/keeper/listing_test.go Added TestDepositToMegavaultforPML to test the new deposit function and streamlined TestCreateClobPair.
protocol/x/listing/types/expected_keepers.go Added new VaultKeeper interface with methods for vault operations and updated ClobKeeper interface with SetClobPair method.
protocol/x/vault/keeper/params.go Added SetVaultStatus method to modify the status of vault parameters.

Possibly related PRs

Suggested reviewers

  • vincentwschau
  • tqin7

Poem

In the land of code, a vault does gleam,
With deposits and parameters, it's a dream!
New fields and functions, all in a row,
Managing assets, watch them grow!
Hops of joy for changes so bright,
In the world of protocols, all feels right! 🐇✨


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Signed-off-by: Shrenuj Bansal <[email protected]>
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: 11

Outside diff range and nitpick comments (16)
protocol/x/listing/types/genesis.go (1)

Line range hint 13-15: Consider adding validation for ListingVaultDepositParams

The Validate function is currently empty and doesn't perform any checks on the ListingVaultDepositParams field. Consider adding validation logic to ensure the integrity of the genesis state, especially for the newly added field.

Here's a suggested implementation:

func (gs GenesisState) Validate() error {
-	return nil
+	if err := gs.ListingVaultDepositParams.Validate(); err != nil {
+		return fmt.Errorf("invalid listing vault deposit params: %w", err)
+	}
+	return nil
}

This assumes that the Params type has a Validate method. If it doesn't, you may need to implement appropriate validation logic directly in this function.

proto/dydxprotocol/listing/genesis.proto (1)

15-16: LGTM! New field added correctly.

The new listing_vault_deposit_params field is appropriately added to the GenesisState message:

  1. It uses the correct type ListingVaultDepositParams.
  2. It's marked as non-nullable, ensuring it's always present in the genesis state.
  3. The field number (2) is correctly sequenced.

Consider adding a comment above the new field to explain its purpose and relationship to the Megavault integration, similar to the comment for hard_cap_for_markets. For example:

// listing_vault_deposit_params defines the parameters for PML Megavault deposits
// used to provide immediate liquidity to the market.
ListingVaultDepositParams listing_vault_deposit_params = 2 [(gogoproto.nullable) = false];
protocol/x/listing/keeper/keeper.go (1)

23-23: Summary: Changes align with PR objectives

The modifications to the Keeper struct and NewKeeper function successfully integrate the VaultKeeper, which aligns with the PR objective of integrating Megavault into the PML system. These changes lay the groundwork for implementing the requirement that every market listing will deposit a minimum amount into the Megavault.

To fully complete this integration, ensure that:

  1. The VaultKeeper interface is properly defined with the necessary methods for interacting with Megavault.
  2. The concrete implementation of VaultKeeper is created and tested.
  3. The logic for depositing the minimum amount into Megavault for each market listing is implemented in the appropriate location (likely in a separate PR or additional files).
  4. Unit tests are added to verify the integration and functionality of the VaultKeeper within the Keeper struct.

Also applies to: 35-35, 45-45

protocol/x/listing/module.go (1)

106-106: LGTM. Consider adding a comment for the new field.

The addition of the vaultKeeper field to the AppModule struct is appropriate and aligns with the PR objective of integrating Megavault into the PML system.

Consider adding a brief comment explaining the purpose of this field, similar to other fields in the struct. For example:

// vaultKeeper manages the vault operations for the listing module
vaultKeeper types.VaultKeeper
protocol/app/testdata/default_genesis_state.json (1)

356-361: Summary of changes and potential impact

The changes in this file are crucial for integrating Megavault into the PML system:

  1. Setting a hard cap of 500 markets introduces a limit that may affect system scalability.
  2. The new listing_vault_deposit_params establishes the framework for market listing deposits into Megavault.

These changes have the potential to significantly impact the system's behavior and capacity. Ensure that thorough testing is conducted to verify:

  1. The system's behavior when approaching and reaching the market cap.
  2. The correct application of vault deposits for new market listings.
  3. The locking and unlocking of shares based on the specified block number.

Additionally, consider documenting these new parameters and their implications for system administrators and users.

protocol/x/clob/keeper/clob_pair.go (1)

Line range hint 210-215: LGTM: Improved function visibility

The change from setClobPair to SetClobPair is good. Making the function public allows for better modularity and potential reuse in other packages. The implementation remains consistent, which is great.

Consider adding a brief comment explaining why this function is now exported. For example:

// SetClobPair sets a specific `ClobPair` in the store from its index.
// This function is exported to allow other packages to directly set CLOB pairs if needed.
func (k Keeper) SetClobPair(ctx sdk.Context, clobPair types.ClobPair) {
    // ... (rest of the function remains the same)
}
protocol/testing/genesis.sh (2)

Line range hint 1-2268: Consider refactoring the edit_genesis function for improved maintainability

The edit_genesis function is quite long and handles configurations for multiple modules. While the new "Listing" section is appropriately placed, the overall structure of the function could be improved for better readability and maintainability.

Consider refactoring the edit_genesis function by:

  1. Breaking it down into smaller, module-specific functions.
  2. Using a more declarative approach for setting configuration values.
  3. Implementing error handling and validation for input parameters.

This refactoring would make the code easier to understand, maintain, and extend in the future.

Here's an example of how you could start refactoring:

function edit_genesis() {
    local GENESIS=$1
    # ... (other local variable declarations)

    update_consensus_params
    update_crisis_module
    update_gov_module
    update_staking_module
    update_assets_module
    update_bridge_module
    update_ibc_module
    update_perpetuals_module
    update_prices_module
    update_clob_module
    update_listing_module
    # ... (other module update functions)
}

function update_listing_module() {
    local GENESIS=$1
    
    dasel put -t int -f "$GENESIS" ".app_state.listing.hard_cap_for_markets" -v '500'
    
    local new_vault_deposit="10000"
    local main_vault_deposit="0"
    local num_blocks_to_lock=2592000
    
    dasel put -t string -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.new_vault_deposit_amount" -v "$new_vault_deposit"
    dasel put -t string -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.main_vault_deposit_amount" -v "$main_vault_deposit"
    dasel put -t int -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.num_blocks_to_lock_shares" -v "$num_blocks_to_lock"
}

# ... (other module update functions)

This structure would make it easier to manage and update individual modules, as well as add new modules in the future.


Line range hint 1-2268: Suggestions for improving overall script structure and implementation

While the script is functional, there are several areas where it could be improved:

  1. Documentation: Add more comprehensive comments explaining the purpose of each function and any non-obvious logic.

  2. Configuration: Consider moving hardcoded values to a separate configuration file or environment variables for easier management and customization.

  3. Error Handling: Implement more robust error handling and input validation throughout the script.

  4. Modularity: Break down large functions into smaller, more focused functions to improve readability and maintainability.

  5. Consistency: Ensure consistent naming conventions and coding style throughout the script.

  6. Testing: Add unit tests for individual functions to ensure reliability and ease of maintenance.

  7. Logging: Implement a logging mechanism to track the execution of the script and aid in debugging.

  8. Dependencies: Clearly document and check for required external tools (e.g., dasel, jq) at the beginning of the script.

Here's an example of how you could start implementing some of these improvements:

#!/bin/bash
set -euo pipefail

# Load configuration
source ./config.sh

# Check dependencies
check_dependencies() {
    local deps=("dasel" "jq")
    for dep in "${deps[@]}"; do
        if ! command -v "$dep" &> /dev/null; then
            echo "Error: $dep is required but not installed." >&2
            exit 1
        fi
    done
}

# Logging function
log() {
    echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"
}

# Main function
main() {
    check_dependencies
    
    log "Starting genesis file editing"
    edit_genesis "$@"
    log "Finished editing genesis file"
}

# Run the script
main "$@"

Implementing these suggestions would greatly improve the overall quality, maintainability, and robustness of the script.

protocol/x/listing/keeper/listing.go (1)

203-207: Consider renaming DepositToMegavaultforPML to DepositToMegavaultForPML

For consistency with Go naming conventions, consider renaming the method to DepositToMegavaultForPML using CamelCase formatting. This enhances readability and aligns with standard naming practices.

Apply this diff to rename the function:

-func (k Keeper) DepositToMegavaultforPML(
+func (k Keeper) DepositToMegavaultForPML(
    ctx sdk.Context,
    fromSubaccount satypes.SubaccountId,
    clobPairId uint32,
) error {
protocol/x/vault/keeper/vault.go (4)

296-298: Wrap the error with context when ClobPair is not found

Currently, the code returns 'types.ErrClobPairNotFound' directly. Wrapping the error with additional context can provide more information and aid in debugging.

Apply this diff to wrap the error:

if !exists {
-    return types.ErrClobPairNotFound
+    return errorsmod.Wrapf(types.ErrClobPairNotFound, "ClobPairId %d not found for VaultId %v", vaultId.Number, vaultId)
}

305-317: Handle potential error when adding vault to address store

After setting the vault params, it's good practice to check for potential errors when adding the vault to the address store, even if the current implementation does not return an error.

Modify the code to handle any future errors:

err = k.AddVaultToAddressStore(ctx, vaultId)
if err != nil {
    return err
}

Additionally, if 'AddVaultToAddressStore' cannot fail, consider documenting this behavior in the function's comments.


320-328: Provide detailed error handling for 'ProcessTransfer'

When calling 'k.sendingKeeper.ProcessTransfer', if an error occurs, wrapping it with additional context can help identify the source of the error more quickly.

Apply this diff to wrap the error:

if err := k.sendingKeeper.ProcessTransfer(
    ctx,
    &sendingtypes.Transfer{
        Sender:    types.MegavaultMainSubaccount,
        Recipient: *vaultId.ToSubaccountId(),
        AssetId:   assetstypes.AssetUsdc.Id,
        Amount:    quantums.Uint64(),
    },
); err != nil {
-    return err
+    return errorsmod.Wrap(err, "failed to process transfer from main vault to specified vault")
}

293-331: Consider thread-safety if the method is called concurrently

If 'AllocateToVault' can be called concurrently by multiple goroutines, there may be race conditions when checking and setting vault parameters or when adding to the address store.

Consider adding synchronization mechanisms or documenting that this method is not thread-safe if concurrent calls are possible.

protocol/x/listing/keeper/listing_test.go (3)

281-295: Wrap Clob Pair Assertions within DeliverTx Mode Check

The assertions for the clobPair properties are executed regardless of the transaction mode. To avoid unnecessary checks during CheckTx mode and to ensure that the clobPair is only validated when it's actually created, consider wrapping these assertions inside the if tc.isDeliverTx condition.

Apply this diff to adjust the assertions:

-	clobPair, found := clobKeeper.GetClobPair(ctx, clobtypes.ClobPairId(clobPairId))
-	require.True(t, found)
-	require.Equal(t, clobtypes.ClobPair_STATUS_ACTIVE, clobPair.Status)
-	require.Equal(
-		t,
-		clobtypes.SubticksPerTick(types.SubticksPerTick_LongTail),
-		clobPair.GetClobPairSubticksPerTick(),
-	)
-	require.Equal(
-		t,
-		types.DefaultStepBaseQuantums,
-		clobPair.GetClobPairMinOrderBaseQuantums().ToUint64(),
-	)
-	require.Equal(t, perpetualId, clobPair.MustGetPerpetualId())
-
-	// Check if the clob pair was created only if we are in deliverTx mode
-	_, found = clobKeeper.PerpetualIdToClobPairId[perpetualId]
-	if tc.isDeliverTx {
-		require.True(t, found)
-	} else {
-		require.False(t, found)
-	}
+	if tc.isDeliverTx {
+		clobPair, found := clobKeeper.GetClobPair(ctx, clobtypes.ClobPairId(clobPairId))
+		require.True(t, found)
+		require.Equal(t, clobtypes.ClobPair_STATUS_ACTIVE, clobPair.Status)
+		require.Equal(
+			t,
+			clobtypes.SubticksPerTick(types.SubticksPerTick_LongTail),
+			clobPair.GetClobPairSubticksPerTick(),
+		)
+		require.Equal(
+			t,
+			types.DefaultStepBaseQuantums,
+			clobPair.GetClobPairMinOrderBaseQuantums().ToUint64(),
+		)
+		require.Equal(t, perpetualId, clobPair.MustGetPerpetualId())
+
+		// Check if the clob pair was created
+		_, found = clobKeeper.PerpetualIdToClobPairId[perpetualId]
+		require.True(t, found)
+	} else {
+		_, found = clobKeeper.PerpetualIdToClobPairId[perpetualId]
+		require.False(t, found)
+	}

390-402: Enhance Error Assertions for Specificity

In the error handling of your tests, it's beneficial to assert specific error messages or types to ensure that the correct errors are being triggered. This makes your tests more robust and helps pinpoint issues more effectively.

Consider updating the error assertions as follows:

 if tc.expectedErr != "" {
-	require.ErrorContains(t, err, tc.expectedErr)
+	require.Error(t, err)
+	require.Contains(t, err.Error(), tc.expectedErr)
 } else {
 	require.NoError(t, err)
 }

308-308: Typographical Correction in Function Name

The function name TestDepositToMegavaultforPML has inconsistent capitalization for "for". For consistency and readability, consider renaming it to TestDepositToMegavaultForPML.

Apply this diff to correct the function name:

-func TestDepositToMegavaultforPML(t *testing.T) {
+func TestDepositToMegavaultForPML(t *testing.T) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c34d56d and d40ab11.

Files ignored due to path filters (1)
  • protocol/x/listing/types/genesis.pb.go is excluded by !**/*.pb.go
Files selected for processing (18)
  • proto/dydxprotocol/listing/genesis.proto (1 hunks)
  • protocol/app/app.go (2 hunks)
  • protocol/app/testdata/default_genesis_state.json (1 hunks)
  • protocol/testing/genesis.sh (1 hunks)
  • protocol/testutil/constants/genesis.go (1 hunks)
  • protocol/testutil/keeper/listing.go (4 hunks)
  • protocol/x/clob/keeper/clob_pair.go (3 hunks)
  • protocol/x/listing/genesis.go (1 hunks)
  • protocol/x/listing/keeper/keeper.go (3 hunks)
  • protocol/x/listing/keeper/listing.go (3 hunks)
  • protocol/x/listing/keeper/listing_test.go (3 hunks)
  • protocol/x/listing/keeper/msg_create_market_permissionless.go (1 hunks)
  • protocol/x/listing/keeper/msg_create_market_permissionless_test.go (2 hunks)
  • protocol/x/listing/module.go (3 hunks)
  • protocol/x/listing/types/expected_keepers.go (3 hunks)
  • protocol/x/listing/types/genesis.go (1 hunks)
  • protocol/x/vault/keeper/msg_server_allocate_to_vault.go (1 hunks)
  • protocol/x/vault/keeper/vault.go (2 hunks)
Additional context used
buf
proto/dydxprotocol/listing/genesis.proto

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)

Additional comments not posted (32)
protocol/x/listing/types/genesis.go (1)

6-7: LGTM! Verify DefaultParams() implementation.

The addition of ListingVaultDepositParams initialized with DefaultParams() aligns with the PR objective of integrating Megavault into the PML system. The HardCapForMarkets remains unchanged, which is consistent with the PR objectives.

To ensure the correctness of the DefaultParams() function, please run the following script:

proto/dydxprotocol/listing/genesis.proto (2)

1-16: Overall changes align well with PR objectives.

The addition of the listing_vault_deposit_params field to the GenesisState message is a good start for integrating Megavault into the PML system. This change allows for specifying deposit parameters for each market listing, which aligns with the PR objective of ensuring that every market listing will deposit a minimum amount into the Megavault.

To ensure completeness of the implementation, please verify the following:

  1. Is there a corresponding update to the genesis initialization logic to handle the new listing_vault_deposit_params field?
  2. Are there any other files that need to be updated to use this new parameter (e.g., in the listing process or market creation)?

You can use the following script to check for related changes:

#!/bin/bash
# Check for related changes in other files
echo "Files potentially needing updates for Megavault integration:"
rg --type go -l "GenesisState" ./x/listing
echo "Files with potential genesis initialization logic:"
rg --type go -l "InitGenesis.*listing" ./x/listing

Please ensure that all necessary changes for the Megavault integration are included in this PR or planned for future PRs.

Tools
buf

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)


4-5: LGTM! New imports are appropriate for the changes.

The new imports are necessary for the added functionality:

  1. gogoproto/gogo.proto is required for using gogo/protobuf extensions.
  2. dydxprotocol/listing/params.proto is needed for the new ListingVaultDepositParams type.

Regarding the static analysis hint about the missing "gogoproto/gogo.proto" file, this is likely a false positive. To verify, run the following command:

Verification successful

LGTM! Imports and dependencies are correctly configured.

The genesis.proto file properly imports:

  1. gogoproto/gogo.proto is declared in protocol/go.mod and will be fetched as a dependency during the build process.
  2. dydxprotocol/listing/params.proto is necessary for the added functionality.

The static analysis warning regarding the missing gogoproto/gogo.proto is a false positive in this context, as dependencies are managed externally.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if gogoproto is properly set up in the project
if grep -q "github.com/gogo/protobuf" go.mod; then
  echo "gogoproto is properly set up in the project"
else
  echo "gogoproto might be missing from the project dependencies"
fi

Length of output: 441


Script:

#!/bin/bash
# Script 1: Check if "github.com/gogo/protobuf" is listed in go.mod
if grep -q "github.com/gogo/protobuf" go.mod; then
  echo "Dependency check: 'github.com/gogo/protobuf' is present in go.mod."
else
  echo "Dependency check: 'github.com/gogo/protobuf' is missing from go.mod."
fi

# Script 2: Verify the import statement for "gogoproto/gogo.proto" in genesis.proto
if grep -q 'import "gogoproto/gogo.proto";' proto/dydxprotocol/listing/genesis.proto; then
  echo "Import statement check: 'gogoproto/gogo.proto' is correctly imported in genesis.proto."
else
  echo "Import statement check: 'gogoproto/gogo.proto' is missing from genesis.proto."
fi

# Script 3: Confirm the existence of 'gogoproto/gogo.proto' in the repository
if fd "gogo.proto" --type f | grep -q "gogoproto/gogo.proto"; then
  echo "File presence check: 'gogoproto/gogo.proto' exists in the repository."
else
  echo "File presence check: 'gogoproto/gogo.proto' does not exist in the repository."
fi

Length of output: 734


Script:

#!/bin/bash
# Script 4: Locate all go.mod files in the repository
echo "Searching for all go.mod files in the repository..."
fd "go.mod" --type f

# Script 5: Check each found go.mod for "github.com/gogo/protobuf"
echo "Checking each go.mod for 'github.com/gogo/protobuf'..."
fd "go.mod" --type f | while read -r file; do
  if grep -q "github.com/gogo/protobuf" "$file"; then
    echo "Dependency check: 'github.com/gogo/protobuf' is present in $file."
  else
    echo "Dependency check: 'github.com/gogo/protobuf' is missing from $file."
  fi
done

# Script 6: Re-verify the existence of 'gogoproto/gogo.proto' in the repository
echo "Re-verifying the existence of 'gogoproto/gogo.proto'..."
fd "gogo.proto" --type f | grep -q "gogoproto/gogo.proto" && \
  echo "File presence check: 'gogoproto/gogo.proto' exists in the repository." || \
  echo "File presence check: 'gogoproto/gogo.proto' does not exist in the repository."

Length of output: 897

Tools
buf

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)

protocol/x/listing/keeper/msg_create_market_permissionless.go (2)

34-40: LGTM: Capturing clobPairId for further use

The changes here look good. Capturing the clobPairId returned by CreateClobPair is necessary for the new functionality added later in the function. The error handling remains consistent with the existing code style.


Line range hint 1-48: Overall, the changes look good with minor improvements needed

The implementation successfully integrates Megavault into the PML system as described in the PR objectives. The code quality is good, and error handling is consistent with the existing codebase.

To finalize this PR, please address the following points:

  1. Fix the typo in the function name DepositToMegavaultforPML to DepositToMegavaultForPML.
  2. Clarify the TODO comment: "TODO: vault deposit for PML". Is this still relevant, or can it be removed?
  3. Ensure that the DepositToMegavaultForPML function is properly implemented in the appropriate file.

Once these minor issues are resolved, the changes will be ready for merging.

protocol/x/listing/keeper/keeper.go (1)

23-23: LGTM. Verify VaultKeeper interface implementation.

The addition of the VaultKeeper field to the Keeper struct aligns with the PR objective of integrating Megavault into the PML system. This change expands the Keeper's capabilities to interact with vault-related operations.

To ensure the VaultKeeper interface is properly defined and implemented, run the following script:

Verification successful

VaultKeeper interface is correctly implemented and used.

The VaultKeeper interface is implemented by the Keeper struct in the x/vault/keeper package. All required methods are present:

  1. GetVaultClobOrders, RefreshAllVaultOrders, RefreshVaultClobOrders in orders.go
  2. GetDefaultQuotingParams, SetDefaultQuotingParams in params.go
  3. GetTotalShares, SetTotalShares in shares.go
  4. MintShares in deposit.go
  5. GetVaultEquity in vault.go

The NewKeeper function in keeper.go likely initializes this struct. The VaultKeeper interface is used in other modules, specifically in the x/listing and x/feetiers modules, demonstrating proper modularity and dependency management.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the VaultKeeper interface definition and implementation

# Test 1: Check for the VaultKeeper interface definition
echo "Checking VaultKeeper interface definition:"
ast-grep --lang go --pattern 'type VaultKeeper interface { $$$ }'

# Test 2: Look for the concrete implementation of VaultKeeper
echo "Checking for VaultKeeper implementation:"
rg --type go -e 'type .+ struct' -e 'func \(.+\) .+' -A 10 | rg -e 'implements .*VaultKeeper' -e '// VaultKeeper interface implementation'

Length of output: 4407


Script:

#!/bin/bash
# Description: Further verify VaultKeeper interface implementations by searching for structs that implement all required methods.

# Define the interface methods pattern based on the VaultKeeper interface definition
INTERFACE_METHODS='GetVaultClobOrders|RefreshAllVaultOrders|GetDefaultQuotingParams|SetDefaultQuotingParams|GetTotalShares|SetTotalShares|MintShares|GetVaultEquity'

echo "Searching for structs implementing all VaultKeeper interface methods:"

# Find structs that have all the methods defined in the VaultKeeper interface
fd --type file --extension go | while read -r file; do
  struct=$(ast-grep --lang go --pattern "type $_ struct { $$$ }" "$file" | awk '{print $3}')
  if [ -n "$struct" ]; then
    method_count=$(rg -A 10 "func \(${struct}\)." "$file" | rg -E "$INTERFACE_METHODS" | wc -l)
    required_methods=8  # Update this count based on the number of methods in VaultKeeper
    if [ "$method_count" -ge "$required_methods" ]; then
      echo "Struct '$struct' in file '$file' likely implements VaultKeeper."
    fi
  fi
done

echo "Searching for assignments or usages of VaultKeeper to identify implementations:"

# Search for where VaultKeeper is being assigned or used
rg --type go "var\s+\w+\s+VaultKeeper" --context 2

Length of output: 308170


Script:

#!/bin/bash
# Search for potential implementations of VaultKeeper interface

echo "Searching for potential VaultKeeper implementations:"

# Define the methods to search for (from vault/types/types.go)
METHODS=(
  "GetVaultClobOrders"
  "RefreshAllVaultOrders"
  "RefreshVaultClobOrders"
  "GetDefaultQuotingParams"
  "SetDefaultQuotingParams"
  "GetTotalShares"
  "SetTotalShares"
  "MintShares"
  "GetVaultEquity"
)

# Search for structs that implement these methods
for method in "${METHODS[@]}"; do
  echo "Searching for implementations of $method:"
  rg "func \(\w+ \*\w+\) $method\(" --type go
done

echo "Searching for structs with 'Vault' in the name that might implement VaultKeeper:"
rg "type \w*Vault\w* struct" --type go

echo "Searching for VaultKeeper variable declarations or assignments:"
rg "var\s+\w+\s+(\w+\.)?VaultKeeper" --type go
rg "\w+\s*:\s*(\w+\.)?VaultKeeper" --type go

Length of output: 6278


Script:

#!/bin/bash
# Search for potential VaultKeeper implementation in the x/vault module

echo "Searching for potential VaultKeeper implementation in x/vault module:"

# Search for keeper struct in x/vault/keeper
echo "Searching for keeper struct in x/vault/keeper:"
rg "type Keeper struct" protocol/x/vault/keeper --type go

# Search for methods that might implement VaultKeeper interface
echo "Searching for methods that might implement VaultKeeper interface:"
METHODS=(
  "GetVaultClobOrders"
  "RefreshAllVaultOrders"
  "RefreshVaultClobOrders"
  "GetDefaultQuotingParams"
  "SetDefaultQuotingParams"
  "GetTotalShares"
  "SetTotalShares"
  "MintShares"
  "GetVaultEquity"
)

for method in "${METHODS[@]}"; do
  echo "Searching for implementation of $method:"
  rg "func \(k .*Keeper\) $method\(" protocol/x/vault/keeper --type go
done

# Search for NewKeeper function
echo "Searching for NewKeeper function:"
rg "func NewKeeper\(" protocol/x/vault/keeper --type go

# Search for VaultKeeper usage in other modules
echo "Searching for VaultKeeper usage in other modules:"
rg "vaultKeeper\s+types\.VaultKeeper" protocol/x --type go

Length of output: 4005

protocol/testutil/keeper/listing.go (4)

17-17: LGTM: Vault keeper import added correctly.

The import for the vaultkeeper package has been added correctly, following the existing import structure.


188-188: LGTM: VaultKeeper integrated into createListingKeeper function.

The vaultkeeper parameter has been correctly added to the createListingKeeper function signature and is properly passed to the keeper.NewKeeper call. This change aligns with the PR objective of integrating Megavault into the PML system.

Also applies to: 208-208


17-17: Summary: VaultKeeper successfully integrated into the listing keeper initialization.

The changes in this file consistently integrate the vaultkeeper into the listing keeper initialization process:

  1. The vaultkeeper package is imported.
  2. The vaultKeeper parameter is added to the ListingKeepers function.
  3. The vaultkeeper parameter is added to the createListingKeeper function.
  4. The vaultkeeper is passed to the keeper.NewKeeper call.

These changes align with the PR objective of integrating Megavault into the PML system. The implementation appears correct and consistent throughout the file.

To ensure full compatibility, please verify that any other files or tests that use these functions have been updated accordingly.

Run the following script to check for any usage of these functions that might need updating:

Also applies to: 170-170, 188-188, 208-208

Verification successful

Verification Successful: All relevant usages of ListingKeepers and createListingKeeper have been appropriately updated.

The functions ListingKeepers and createListingKeeper are correctly utilized within the test files, ensuring that the integration of vaultkeeper into the listing keeper initialization process is consistent and does not adversely affect other parts of the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of ListingKeepers and createListingKeeper functions

# Test: Search for ListingKeepers function calls
echo "Searching for ListingKeepers function calls:"
rg --type go 'ListingKeepers\('

# Test: Search for createListingKeeper function calls
echo "Searching for createListingKeeper function calls:"
rg --type go 'createListingKeeper\('

Length of output: 913


170-170: LGTM: VaultKeeper parameter added to ListingKeepers function.

The vaultKeeper parameter has been correctly added to the ListingKeepers function, which aligns with the PR objective of integrating Megavault into the PML system.

Please ensure that the vaultKeeper is properly utilized within the function body. Run the following script to verify its usage:

protocol/x/listing/module.go (2)

116-116: LGTM. Verify usage of the updated NewAppModule function.

The changes to the NewAppModule function are correct and consistent with the addition of the vaultKeeper field to the AppModule struct.

To ensure that these changes are properly integrated, please verify that all calls to NewAppModule in the codebase have been updated to include the vaultKeeper parameter. Run the following script to check for any potential missed updates:

#!/bin/bash
# Description: Check for calls to NewAppModule that might need updating

# Search for NewAppModule calls
rg --type go "NewAppModule\s*\(" -A 10

This will help identify any locations where NewAppModule is called, allowing you to verify that they've all been updated to include the new vaultKeeper parameter.

Also applies to: 125-125


106-106: Consider architectural implications of adding VaultKeeper dependency.

The addition of vaultKeeper to the listing module introduces a new dependency. While this aligns with the PR objective, it's important to consider the architectural implications:

  1. Does this addition maintain proper separation of concerns?
  2. Are there any potential circular dependencies introduced?
  3. How does this change affect the module's responsibilities and behavior?

To address these concerns:

  1. Review the listing module's responsibilities and ensure that vault-related operations fit within its domain.
  2. Check for any circular dependencies between the listing and vault modules.
  3. Update the module's documentation to reflect its new capabilities and dependencies.
  4. Consider adding unit tests to verify the correct interaction between the listing module and the vault keeper.

Run the following script to help identify potential circular imports or unexpected dependencies:

This will help identify any unexpected dependencies between the modules that might need to be addressed.

Also applies to: 116-116, 125-125

Verification successful

VaultKeeper Dependency Verified Successfully.

The addition of vaultKeeper to the listing module does not introduce any circular dependencies between the listing and vault modules. The import checks confirmed that neither module imports the other, ensuring proper separation of concerns and maintaining architectural integrity.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential circular imports or unexpected dependencies

# Search for imports related to the vault and listing modules
echo "Checking vault-related imports in listing module:"
rg --type go "import\s+\([^)]*vault[^)]*\)" ./protocol/x/listing
echo "Checking listing-related imports in vault module:"
rg --type go "import\s+\([^)]*listing[^)]*\)" ./protocol/x/vault

Length of output: 36967


Script:

#!/bin/bash
# Description: Check for potential circular imports or unexpected dependencies

# Search for imports related to the vault and listing modules
echo "Checking vault-related imports in listing module:"
rg --type go "import\s+\([^)]*vault[^)]*\)" ./protocol/x/listing

echo "Checking listing-related imports in vault module:"
rg --type go "import\s+\([^)]*listing[^)]*\)" ./protocol/x/vault

Length of output: 351

protocol/app/testdata/default_genesis_state.json (2)

356-356: Verify the impact of setting a hard cap for markets.

The change from 0 to 500 for hard_cap_for_markets introduces a specific limit on the number of markets that can be created. This aligns with the PR objective of integrating Megavault into the PML system.

Please confirm:

  1. Is 500 markets sufficient for current and future needs?
  2. What happens when this limit is reached? Is there a graceful handling mechanism in place?
  3. Is there documentation or a process for adjusting this value in the future if needed?

357-361: Approve the addition of listing_vault_deposit_params with requests for clarification.

The addition of listing_vault_deposit_params aligns with the PR objective of integrating Megavault into the PML system. The new_vault_deposit_amount of 10000 corresponds to the minimum deposit for each market listing as mentioned in the PR summary.

However, please clarify the following:

  1. Why is main_vault_deposit_amount set to 0? Are there scenarios where this would be non-zero?
  2. The num_blocks_to_lock_shares is set to 2592000 (approximately 30 days assuming 1-second blocks). Is this the intended lock period? How was this duration determined?
  3. Are these values (especially the deposit amounts) in a specific denomination? If so, please specify the denomination in a comment.
protocol/x/clob/keeper/clob_pair.go (2)

69-71: LGTM: Improved code organization

The change to use SetClobPair instead of directly writing to the state is a good improvement. It promotes code reuse and maintainability by centralizing the logic for setting a CLOB pair in the state.


560-560: LGTM: Consistent use of renamed function

The change to use SetClobPair instead of setClobPair is consistent with the earlier modifications. This maintains the integrity of the codebase and ensures that the public function is used throughout.

protocol/app/app.go (2)

Line range hint 1-1718: Summary: VaultKeeper integration looks good.

The changes in this file are minimal and focused, adding the VaultKeeper to the ListingKeeper initialization. This aligns well with the PR objective of integrating Megavault into the PML system. No other changes appear necessary in this file for this integration.


1209-1209: LGTM. Verify VaultKeeper integration.

The addition of app.VaultKeeper to the ListingKeeper initialization is consistent with the PR objective of integrating Megavault into the PML system. This change appears correct and is consistently applied in both instances.

To ensure the integration is complete, please run the following script to check for any other places where VaultKeeper might need to be added:

Also applies to: 1218-1218

Verification successful

VaultKeeper integration verified successfully.
All instances of VaultKeeper have been appropriately integrated into the listing modules and related areas. No additional integration points were identified.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other potential places where VaultKeeper might need to be integrated.

# Search for ListingKeeper initialization or usage
rg --type go -n 'ListingKeeper.*NewKeeper|NewAppModule.*ListingKeeper'

# Search for VaultKeeper usage in listing-related files
rg --type go -n 'VaultKeeper' protocol/x/listing

Length of output: 1139

protocol/testutil/constants/genesis.go (1)

876-881: New listing parameters added

The listing section has been updated with new parameters:

  1. hard_cap_for_markets is set to 500.
  2. A new listing_vault_deposit_params structure has been added with the following fields:
    • new_vault_deposit_amount: "10000"
    • main_vault_deposit_amount: "0"
    • num_blocks_to_lock_shares: 2592000

These changes align with the PR objective of integrating Megavault into the PML system. The new_vault_deposit_amount of 10000 ensures that every market listing will deposit a minimum amount into the Megavault, providing immediate liquidity to the market.

To ensure these changes are consistent across the codebase, let's verify if these new parameters are used in other files:

Verification successful

Listing Parameters Verified Successfully

All newly added listing parameters are consistently used across the codebase, ensuring proper integration and functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of new listing parameters
echo "Searching for hard_cap_for_markets usage:"
rg "hard_cap_for_markets"

echo "\nSearching for listing_vault_deposit_params usage:"
rg "listing_vault_deposit_params"

echo "\nSearching for new_vault_deposit_amount usage:"
rg "new_vault_deposit_amount"

echo "\nSearching for main_vault_deposit_amount usage:"
rg "main_vault_deposit_amount"

echo "\nSearching for num_blocks_to_lock_shares usage:"
rg "num_blocks_to_lock_shares"

Length of output: 6015

protocol/testing/genesis.sh (1)

2261-2267: New "Listing" configuration added

A new section for "Listing" configuration has been added to the edit_genesis function. This section sets up parameters for market listings:

  1. A hard cap for markets is set to 500.
  2. Default listing vault deposit parameters are configured:
    • New vault deposit amount: 10,000 USDC
    • Main vault deposit amount: 0 USDC
    • Number of blocks to lock shares: 2,592,000 (equivalent to 30 days)

These changes appear to be implementing a new feature or adjusting existing listing mechanics. The values seem reasonable, but it's important to verify that they align with the intended design and any related documentation.

To ensure these changes are consistent with other parts of the codebase, let's check for any related configurations or usages:

Verification successful

Corrected Shell Script for Searching Listing Configurations

The previous script failed because bash is not a recognized file type in rg. Here's the corrected version that targets shell scripts:


Listing Configuration Verified Successfully

The changes to the "Listing" configuration in protocol/testing/genesis.sh have been reviewed. No additional occurrences of listing-related configurations were found in the codebase, ensuring that the updates are isolated and consistent.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of listing-related configurations
rg --type bash -i "listing|vault deposit|hard cap"

Length of output: 81


Script:

#!/bin/bash
# Search for other occurrences of listing-related configurations
rg --type sh -i "listing|vault deposit|hard cap"

Length of output: 805

protocol/x/listing/types/expected_keepers.go (2)

4-7: Appropriate imports for new interface

The added imports 'math/big' and 'vaulttypes' are necessary for the types used in the new VaultKeeper interface methods.


38-38: ⚠️ Potential issue

Clarify the necessity and distinct functionality of SetClobPair

The method SetClobPair has been added to the ClobKeeper interface. Given that the interface already includes CreateClobPair, please ensure that SetClobPair serves a distinct purpose and does not duplicate the functionality of CreateClobPair. If SetClobPair is intended to update an existing ClobPair, consider naming it accordingly for clarity.

Run the following script to verify the usage and purpose of SetClobPair and check for any potential duplication with CreateClobPair:

protocol/x/listing/keeper/msg_create_market_permissionless_test.go (3)

4-4: Importing 'math/big' is appropriate

The addition of "math/big" import is necessary for handling *big.Int types in the test cases.


27-27: Addition of 'balance' field enhances test flexibility

Including the balance *big.Int field in the test case struct allows each test to specify a custom balance, improving test coverage and flexibility.


63-94: Correctly initializing genesis state with subaccounts and balances

The custom genesis document setup initializes the vault and Alice's subaccounts with specified balances, ensuring the tests run with accurate initial conditions.

protocol/x/listing/keeper/listing.go (4)

5-11: Imports added appropriately for new functionality

The newly added imports (math/big, dtypes, vaulttypes, satypes) are necessary for the DepositToMegavaultforPML function and related operations.


111-112: Ensure ClobPair is properly persisted with SetClobPair

The addition of k.ClobKeeper.SetClobPair(ctx, clobPair) ensures that the ClobPair is stored in the state after creation, which is essential for the ClobPair to function correctly.


243-251: Verify that the correct number of shares are being locked

The LockShares function locks the total number of minted shares, which are minted based on the totalDepositAmount. However, only the NewVaultDepositAmount is allocated to the new market vault. Ensure that locking all minted shares is intended, or adjust to lock only the shares corresponding to the new vault deposit.

To confirm that the correct number of shares are being locked, check the relationship between mintedShares and the amounts deposited.

Do you need assistance in adjusting the locked shares to correspond only to the NewVaultDepositAmount? I can help generate the necessary code changes or open a GitHub issue to track this task.


258-259: Ensure correct vault status is set when activating the vault

Setting the vault status to VAULT_STATUS_QUOTING activates it for quoting. Confirm that this is the intended status at this point in the workflow.

protocol/x/vault/keeper/vault.go (1)

324-325: Avoid dereferencing a pointer without checking for nil

When accessing '*vaultId.ToSubaccountId()', ensure that 'ToSubaccountId()' does not return a nil pointer to prevent potential runtime panics.

Verify that 'vaultId.ToSubaccountId()' never returns nil:

protocol/x/listing/keeper/listing_test.go (2)

393-395: Use Consistent Subaccount Numbering

In the subaccount ID, the Number field is set to 0. Ensure that this numbering is consistent with other tests and the expected default subaccount for the user. If there are multiple subaccounts, specifying the correct one is crucial for accurate testing.


346-382: Verify Genesis State Initialization for All Required Modules

The custom genesis state initialization might be missing configurations for modules that could impact the test outcomes. Ensure that all necessary modules, such as assets, vault, and any others involved in the test, are properly initialized with their default or required states.

Run the following script to list all initialized modules and verify their states:

Comment on lines +17 to +19
if err := k.SetListingVaultDepositParams(ctx, genState.ListingVaultDepositParams); err != nil {
panic(err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

ExportGenesis Function Missing ListingVaultDepositParams

The ExportGenesis function does not include ListingVaultDepositParams, which prevents the export of the newly set parameters.

Action Required:

  • Update the ExportGenesis function to include ListingVaultDepositParams in the returned genesis state.

Example update:

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
	genesis := types.DefaultGenesis()
	genesis.HardCapForMarkets = k.GetMarketsHardCap(ctx)
	genesis.ListingVaultDepositParams = k.GetListingVaultDepositParams(ctx)
	return genesis
}
Analysis chain

LGTM with suggestions for improvement

The addition of SetListingVaultDepositParams aligns well with the PR objectives of integrating Megavault into PML. The error handling is consistent with the existing pattern in the function.

Suggestions for improvement:

  1. Consider adding a comment explaining the purpose of setting the listing vault deposit parameters.
  2. Update the ExportGenesis function to include the new ListingVaultDepositParams in the returned genesis state.

Consider updating the ExportGenesis function as follows:

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
    genesis := types.DefaultGenesis()
    genesis.HardCapForMarkets = k.GetMarketsHardCap(ctx)
    genesis.ListingVaultDepositParams = k.GetListingVaultDepositParams(ctx)
    return genesis
}

To ensure the correctness and completeness of the implementation, please run the following verification:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the implementation of ListingVaultDepositParams and related functions

# Check if ListingVaultDepositParams is defined in GenesisState
echo "Checking GenesisState definition:"
rg --type go "type GenesisState struct" -A 20 protocol/x/listing/types

# Verify the implementation of SetListingVaultDepositParams in the keeper
echo "\nChecking SetListingVaultDepositParams implementation:"
rg --type go "func \(k Keeper\) SetListingVaultDepositParams" -A 10 protocol/x/listing/keeper

# Check for the existence of GetListingVaultDepositParams in the keeper
echo "\nChecking for GetListingVaultDepositParams:"
rg --type go "func \(k Keeper\) GetListingVaultDepositParams" -A 10 protocol/x/listing/keeper

Length of output: 3965


Script:

#!/bin/bash
# Verify that ExportGenesis includes ListingVaultDepositParams

echo "Checking ExportGenesis function implementation:"
rg --type go "func ExportGenesis" -A 15 protocol/x/listing/genesis.go

Length of output: 304

Comment on lines +41 to +45
err = k.Keeper.DepositToMegavaultforPML(ctx, *msg.SubaccountId, clobPairId)
if err != nil {
k.Logger(ctx).Error("failed to deposit to megavault for PML market", "error", err)
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

New Megavault deposit functionality looks good, with minor suggestions

The addition of the DepositToMegavaultforPML function call aligns well with the PR objective of integrating Megavault into the PML system. The error handling is consistent with the existing code style.

However, there are a few points to address:

  1. Typo in Function Name: The function name DepositToMegavaultforPML contains a typo. It should be renamed to DepositToMegavaultForPML to follow Go naming conventions.
  2. TODO Comment: The TODO comment // TODO: vault deposit for PML suggests that there might be additional work or considerations needed for this implementation. Should this be addressed before merging?
- err = k.Keeper.DepositToMegavaultforPML(ctx, *msg.SubaccountId, clobPairId)
+ err = k.Keeper.DepositToMegavaultForPML(ctx, *msg.SubaccountId, clobPairId)
Analysis chain

New Megavault deposit functionality looks good, with minor suggestions

The addition of the DepositToMegavaultforPML function call aligns well with the PR objective of integrating Megavault into the PML system. The error handling is consistent with the existing code style.

However, there are a few points to address:

  1. There's a typo in the function name: "forPML" should be "ForPML" to follow Go naming conventions.
  2. The TODO comment above the new code suggests that this implementation might be temporary or needs further refinement. Should this be addressed before merging?

Fix the typo in the function name:

- err = k.Keeper.DepositToMegavaultforPML(ctx, *msg.SubaccountId, clobPairId)
+ err = k.Keeper.DepositToMegavaultForPML(ctx, *msg.SubaccountId, clobPairId)

Let's verify the existence and implementation of the DepositToMegavaultforPML function:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of DepositToMegavaultforPML function

# Test: Search for the function definition
rg --type go -A 10 'func \(k .*Keeper\) DepositToMegavault(for|For)PML'

Length of output: 776


Script:

#!/bin/bash
# Description: Check for TODO comments in msg_create_market_permissionless.go

rg 'TODO' protocol/x/listing/keeper/msg_create_market_permissionless.go

Length of output: 103

@@ -31,6 +32,7 @@ func NewKeeper(
clobKeeper types.ClobKeeper,
marketMapKeeper types.MarketMapKeeper,
perpetualsKeeper types.PerpetualsKeeper,
vaultKeeper types.VaultKeeper,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Additional NewKeeper Instances Missing vaultKeeper Parameter

The verification revealed that only the protocol/x/listing/keeper/keeper.go file has been updated to include the vaultKeeper parameter in the NewKeeper function. Other modules still invoke NewKeeper without this parameter, which may lead to inconsistencies or runtime issues.

Modules to Address:

  • protocol/x/vest/keeper/keeper.go
  • protocol/x/clob/keeper/keeper.go
  • protocol/x/vault/keeper/keeper.go
  • protocol/x/subaccounts/keeper/keeper.go
  • ... (and others as listed in the script output)
Analysis chain

LGTM. Verify NewKeeper usage across the codebase.

The changes to the NewKeeper function are consistent with the addition of the VaultKeeper field to the Keeper struct. The new parameter allows for proper dependency injection, which is good for modularity and testability.

To ensure that all calls to NewKeeper have been updated to include the vaultKeeper parameter, run the following script:

Please review the output to confirm that all NewKeeper calls have been updated correctly.

Also applies to: 45-45

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to NewKeeper include the vaultKeeper parameter

echo "Checking NewKeeper function calls:"
rg --type go -e 'NewKeeper\s*\(' -A 10

Length of output: 47020

Comment on lines 29 to 30
err := k.Keeper.AllocateToVault(ctx, msg.VaultId, msg.QuoteQuantums.BigInt())
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Enhance error handling by wrapping the error with additional context

Currently, if k.Keeper.AllocateToVault returns an error, it is returned directly. Wrapping the error with additional context can improve debuggability by providing more information about the failure.

Consider modifying the error handling as follows:

 if err != nil {
-    return nil, err
+    return nil, errorsmod.Wrapf(err, "failed to allocate to vault %s", msg.VaultId)
 }

Committable suggestion was skipped due to low confidence.


💡 Codebase verification

AllocateToVault method in Keeper is missing necessary validations

  • The AllocateToVault method in Keeper does not include the required validations such as:
    • Validating the existence of the vault.
    • Initializing vault parameters if they are not set.
    • Handling specific business logic related to vault allocation.
Analysis chain

Ensure AllocateToVault includes all necessary validations

The previous inline validations and operations have been replaced with a call to k.Keeper.AllocateToVault. It's important to verify that this method internally performs all the required checks, such as:

  • Validating the existence of the vault.
  • Initializing vault parameters if they are not set.
  • Handling any specific business logic related to vault allocation.

Run the following script to confirm that AllocateToVault includes the necessary validations:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that AllocateToVault method includes necessary validations.

# Search for the implementation of AllocateToVault in the Keeper.
rg --type go -A 20 'func \(k Keeper\) AllocateToVault\(ctx'

# Expected: The method should contain validations for vault existence and initialization.

Length of output: 61


Script:

#!/bin/bash
# Description: Locate the AllocateToVault method within the Keeper using ast-grep.

# Search for the AllocateToVault method in the Keeper with any parameters.
ast-grep --lang go --pattern 'func (k Keeper) AllocateToVault($_)' .

Length of output: 70


Script:

#!/bin/bash
# Description: Search the entire Go codebase for the AllocateToVault method.

rg --type go 'AllocateToVault'

Length of output: 11699

Comment on lines 68 to 90
type VaultKeeper interface {
DepositToMegavault(
ctx sdk.Context,
fromSubaccount satypes.SubaccountId,
quoteQuantums *big.Int,
) (mintedShares *big.Int, err error)
AllocateToVault(
ctx sdk.Context,
vaultId vaulttypes.VaultId,
quantums *big.Int,
) error
LockShares(
ctx sdk.Context,
ownerAddress string,
sharesToLock vaulttypes.NumShares,
tilBlock uint32,
) error
SetVaultParams(
ctx sdk.Context,
vaultId vaulttypes.VaultId,
vaultParams vaulttypes.VaultParams,
) error
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve parameter naming for clarity and consistency

In the VaultKeeper interface methods, consider the following suggestions:

  • Rename tilBlock to untilBlock in the LockShares method for better readability and to avoid ambiguity.

  • Standardize quantity parameter names: Both quoteQuantums in DepositToMegavault and quantums in AllocateToVault represent amounts of quantums. If they refer to the same type of quantity, consider using a consistent parameter name for clarity.

  • Ensure consistent address parameter naming: The methods use fromSubaccount and ownerAddress to refer to subaccount identifiers or owner addresses. To improve consistency, consider standardizing these parameter names, such as using ownerSubaccount or ownerSubaccountId.

Comment on lines +209 to +211
// Get the listing vault deposit params
vaultDepositParams := k.GetListingVaultDepositParams(ctx)

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Handle potential errors when retrieving vault deposit parameters

The function retrieves the vault deposit parameters without handling the case where they might be unset or invalid. If GetListingVaultDepositParams fails to retrieve valid parameters, it could lead to a panic or unintended behavior.

Consider adding error handling to ensure that vaultDepositParams are valid:

vaultDepositParams := k.GetListingVaultDepositParams(ctx)
if vaultDepositParams == nil {
    return errors.New("vault deposit parameters are not set")
}

Or handle the case appropriately based on how GetListingVaultDepositParams behaves when parameters are missing.

Comment on lines +247 to +248
uint32(ctx.BlockHeight())+vaultDepositParams.NumBlocksToLockShares,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Potential integer overflow when converting block height to uint32

Casting ctx.BlockHeight() from int64 to uint32 may cause an integer overflow if the block height exceeds the maximum value of a uint32. This could lead to incorrect share lock expiration times.

Consider using uint64 for the lock expiration calculation to prevent overflow:

-        uint32(ctx.BlockHeight()) + vaultDepositParams.NumBlocksToLockShares,
+        uint64(ctx.BlockHeight()) + uint64(vaultDepositParams.NumBlocksToLockShares),

And ensure that the LockShares method accepts a uint64 parameter for the lock expiration block height.

Committable suggestion was skipped due to low confidence.

Comment on lines 293 to 294
quantums *big.Int,
) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Validate 'quantums' is positive and within 'uint64' range

Although the comment mentions that 'quantums' is validated to be positive above, there is no actual validation in the code to ensure 'quantums' is positive and does not exceed the 'uint64' range. This could lead to unexpected behavior or runtime errors when calling 'quantums.Uint64()'.

To fix this issue, add validation for 'quantums' before proceeding with the transfer:

// Validate that 'quantums' is positive
if quantums.Sign() <= 0 {
    return errorsmod.Wrap(types.ErrInvalidAmount, "quantums must be positive")
}

// Ensure 'quantums' does not exceed 'uint64' max value
if !quantums.IsUint64() {
    return errorsmod.Wrap(types.ErrInvalidAmount, "quantums exceeds uint64 max value")
}

protocol/x/listing/keeper/listing_test.go Outdated Show resolved Hide resolved
},
"failure - insufficient balance": {
address: constants.AliceAccAddress.String(),
balance: big.NewInt(0),
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid Zero Balance in Initialization for Insufficient Balance Test

In the "failure - insufficient balance" test case, the balance is set to big.NewInt(0). If the balance is zero, the user might not have an open position at all. Consider setting a minimal positive balance that is less than the required deposit amount to simulate insufficient funds more realistically.

Apply this diff to adjust the balance:

-	balance:    big.NewInt(0),
+	balance:    big.NewInt(10_000), // Less than required deposit amount
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
balance: big.NewInt(0),
balance: big.NewInt(10_000), // Less than required deposit amount

Signed-off-by: Shrenuj Bansal <[email protected]>
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 and nitpick comments (1)
proto/dydxprotocol/listing/genesis.proto (1)

15-17: LGTM: New field correctly added for PML Megavault integration.

The new listing_vault_deposit_params field is appropriately added to the GenesisState message, aligning with the PR objective of integrating Megavault into the PML system. The use of gogoproto.nullable = false ensures this field must always be present.

Consider expanding the comment to provide more context:

-  // listing_vault_deposit_params is the params for PML megavault deposits
+  // listing_vault_deposit_params defines the parameters for Protocol Market Liquidity (PML) Megavault deposits
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d40ab11 and e1d0d6c.

Files selected for processing (5)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/genesis.ts (6 hunks)
  • proto/dydxprotocol/listing/genesis.proto (1 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
  • protocol/x/listing/keeper/listing.go (3 hunks)
  • protocol/x/listing/keeper/listing_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • protocol/x/listing/keeper/listing.go
  • protocol/x/listing/keeper/listing_test.go
Additional context used
buf
proto/dydxprotocol/listing/genesis.proto

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)

Additional comments not posted (11)
proto/dydxprotocol/listing/genesis.proto (2)

1-18: LGTM: File structure and consistency maintained.

The changes to this protobuf file are minimal and focused on adding the new field for Megavault integration. The overall file structure remains consistent with protobuf best practices, and existing definitions are preserved.

Tools
buf

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)


4-5: LGTM: New imports are appropriate for the changes.

The new import statements are correctly added to support the new field and gogo/protobuf extensions.

Regarding the static analysis warning about "gogoproto/gogo.proto" not existing, this is likely a false positive. However, let's verify the gogo/protobuf setup:

Tools
buf

4-4: import "gogoproto/gogo.proto": file does not exist

(COMPILE)

protocol/scripts/genesis/sample_pregenesis.json (2)

873-877: New vault deposit parameters added for listings.

A new listing_vault_deposit_params object has been introduced with the following parameters:

  1. main_vault_deposit_amount: "0"
  2. new_vault_deposit_amount: "10000"
  3. num_blocks_to_lock_shares: 2592000

These parameters align with the PR objective of integrating Megavault into the PML system. They define the deposit amounts for main and new vaults, as well as the number of blocks to lock shares.

To ensure these new parameters are properly utilized, please run the following script to check for their usage in the codebase:

#!/bin/bash
# Search for usage of new vault deposit parameters
rg --type go --type rust "main_vault_deposit_amount|new_vault_deposit_amount|num_blocks_to_lock_shares"

872-872: Verify the impact of increasing the hard cap for markets.

The hard_cap_for_markets value has been increased from 0 to 500. This change allows for a maximum of 500 markets to be listed.

Please run the following script to check if there are any hardcoded limits elsewhere in the codebase that might conflict with this new value:

Verification successful

Verified: Increasing hard_cap_for_markets to 500 does not conflict with any existing hardcoded limits.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potential hardcoded market limits
rg --type go --type rust "(?i)(max.*markets|market.*limit|num.*markets)"

Length of output: 1206

indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/genesis.ts (7)

1-1: Import ListingVaultDepositParams Correctly

The import statement correctly adds ListingVaultDepositParams and ListingVaultDepositParamsSDKType from "./params", which is necessary for integrating the Megavault deposit parameters into the GenesisState.


12-14: Add listingVaultDepositParams to GenesisState Interface

The listingVaultDepositParams property is appropriately added to the GenesisState interface to include the PML Megavault deposit parameters, aligning with the integration objectives.


24-26: Add listing_vault_deposit_params to GenesisStateSDKType Interface

The listing_vault_deposit_params property is correctly added to the GenesisStateSDKType interface, ensuring consistency between the SDK types and the main interface.


31-32: Initialize listingVaultDepositParams in createBaseGenesisState

Properly initializing listingVaultDepositParams to undefined in createBaseGenesisState ensures that the default genesis state is accurately represented.


42-45: Handle Encoding of listingVaultDepositParams

The encode function correctly includes logic to serialize listingVaultDepositParams when it is defined, which is essential for proper data transmission.


62-65: Handle Decoding of listingVaultDepositParams

The decode function is appropriately updated to deserialize listingVaultDepositParams, ensuring that the genesis state is reconstructed accurately from the encoded data.


78-78: Update fromPartial to Include listingVaultDepositParams

The fromPartial function correctly handles listingVaultDepositParams, allowing for the creation of GenesisState instances from partial data, which enhances flexibility in state management.

Signed-off-by: Shrenuj Bansal <[email protected]>
@shrenujb shrenujb added the pml permissionless market listing label Sep 24, 2024
protocol/x/listing/keeper/listing.go Show resolved Hide resolved
protocol/x/listing/keeper/listing.go Outdated Show resolved Hide resolved
protocol/x/listing/keeper/listing_test.go Show resolved Hide resolved
protocol/x/listing/keeper/listing.go Outdated Show resolved Hide resolved
Signed-off-by: Shrenuj Bansal <[email protected]>
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: 1

🧹 Outside diff range and nitpick comments (1)
protocol/x/listing/types/params.go (1)

Line range hint 14-27: Consider enhancing validation logic for the increased deposit amount.

While the current Validate function still applies to the new deposit amount, given the significant increase, consider adding more specific validation:

  1. Add an upper bound check for NewVaultDepositAmount to prevent potential errors or overflow issues.
  2. Consider validating that NewVaultDepositAmount is greater than or equal to MainVaultDepositAmount, if that's an invariant that should be maintained.

Here's a suggested enhancement to the Validate function:

func (p ListingVaultDepositParams) Validate() error {
	// Check for negative values
	if p.NewVaultDepositAmount.Sign() <= 0 || p.MainVaultDepositAmount.Sign() < 0 {
		return ErrInvalidDepositAmount
	}

	// Add an upper bound check (adjust the max value as needed)
	maxDepositAmount := dtypes.NewIntFromUint64(100_000_000_000) // 100 billion USDC
	if p.NewVaultDepositAmount.GT(maxDepositAmount) {
		return fmt.Errorf("NewVaultDepositAmount exceeds maximum allowed value")
	}

	// Ensure NewVaultDepositAmount is greater than or equal to MainVaultDepositAmount
	if p.NewVaultDepositAmount.LT(p.MainVaultDepositAmount) {
		return fmt.Errorf("NewVaultDepositAmount must be greater than or equal to MainVaultDepositAmount")
	}

	// Check number of blocks to lock shares
	if p.NumBlocksToLockShares <= 0 {
		return ErrInvalidNumBlocksToLockShares
	}

	return nil
}

Please adjust the maxDepositAmount and other checks according to your specific requirements and constraints.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a2bcb7b and 68f7397.

📒 Files selected for processing (7)
  • protocol/app/testdata/default_genesis_state.json (1 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
  • protocol/testing/genesis.sh (1 hunks)
  • protocol/testutil/constants/genesis.go (1 hunks)
  • protocol/x/listing/keeper/listing.go (3 hunks)
  • protocol/x/listing/keeper/msg_create_market_permissionless.go (1 hunks)
  • protocol/x/listing/types/params.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • protocol/app/testdata/default_genesis_state.json
  • protocol/scripts/genesis/sample_pregenesis.json
  • protocol/testing/genesis.sh
  • protocol/testutil/constants/genesis.go
  • protocol/x/listing/keeper/listing.go
  • protocol/x/listing/keeper/msg_create_market_permissionless.go

@@ -5,7 +5,7 @@ import "github.com/dydxprotocol/v4-chain/protocol/dtypes"
// DefaultParams defines the default parameters for listing vault deposits.
func DefaultParams() ListingVaultDepositParams {
return ListingVaultDepositParams{
NewVaultDepositAmount: dtypes.NewIntFromUint64(10_000),
NewVaultDepositAmount: dtypes.NewIntFromUint64(10_000_000_000), // 10_000 USDC
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

Outdated NewVaultDepositAmount values found in test files.

The NewVaultDepositAmount has been updated to 10_000_000_000 in protocol/x/listing/types/params.go, but the following test files still reference the old value 10_000:

  • protocol/x/listing/keeper/msg_set_listing_vault_deposit_params_test.go (4 occurrences)

Actions Required:

  • Update the test cases to use 10_000_000_000 instead of 10_000 to ensure consistency with the updated parameter.
  • Review the test logic to confirm that the increased deposit amount is handled correctly and that tests accurately reflect the intended behavior.
🔗 Analysis chain

Significant increase in NewVaultDepositAmount requires careful consideration and documentation update.

The NewVaultDepositAmount has been increased from 10,000 to 10,000,000,000, which is a 1,000,000x increase. This change has several implications:

  1. The significant increase could have major impacts on the system's economics and user behavior. Please ensure this aligns with the intended design and has been thoroughly analyzed for potential side effects.

  2. The comment "10_000 USDC" is now incorrect and should be updated to "10_000_000_000 USDC" for accuracy.

  3. Given the magnitude of this change, it would be beneficial to add a brief comment explaining the rationale behind this significant increase, either in the code or in the PR description.

Please update the comment to reflect the new amount:

-		NewVaultDepositAmount:  dtypes.NewIntFromUint64(10_000_000_000), // 10_000 USDC
+		NewVaultDepositAmount:  dtypes.NewIntFromUint64(10_000_000_000), // 10_000_000_000 USDC

To ensure this change is consistent across the codebase, please run the following command:

This will help identify any other places where the old value might still be used or referenced.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of NewVaultDepositAmount to ensure consistency
rg --type go "NewVaultDepositAmount.*10_000" .

Length of output: 707

Signed-off-by: Shrenuj Bansal <[email protected]>
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 and nitpick comments (1)
protocol/x/vault/keeper/params.go (1)

120-132: LGTM with suggestions for improvement

The SetVaultStatus method is well-implemented and integrates nicely with existing code. However, consider the following improvements:

  1. Add validation for the status parameter to ensure only valid statuses are set.
  2. Consider handling side effects of status changes, such as canceling orders for deactivated vaults (similar to what's done in SetVaultParams).
  3. Add a comment explaining the method's purpose and any important considerations.

Here's a suggested implementation incorporating these improvements:

// SetVaultStatus updates the status of a vault's parameters.
// It handles side effects of status changes, such as canceling orders for deactivated vaults.
func (k Keeper) SetVaultStatus(
	ctx sdk.Context,
	vaultId types.VaultId,
	status types.VaultStatus,
) error {
	if err := status.Validate(); err != nil {
		return err
	}

	vaultParams, exists := k.GetVaultParams(ctx, vaultId)
	if !exists {
		return types.ErrVaultParamsNotFound
	}

	if status == types.VaultStatus_VAULT_STATUS_DEACTIVATED ||
		status == types.VaultStatus_VAULT_STATUS_STAND_BY {
		// Handle side effects (e.g., cancel existing orders)
		if err := k.handleVaultDeactivation(ctx, vaultId); err != nil {
			return err
		}
	}

	vaultParams.Status = status
	return k.SetVaultParams(ctx, vaultId, vaultParams)
}

func (k Keeper) handleVaultDeactivation(ctx sdk.Context, vaultId types.VaultId) error {
	// Implementation for handling side effects
	// (e.g., canceling orders, similar to what's in SetVaultParams)
	return nil
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 68f7397 and 2e94210.

📒 Files selected for processing (5)
  • protocol/x/clob/keeper/clob_pair.go (4 hunks)
  • protocol/x/listing/keeper/listing.go (3 hunks)
  • protocol/x/listing/keeper/listing_test.go (3 hunks)
  • protocol/x/listing/types/expected_keepers.go (3 hunks)
  • protocol/x/vault/keeper/params.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • protocol/x/clob/keeper/clob_pair.go
  • protocol/x/listing/keeper/listing.go
  • protocol/x/listing/keeper/listing_test.go
  • protocol/x/listing/types/expected_keepers.go

@shrenujb shrenujb merged commit 0760d3e into main Sep 25, 2024
39 checks passed
@shrenujb shrenujb deleted the tra617 branch September 25, 2024 19:58
@shrenujb
Copy link
Contributor Author

@Mergifyio backport release/protocol/v7.x

Copy link
Contributor

mergify bot commented Sep 26, 2024

backport release/protocol/v7.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 26, 2024
Signed-off-by: Shrenuj Bansal <[email protected]>
(cherry picked from commit 0760d3e)
shrenujb added a commit that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indexer pml permissionless market listing proto protocol
Development

Successfully merging this pull request may close these issues.

3 participants