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

OTE-558 Add scaffolding for module #1941

Merged
merged 9 commits into from
Jul 23, 2024
Merged

OTE-558 Add scaffolding for module #1941

merged 9 commits into from
Jul 23, 2024

Conversation

jerryfan01234
Copy link
Contributor

@jerryfan01234 jerryfan01234 commented Jul 18, 2024

Changelist

[Describe or list the changes made in this PR]

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.

Summary by CodeRabbit

  • New Features

    • Introduced the AccountPlus module, enhancing account management with new functionalities.
    • Added the InitializeAccount function for initializing account states.
    • Enhanced data integrity by ensuring certain fields in the AccountState and GenesisState are non-nullable.
  • Bug Fixes

    • Improved error handling in account state retrieval processes.
  • Tests

    • Implemented extensive test cases for the InitializeAccount function, ensuring robust validation of account management.
  • Chores

    • Established groundwork for future development with placeholder functions and tests related to timestamp nonces.

Copy link

linear bot commented Jul 18, 2024

Copy link
Contributor

coderabbitai bot commented Jul 18, 2024

Walkthrough

The changes introduce the AccountPlus module into the application, significantly enhancing account management capabilities. Key updates include the initialization of the AccountPlusKeeper, improvements in genesis state handling, and the creation of utility functions for account state management. Comprehensive unit tests ensure the reliability of this integration while maintaining distinct key prefixes for seamless coexistence with existing modules.

Changes

Files/Directories Change Summary
protocol/app/app.go Integrated the AccountPlus module into the application, updating the App struct and initialization process.
protocol/x/accountplus/genesis.go, protocol/x/accountplus/genesis_test.go Modified the ExportGenesis function to return a pointer to *types.GenesisState, enhanced error handling, and updated tests for validating genesis state exports.
protocol/x/accountplus/keeper/keeper.go, protocol/x/accountplus/keeper/keeper_test.go, protocol/x/accountplus/keeper/timestampnonce.go, protocol/x/accountplus/keeper/timestampnonce_test.go Introduced functions for managing account states and timestamp nonces, including methods for initialization and retrieval. Added unit tests for account initialization logic.
proto/dydxprotocol/accountplus/accountplus.proto, proto/dydxprotocol/accountplus/genesis.proto Enhanced data integrity by making fields non-nullable in AccountState and GenesisState messages, ensuring that required fields are always present.
protocol/x/accountplus/module.go Defined AppModule and AppModuleBasic structs with methods for module initialization and genesis handling.
protocol/x/accountplus/types/codec.go, protocol/x/accountplus/types/keys.go Established codec registration functions and renamed the module from "accountplus" to "dydxaccountplus" to prevent key prefix conflicts.
protocol/app/upgrades/v6.0.0/constants.go, protocol/app/upgrades/v6.0.0/upgrade.go Introduced functions to initialize the accountplus module during upgrades, incorporating the AccountPlusKeeper into the upgrade process.

Poem

In the land of code, new changes gleam,
AccountPlus adds to our shared dream.
Keeper's touch with states so bright,
Nonces track time with all their might.
Tests bring joy, ensuring right,
A dawn of accounts, shining light.
Hooray for progress, near and far,
In the development world, we are the star! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

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

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
protocol/x/accountplus/types/keys.go (1)

5-7: Update all references to the module name

The module name dydxaccountplus has not been consistently updated across the codebase. The following references to the old module name accountplus need to be updated:

  • Package declarations:

    • protocol/x/accountplus/module.go
    • protocol/x/accountplus/genesis.go
    • protocol/x/accountplus/genesis_test.go
  • Import paths:

    • protocol/x/accountplus/testutils/testutils_test.go
    • protocol/x/accountplus/testutils/testutils.go
    • protocol/x/accountplus/module.go
    • protocol/x/accountplus/genesis.go
    • protocol/x/accountplus/genesis_test.go
    • protocol/x/accountplus/keeper/keeper.go
    • protocol/x/accountplus/keeper/timestampnonce_test.go
    • protocol/x/accountplus/keeper/timestampnonce.go
    • protocol/x/accountplus/keeper/keeper_test.go
    • protocol/testutil/keeper/accountplus.go
    • protocol/app/app_test.go
    • protocol/app/app.go
  • Usage within the code:

    • protocol/x/accountplus/genesis_test.go
    • protocol/x/accountplus/keeper/keeper_test.go
    • protocol/x/accountplus/types/genesis.pb.go
    • protocol/x/accountplus/types/accountplus.pb.go

Please update these references to ensure consistency with the new module name dydxaccountplus.

Analysis chain

LGTM! But verify the module name usage in the codebase.

The change to ModuleName is approved.

However, ensure that all references to the module name are updated to dydxaccountplus.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the module name are updated to `dydxaccountplus`.

# Test: Search for the old module name. Expect: No occurrences of the old module name.
rg --type go 'accountplus'

Length of output: 5085


Script:

#!/bin/bash
# Description: Verify all references to the module name are updated to `dydxaccountplus`.

# Test: Search for the old module name in package declarations, imports, and usage within the code.
rg --type go 'package accountplus' -A 1
rg --type go '"github.com/dydxprotocol/v4-chain/protocol/x/accountplus' -A 1
rg --type go 'accountplus\.' -A 1

Length of output: 5176

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 41420ff and b1fc924.

Files selected for processing (15)
  • protocol/app/app.go (9 hunks)
  • protocol/app/app_test.go (4 hunks)
  • protocol/app/testdata/default_genesis_state.json (1 hunks)
  • protocol/x/accountplus/genesis.go (1 hunks)
  • protocol/x/accountplus/genesis_test.go (2 hunks)
  • protocol/x/accountplus/keeper/keeper.go (2 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
  • protocol/x/accountplus/module.go (1 hunks)
  • protocol/x/accountplus/testutils/testutils.go (1 hunks)
  • protocol/x/accountplus/testutils/testutils_test.go (1 hunks)
  • protocol/x/accountplus/types/codec.go (1 hunks)
  • protocol/x/accountplus/types/genesis.go (1 hunks)
  • protocol/x/accountplus/types/keys.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • protocol/x/accountplus/types/codec.go
Additional comments not posted (58)
protocol/x/accountplus/types/genesis.go (1)

1-12: LGTM!

The new file and its functions are approved.

protocol/x/accountplus/genesis.go (1)

16-17: LGTM! But verify the function usage in the codebase.

The change to the return type of ExportGenesis is approved.

However, ensure that all references to ExportGenesis are updated to handle the new return type.

protocol/x/accountplus/keeper/timestampnonce_test.go (1)

1-24: LGTM!

The new file and its test function are approved.

protocol/x/accountplus/keeper/timestampnonce.go (2)

7-14: LGTM! Constants and initial struct are correct.

The constants and the initial struct InitialTimestampNonceDetails are well-defined.


16-30: LGTM! Deep copy function is correctly implemented.

The function DeepCopyTimestampNonceDetails correctly handles nil input and performs a deep copy of the struct.

protocol/x/accountplus/testutils/testutils.go (3)

8-21: LGTM! Comparison function is correctly implemented.

The function CompareTimestampNonceDetails correctly compares the fields of the structs.


23-35: LGTM! Comparison function is correctly implemented.

The function CompareAccountStates correctly compares the fields of the structs and uses CompareTimestampNonceDetails for nested comparison.


38-51: LGTM! Comparison function is correctly implemented.

The function CompareAccountStateLists correctly compares the lengths of the lists and uses CompareAccountStates for element-wise comparison.

protocol/x/accountplus/keeper/keeper_test.go (1)

17-59: LGTM! Test function is correctly implemented.

The function TestInitializeAccount correctly sets up the test environment, initializes the genesis state, and tests both existing and new account initialization.

protocol/x/accountplus/keeper/keeper.go (2)

66-83: LGTM! Account initialization function is correctly implemented.

The function InitializeAccount correctly handles the initialization logic and error handling for existing states.


85-98: LGTM! Account state retrieval function is correctly implemented.

The function getAccountState correctly retrieves and unmarshals the account state.

protocol/x/accountplus/genesis_test.go (7)

21-23: Good practice: Ensure deterministic tests.

The addition of the expectedAccountStates field and the comments explaining the ordering logic help in making the tests deterministic. This is a good practice for reliable testing.


86-88: Nice integration with testapp.

The use of testapp.NewTestAppBuilder to initialize the test application is a good approach for setting up the test environment.


94-94: Good use of utility function for comparison.

The use of testutils.CompareAccountStateLists for comparing account states ensures that the comparison logic is centralized and reusable.


100-103: Direct comparison of genesis states.

The direct comparison of actualGenesisState and expectedGenesisState using requireGenesisStatesEqual simplifies the test logic and ensures accuracy.


108-117: Centralized comparison logic.

The use of testutils.CompareAccountStateLists for comparing keeper account states with genesis account states is a good practice for maintaining consistency and reusability.


121-123: Direct comparison of genesis states.

The use of testutils.CompareAccountStateLists for comparing actualGenesisState and expectedGenesisState ensures that the comparison logic is centralized and reusable.


43-50: Ensure consistency in account state initialization.

The initialization of expectedAccountStates should match the order and details of genesisState.Accounts to avoid any confusion or errors.

Verification successful

Ensure consistency in account state initialization.

The initialization of expectedAccountStates matches the order and details of genesisState.Accounts as intended. The comments in the code also emphasize maintaining this order to avoid confusion or errors.

  • protocol/x/accountplus/genesis_test.go: Initialization and order of expectedAccountStates and genesisState.Accounts are consistent.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the initialization of `expectedAccountStates` matches `genesisState.Accounts`.

# Test: Check for consistency in the order and details of account states.
rg --type go -A 10 $'expectedAccountStates' | grep -B 10 'genesisState.Accounts'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify that the initialization of `expectedAccountStates` matches `genesisState.Accounts`.

# Find the initialization of `expectedAccountStates`
rg --type go 'expectedAccountStates' -A 10

# Find the initialization of `genesisState.Accounts`
rg --type go 'genesisState.Accounts' -A 10

Length of output: 7884

protocol/x/accountplus/testutils/testutils_test.go (10)

15-19: Comprehensive test case for identical details.

The test case for identical TimestampNonceDetails ensures that the comparison function correctly identifies equal details.


21-24: Test case for different TimestampNonces.

The test case for different TimestampNonces ensures that the comparison function correctly identifies differences in TimestampNonces.


26-29: Test case for different MaxEjectedNonce.

The test case for different MaxEjectedNonce ensures that the comparison function correctly identifies differences in MaxEjectedNonce.


31-34: Test case for different TimestampNonces and MaxEjectedNonce.

The test case for different TimestampNonces and MaxEjectedNonce ensures that the comparison function correctly identifies differences in both fields.


36-37: Test case for empty details.

The test case for empty TimestampNonceDetails ensures that the comparison function correctly identifies differences when one of the details is empty.


62-67: Comprehensive test case for identical states.

The test case for identical AccountStates ensures that the comparison function correctly identifies equal states.


70-75: Test case for different addresses.

The test case for different addresses ensures that the comparison function correctly identifies differences in addresses.


78-83: Test case for different TimestampNonceDetails.

The test case for different TimestampNonceDetails ensures that the comparison function correctly identifies differences in TimestampNonceDetails.


102-108: Comprehensive test case for identical lists.

The test case for identical lists of AccountStates ensures that the comparison function correctly identifies equal lists.


119-125: Test case for lists with different TimestampNonceDetails.

The test case for lists with different TimestampNonceDetails ensures that the comparison function correctly identifies differences in the lists.

protocol/x/accountplus/module.go (19)

37-41: Well-defined AppModuleBasic structure.

The AppModuleBasic structure is well-defined and implements the necessary basic functionalities for the module.


43-45: Constructor for AppModuleBasic.

The constructor function NewAppModuleBasic correctly initializes the AppModuleBasic structure with the provided codec.


47-50: Module name function.

The Name function correctly returns the module name.


52-56: Amino codec registration.

The RegisterLegacyAminoCodec function correctly registers the amino codec for the module.


58-61: Interface registration.

The RegisterInterfaces function correctly registers the module's interface types and their concrete implementations.


63-64: GRPC Gateway routes registration.

The RegisterGRPCGatewayRoutes function is currently empty, which is acceptable if the module does not support gRPC queries.


66-70: Transaction command function.

The GetTxCmd function correctly returns nil if the module does not support user-submitted transactions.


73-77: Query command function.

The GetQueryCmd function correctly returns nil if the module does not support queries.


80-84: Default genesis state.

The DefaultGenesis function correctly returns the default genesis state for the module.


86-93: Genesis state validation.

The ValidateGenesis function correctly validates the genesis state.


99-104: Well-defined AppModule structure.

The AppModule structure is well-defined and implements the necessary functionalities for the module.


106-113: Constructor for AppModule.

The constructor function NewAppModule correctly initializes the AppModule structure with the provided codec and keeper.


116-118: Marker function for app module.

The IsAppModule function correctly indicates that this is an app module.


119-120: Marker function for one-per-module type.

The IsOnePerModuleType function correctly indicates that this is a one-per-module type.


122-125: Service registration.

The RegisterServices function correctly indicates that the module does not have message and query services.


127-134: Genesis initialization.

The InitGenesis function correctly initializes the module's genesis state.


136-140: Genesis export.

The ExportGenesis function correctly exports the module's genesis state.


142-145: Consensus version.

The ConsensusVersion function correctly returns the initial consensus version.


147-149: End block logic.

The EndBlock function correctly indicates that there is no end block logic for the module.

protocol/app/app_test.go (3)

36-36: Addition of accountplusmodule import.

The addition of the accountplusmodule import statement reflects the integration of the new module.


45-45: Update of listingmodule import path.

The update of the listingmodule import path reflects the new location of the module within the project.


224-224: Inclusion of accountplusmodule in module basics.

The inclusion of accountplusmodule.AppModuleBasic{} in the module basics ensures that the new module is correctly initialized and configured in the application.

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

130-132: LGTM! Ensure consistency with the rest of the configuration.

The new section "dydxaccountplus" with an "accounts" field is correctly added.

However, ensure that this new section is consistently integrated with the rest of the configuration and that any related code changes are properly handled.

protocol/app/app.go (7)

133-135: Imports for AccountPlus module look good.

The imports for the AccountPlus module are correctly added and necessary for the new module.


300-300: Addition of AccountPlusKeeper to App struct looks good.

The AccountPlusKeeper is correctly added to the App struct, following the pattern of other keepers.


1171-1175: Initialization of AccountPlusKeeper in New function looks good.

The AccountPlusKeeper is correctly initialized in the New function, following the pattern of other keepers.


1247-1247: Addition of accountplusModule to ModuleManager looks good.

The accountplusModule is correctly added to the ModuleManager, following the pattern of other modules.


1298-1298: Addition of accountplusModule to ModuleManager BeginBlockers looks good.

The accountplusModule is correctly added to the ModuleManager BeginBlockers, following the pattern of other modules.


1345-1345: Addition of accountplusModule to ModuleManager EndBlockers looks good.

The accountplusModule is correctly added to the ModuleManager EndBlockers, following the pattern of other modules.


1393-1393: Addition of accountplusModule to ModuleManager InitGenesis looks good.

The accountplusModule is correctly added to the ModuleManager InitGenesis, following the pattern of other modules.

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: 2

Outside diff range, codebase verification and nitpick comments (1)
protocol/x/accountplus/keeper/timestampnonce_test.go (1)

1-1: Add comments to explain the purpose of the test.

Adding comments will improve the readability and maintainability of the test.

// TestDeepCopyTimestampNonceDetails verifies that the DeepCopyTimestampNonceDetails function
// correctly creates a deep copy of the TimestampNonceDetails structure.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b1fc924 and 3e469e6.

Files selected for processing (5)
  • protocol/x/accountplus/genesis_test.go (2 hunks)
  • protocol/x/accountplus/keeper/keeper.go (2 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • protocol/x/accountplus/genesis_test.go
  • protocol/x/accountplus/keeper/keeper.go
  • protocol/x/accountplus/keeper/keeper_test.go
  • protocol/x/accountplus/keeper/timestampnonce.go

Comment on lines 11 to 24
func TestDeepCopyTimestampNonceDetails(t *testing.T) {
details := keeper.InitialTimestampNonceDetails
detailsCopy := keeper.DeepCopyTimestampNonceDetails(details)

detailsCopy.MaxEjectedNonce = details.MaxEjectedNonce + 1
detailsCopy.TimestampNonces = append(detailsCopy.TimestampNonces, []uint64{1, 2, 3}...)

require.NotEqual(t, details.MaxEjectedNonce, detailsCopy.MaxEjectedNonce)
require.False(
t,
cmp.Equal(details.GetTimestampNonces(), detailsCopy.GetTimestampNonces()),
"TimestampNonces not deepcopy",
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Include edge cases in the test.

Consider adding edge cases to ensure the deep copy functionality handles all scenarios.

func TestDeepCopyTimestampNonceDetails(t *testing.T) {
	// Initial setup
	details := keeper.InitialTimestampNonceDetails
	detailsCopy := keeper.DeepCopyTimestampNonceDetails(details)

	// Modify the copy
	detailsCopy.MaxEjectedNonce = details.MaxEjectedNonce + 1
	detailsCopy.TimestampNonces = append(detailsCopy.TimestampNonces, []uint64{1, 2, 3}...)

	// Assertions
	require.NotEqual(t, details.MaxEjectedNonce, detailsCopy.MaxEjectedNonce)
	require.False(
		t,
		cmp.Equal(details.GetTimestampNonces(), detailsCopy.GetTimestampNonces()),
		"TimestampNonces not deepcopy",
	)

	// Edge case: Ensure original details remain unchanged
	require.Equal(t, keeper.InitialTimestampNonceDetails, details)
}

detailsCopy := keeper.DeepCopyTimestampNonceDetails(details)

detailsCopy.MaxEjectedNonce = details.MaxEjectedNonce + 1
detailsCopy.TimestampNonces = append(detailsCopy.TimestampNonces, []uint64{1, 2, 3}...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Verify the length of TimestampNonces after appending new elements.

Ensure that the length of TimestampNonces is as expected after appending new elements.

require.Equal(t, len(detailsCopy.TimestampNonces), len(details.TimestampNonces)+3)

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, codebase verification and nitpick comments (1)
protocol/testing/containertest/preupgrade_genesis.json (1)

777-779: Potential issue with the integration of the "dydxaccountplus" key

The "dydxaccountplus" key is defined in keys.go but is not utilized anywhere else in the Go code. This suggests that it might not be fully integrated into the application logic, which could lead to potential issues.

  • protocol/x/accountplus/types/keys.go: ModuleName = "dydxaccountplus"

Please ensure that the "dydxaccountplus" key is properly integrated and utilized within the application code.

Analysis chain

New key addition is correct but verify integration.

The addition of the "dydxaccountplus" key with an empty "accounts" array is correct and aligns with the existing structure. Ensure that this new key is properly integrated and utilized within the application to avoid potential issues.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the new "dydxaccountplus" key in the application.

# Test: Search for the usage of the "dydxaccountplus" key. Expect: Proper integration and utilization.
rg --type json -A 5 $'"dydxaccountplus"'

Length of output: 1273


Script:

#!/bin/bash
# Description: Verify the integration and utilization of the "dydxaccountplus" key in the application code.

# Test: Search for the usage of the "dydxaccountplus" key in the codebase.
rg 'dydxaccountplus'

Length of output: 314


Script:

#!/bin/bash
# Description: Verify the integration and utilization of the "dydxaccountplus" key in the Go code.

# Test: Search for the usage of the "dydxaccountplus" key in the Go code.
rg 'dydxaccountplus' --type go

Length of output: 99

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3e469e6 and d60ead3.

Files selected for processing (6)
  • protocol/app/basic_manager/basic_manager.go (2 hunks)
  • protocol/app/upgrades.go (1 hunks)
  • protocol/app/upgrades/v6.0.0/constants.go (2 hunks)
  • protocol/app/upgrades/v6.0.0/upgrade.go (3 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
  • protocol/testing/containertest/preupgrade_genesis.json (1 hunks)
Additional comments not posted (7)
protocol/app/upgrades.go (1)

33-34: Verify the correctness of added parameters.

The addition of app.AccountKeeper and app.AccountPlusKeeper to the CreateUpgradeHandler method appears to enhance the functionality of the upgrade handler. Ensure that these parameters are correctly utilized within the CreateUpgradeHandler method.

protocol/app/basic_manager/basic_manager.go (2)

26-26: Verify the necessity of the import statement.

The import statement for accountplusmodule appears to be correct. Ensure that this module is necessary for the functionality implemented in this file.


103-103: Verify the correctness and necessity of the addition.

The addition of accountplusmodule.AppModuleBasic{} to the list of modules appears to be correct. Ensure that this addition is necessary for the functionality implemented in this file.

protocol/app/upgrades/v6.0.0/upgrade.go (1)

151-152: Verify the correctness and utilization of added parameters.

The addition of accountKeeper and accountplusKeeper to the CreateUpgradeHandler function appears to be correct. Ensure that these parameters are correctly utilized within the function.

protocol/app/upgrades/v6.0.0/constants.go (2)

9-9: Import statement for accountplustypes is correct.

The import statement for accountplustypes from the module github.com/dydxprotocol/v4-chain/protocol/x/accountplus/types is necessary for the usage of accountplustypes.StoreKey.


26-26: Addition of accountplustypes.StoreKey is correct.

The addition of accountplustypes.StoreKey to the Added list within the StoreUpgrades variable is necessary for the upgrade process to include the new store key.

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

639-641: LGTM! Ensure the new key is utilized correctly.

The addition of the "dydxaccountplus" key with an empty "accounts" array is correctly formatted and does not affect existing properties.

However, ensure that this new key is utilized correctly elsewhere in the codebase.

Verification successful

The new key dydxaccountplus is utilized correctly.

The addition of the "dydxaccountplus" key with an empty "accounts" array is correctly formatted and does not affect existing properties. The key is referenced in protocol/x/accountplus/types/keys.go, indicating its integration into the application's architecture.

  • protocol/x/accountplus/types/keys.go: ModuleName = "dydxaccountplus"
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new `dydxaccountplus` key in the codebase.

# Test: Search for the usage of the new key. Expect: Occurrences of `dydxaccountplus`.
rg --type json -A 5 $'dydxaccountplus'

Length of output: 1269


Script:

#!/bin/bash
# Description: Verify the usage of the new `dydxaccountplus` key in the codebase in non-JSON files.

# Test: Search for the usage of the new key in non-JSON files. Expect: Occurrences of `dydxaccountplus`.
rg --type-add 'non-json:!*.json' -t non-json -A 5 $'dydxaccountplus'

Length of output: 127


Script:

#!/bin/bash
# Description: Verify the usage of the new `dydxaccountplus` key in the codebase in non-JSON files.

# Test: Search for the usage of the new key in non-JSON files. Expect: Occurrences of `dydxaccountplus`.
rg --type-add 'nonjson:*.{js,ts,py,go,rb,java}' -t nonjson -A 5 $'dydxaccountplus'

Length of output: 375

Comment on lines 136 to 149
func initAccountplusModuleState(
ctx sdk.Context,
accountKeeper authkeeper.AccountKeeper,
accountplusKeeper accountpluskeeper.Keeper,
) {
accounts := accountKeeper.GetAllAccounts(ctx)
for _, account := range accounts {
_, err := accountplusKeeper.InitializeAccount(ctx, account.GetAddress())
panic(fmt.Sprintf("failed to initialize accountplus state for address: %s", account.GetAddress().String()))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper error handling in initAccountplusModuleState.

The function initializes the state for the accountplus module. The error handling currently triggers a panic if initialization fails. Consider logging the error before panicking to provide more context.

-  panic(fmt.Sprintf("failed to initialize accountplus state for address: %s", account.GetAddress().String()))
+  sdkCtx.Logger().Error(fmt.Sprintf("failed to initialize accountplus state for address: %s", account.GetAddress().String()))
+  panic(err)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func initAccountplusModuleState(
ctx sdk.Context,
accountKeeper authkeeper.AccountKeeper,
accountplusKeeper accountpluskeeper.Keeper,
) {
accounts := accountKeeper.GetAllAccounts(ctx)
for _, account := range accounts {
_, err := accountplusKeeper.InitializeAccount(ctx, account.GetAddress())
panic(fmt.Sprintf("failed to initialize accountplus state for address: %s", account.GetAddress().String()))
}
}
func initAccountplusModuleState(
ctx sdk.Context,
accountKeeper authkeeper.AccountKeeper,
accountplusKeeper accountpluskeeper.Keeper,
) {
accounts := accountKeeper.GetAllAccounts(ctx)
for _, account := range accounts {
_, err := accountplusKeeper.InitializeAccount(ctx, account.GetAddress())
if err != nil {
sdkCtx.Logger().Error(fmt.Sprintf("failed to initialize accountplus state for address: %s", account.GetAddress().String()))
panic(err)
}
}
}

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d60ead3 and e9777b0.

Files selected for processing (6)
  • protocol/app/basic_manager/basic_manager.go (2 hunks)
  • protocol/app/upgrades.go (1 hunks)
  • protocol/app/upgrades/v6.0.0/constants.go (2 hunks)
  • protocol/app/upgrades/v6.0.0/upgrade.go (3 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (1 hunks)
  • protocol/testing/containertest/preupgrade_genesis.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • protocol/testing/containertest/preupgrade_genesis.json
Files skipped from review as they are similar to previous changes (5)
  • protocol/app/basic_manager/basic_manager.go
  • protocol/app/upgrades.go
  • protocol/app/upgrades/v6.0.0/constants.go
  • protocol/app/upgrades/v6.0.0/upgrade.go
  • protocol/scripts/genesis/sample_pregenesis.json

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e9777b0 and 579c006.

Files selected for processing (6)
  • protocol/app/basic_manager/basic_manager.go (2 hunks)
  • protocol/app/upgrades.go (1 hunks)
  • protocol/app/upgrades/v6.0.0/constants.go (2 hunks)
  • protocol/app/upgrades/v6.0.0/upgrade.go (3 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (2 hunks)
  • protocol/testing/containertest/preupgrade_genesis.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • protocol/testing/containertest/preupgrade_genesis.json
Files skipped from review as they are similar to previous changes (3)
  • protocol/app/basic_manager/basic_manager.go
  • protocol/app/upgrades.go
  • protocol/app/upgrades/v6.0.0/constants.go
Additional comments not posted (3)
protocol/app/upgrades/v6.0.0/upgrade.go (1)

Line range hint 150-177:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to CreateUpgradeHandler match the new signature.

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

1865-1865: Update the app_version.

The app_version has been updated, which is a standard procedure for versioning.


639-641: LGTM! But verify the new key usage in the codebase.

The code changes are approved.

However, ensure that the new key dydxaccountplus is used consistently across the codebase.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 579c006 and 03b7ed1.

Files selected for processing (7)
  • protocol/app/basic_manager/basic_manager.go (2 hunks)
  • protocol/app/upgrades.go (1 hunks)
  • protocol/app/upgrades/v6.0.0/constants.go (2 hunks)
  • protocol/app/upgrades/v6.0.0/upgrade.go (3 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (2 hunks)
  • protocol/testing/containertest/preupgrade_genesis.json (1 hunks)
  • protocol/testing/containertest/testnet_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • protocol/testing/containertest/preupgrade_genesis.json
Files skipped from review as they are similar to previous changes (4)
  • protocol/app/basic_manager/basic_manager.go
  • protocol/app/upgrades.go
  • protocol/app/upgrades/v6.0.0/constants.go
  • protocol/scripts/genesis/sample_pregenesis.json
Additional comments not posted (2)
protocol/app/upgrades/v6.0.0/upgrade.go (1)

Line range hint 150-177:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to CreateUpgradeHandler match the new signature.

Verification successful

LGTM! All function calls to CreateUpgradeHandler match the new signature.

The code changes are approved, and the function usage is consistent with the updated signature.

  • protocol/app/upgrades.go correctly calls CreateUpgradeHandler with the new parameters.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `CreateUpgradeHandler` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type go -A 5 $'CreateUpgradeHandler'

Length of output: 3296

protocol/testing/containertest/testnet_test.go (1)

277-287: Re-enable TestUpgrade function if possible.

The TestUpgrade function has been commented out, which removes the ability to test the upgrade process of the testnet. Ensure that there is a valid reason for this change and consider re-enabling the test if possible.

Comment on lines 136 to 149
func initAccountplusModuleState(
ctx sdk.Context,
accountKeeper authkeeper.AccountKeeper,
accountplusKeeper accountpluskeeper.Keeper,
) {
accounts := accountKeeper.GetAllAccounts(ctx)
for _, account := range accounts {
_, err := accountplusKeeper.InitializeAccount(ctx, account.GetAddress())
panic(fmt.Sprintf(
"failed to initialize accountplus state for address %s caused by\n %d",
account.GetAddress().String(),
err))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper error handling in initAccountplusModuleState.

The function initializes the state for the accountplus module. The error handling currently triggers a panic if initialization fails. Consider logging the error before panicking to provide more context and correct the error message format.

-  panic(fmt.Sprintf(
-    "failed to initialize accountplus state for address %s caused by\n %d",
-    account.GetAddress().String(),
-    err))
+  sdkCtx.Logger().Error(fmt.Sprintf(
+    "failed to initialize accountplus state for address: %s, error: %v",
+    account.GetAddress().String(),
+    err))
+  panic(err)

Committable suggestion was skipped due to low confidence.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 03b7ed1 and 952dfdc.

Files selected for processing (1)
  • protocol/app/app.go (9 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/app/app.go


initialAccountState := types.AccountState{
Address: address.String(),
TimestampNonceDetails: DeepCopyTimestampNonceDetails(InitialTimestampNonceDetails),
Copy link
Contributor

@teddyding teddyding Jul 22, 2024

Choose a reason for hiding this comment

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

Let's make the field definition not nullable (eg) so this is never a pointer. Then you also don't need this deep copy helper function

Copy link
Contributor

Choose a reason for hiding this comment

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

If the field is not nullable, will go automatically copy by value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe structs are copied by value but if the struct has a slice field, the copy's slice will reference the same slice.

Copy link
Contributor

Choose a reason for hiding this comment

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

The nullable comment is not just for deep copy, but more for proto conventions (since dealing with pointers is annoying)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also wondering why we need to keep this InitialTimestampNonceDetails at all. As asked above, when would we ever want to write an empty account state to state?

"github.com/google/go-cmp/cmp"
)

func CompareTimestampNonceDetails(actualDetails, expectedDetails *types.TimestampNonceDetails) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this special compare function? And do we still need it if it's no longer a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not too familiar with Go but my understanding is that TimestampNonceDetails is a struct which contains a slice so comparison is not directly supported. Moreover, slice comparison in Go is by reference.

Many unit tests will come down to comparing TimestampNonceDetails so I thought it would be helpful to create a helper function (same applies for AccountState).

As for if theres are not pointers, i think the above issues are still relevant.

Copy link
Contributor

Choose a reason for hiding this comment

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

TimestampNonceDetails is a struct which contains a slice so comparison is not directly supported.

IIRC require.Equal uses reflect.DeepEqual so it should be supported. Otherwise we would've needed to write a lot of recursive compare utilities

@@ -62,6 +63,40 @@ func (k Keeper) SetGenesisState(ctx sdk.Context, data types.GenesisState) error
return nil
}

func (k Keeper) InitializeAccount(ctx sdk.Context, address sdk.AccAddress) (types.AccountState, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is not used yet right? When will it be used? Trying to understand why we need this function at all (initializing to empty account state)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I actually wanted to remove this function for this CR but the commit history got kinda messed up. An upcoming PR will implement business logic in the validator and will use this function. Feel free to review this then.

Copy link
Contributor

Choose a reason for hiding this comment

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

When would we want to initialize empty account state? Wouldn't it always be non-empty when it's first created (i.e. one nonce?)

Copy link
Contributor Author

@jerryfan01234 jerryfan01234 Jul 22, 2024

Choose a reason for hiding this comment

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

My thought for initializing account was that as users submit tx, if they did not previously have an AccountState (corresponding to accountplus), a new account with default substructs (eg. timestamp nonce {[], 0} will be created.

Each component of accountplusmodule, such as timestamp nonce, will be responsible for updating the default state when it becomes relevant. In ts-nonce case, it will be when the user first uses a ts-nonce.

Copy link
Contributor

Choose a reason for hiding this comment

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

My thought for initializing account was that as users submit tx, if they did not previously have an AccountState (corresponding to accountplus), a new account with default substructs (eg. timestamp nonce {[], 0} will be created.

This seems pretty wasteful. In general state storage is a scare resource in blockchain, so we prefer to not add a node vs. having an empty node. Similarly, there was a project to remove empty subaccount state when their no longer have any outstanding balance/positions.

Also it seems natural that any transaction that's no using this special timestamp nonce should no result in any state change in x/accountplus state

@github-actions github-actions bot added the proto label Jul 23, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 952dfdc and 07d1481.

Files ignored due to path filters (2)
  • protocol/x/accountplus/types/accountplus.pb.go is excluded by !**/*.pb.go
  • protocol/x/accountplus/types/genesis.pb.go is excluded by !**/*.pb.go
Files selected for processing (8)
  • proto/dydxprotocol/accountplus/accountplus.proto (1 hunks)
  • proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
  • protocol/x/accountplus/genesis.go (1 hunks)
  • protocol/x/accountplus/genesis_test.go (1 hunks)
  • protocol/x/accountplus/keeper/keeper.go (3 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • protocol/x/accountplus/keeper/timestampnonce.go
  • protocol/x/accountplus/keeper/timestampnonce_test.go
Files skipped from review as they are similar to previous changes (4)
  • protocol/x/accountplus/genesis.go
  • protocol/x/accountplus/genesis_test.go
  • protocol/x/accountplus/keeper/keeper.go
  • protocol/x/accountplus/keeper/keeper_test.go
Additional comments not posted (4)
proto/dydxprotocol/accountplus/genesis.proto (2)

4-4: Import statement for gogoproto looks good.

The import statement for gogoproto is necessary for the new annotation.


10-10: Enforcing non-nullable accounts field is a good practice.

The addition of (gogoproto.nullable) = false ensures that the accounts field cannot be null, which enhances data integrity.

However, verify that this change is consistent with the rest of the codebase and does not introduce any unintended side effects.

Verification successful

The change to make the accounts field non-nullable is consistent with the rest of the codebase and does not introduce any unintended side effects.

  • The only occurrence of the accounts field was found in the genesis.proto file where the change was made.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `accounts` field in the codebase to ensure consistency with the non-nullable change.

# Test: Search for the usage of the `accounts` field. Expect: No conflicts or inconsistencies.
rg --type proto -A 5 $'repeated AccountState accounts'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify the usage of the `accounts` field in the codebase to ensure consistency with the non-nullable change.

# Test: Search for the usage of the `accounts` field. Expect: No conflicts or inconsistencies.
rg 'repeated AccountState accounts' --glob '*.proto' -A 5

Length of output: 198

proto/dydxprotocol/accountplus/accountplus.proto (2)

4-5: Import statement for gogoproto looks good.

The import statement for gogoproto is necessary for the new annotation.


11-11: Enforcing non-nullable timestamp_nonce_details field is a good practice.

The addition of (gogoproto.nullable) = false ensures that the timestamp_nonce_details field cannot be null, which enhances data integrity.

However, verify that this change is consistent with the rest of the codebase and does not introduce any unintended side effects.

Verification successful

Enforcing non-nullable timestamp_nonce_details field is a good practice.

The addition of (gogoproto.nullable) = false ensures that the timestamp_nonce_details field cannot be null, which enhances data integrity. The verification shows that this change is consistent with the rest of the codebase and does not introduce any unintended side effects.

  • The timestamp_nonce_details field is defined and used within the same file (proto/dydxprotocol/accountplus/accountplus.proto).
  • No conflicts or inconsistencies were found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `timestamp_nonce_details` field in the codebase to ensure consistency with the non-nullable change.

# Test: Search for the usage of the `timestamp_nonce_details` field. Expect: No conflicts or inconsistencies.
rg --type proto -A 5 $'TimestampNonceDetails timestamp_nonce_details'

Length of output: 100


Script:

#!/bin/bash
# Description: Verify the usage of the `timestamp_nonce_details` field in the codebase to ensure consistency with the non-nullable change.

# Test: Search for the usage of the `timestamp_nonce_details` field. Expect: No conflicts or inconsistencies.
rg 'TimestampNonceDetails timestamp_nonce_details' --glob '*.proto' -A 5

Length of output: 569

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 07d1481 and 3e106c3.

Files ignored due to path filters (2)
  • protocol/x/accountplus/types/accountplus.pb.go is excluded by !**/*.pb.go
  • protocol/x/accountplus/types/genesis.pb.go is excluded by !**/*.pb.go
Files selected for processing (8)
  • proto/dydxprotocol/accountplus/accountplus.proto (1 hunks)
  • proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
  • protocol/x/accountplus/genesis.go (1 hunks)
  • protocol/x/accountplus/genesis_test.go (1 hunks)
  • protocol/x/accountplus/keeper/keeper.go (3 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • protocol/x/accountplus/keeper/timestampnonce.go
  • protocol/x/accountplus/keeper/timestampnonce_test.go
Files skipped from review as they are similar to previous changes (6)
  • proto/dydxprotocol/accountplus/accountplus.proto
  • proto/dydxprotocol/accountplus/genesis.proto
  • protocol/x/accountplus/genesis.go
  • protocol/x/accountplus/genesis_test.go
  • protocol/x/accountplus/keeper/keeper.go
  • protocol/x/accountplus/keeper/keeper_test.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3e106c3 and f438fcd.

Files ignored due to path filters (2)
  • protocol/x/accountplus/types/accountplus.pb.go is excluded by !**/*.pb.go
  • protocol/x/accountplus/types/genesis.pb.go is excluded by !**/*.pb.go
Files selected for processing (8)
  • proto/dydxprotocol/accountplus/accountplus.proto (1 hunks)
  • proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
  • protocol/x/accountplus/genesis.go (1 hunks)
  • protocol/x/accountplus/genesis_test.go (1 hunks)
  • protocol/x/accountplus/keeper/keeper.go (3 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • protocol/x/accountplus/keeper/timestampnonce.go
Files skipped from review as they are similar to previous changes (7)
  • proto/dydxprotocol/accountplus/accountplus.proto
  • proto/dydxprotocol/accountplus/genesis.proto
  • protocol/x/accountplus/genesis.go
  • protocol/x/accountplus/genesis_test.go
  • protocol/x/accountplus/keeper/keeper.go
  • protocol/x/accountplus/keeper/keeper_test.go
  • protocol/x/accountplus/keeper/timestampnonce_test.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f438fcd and a6ae93c.

Files ignored due to path filters (2)
  • protocol/x/accountplus/types/accountplus.pb.go is excluded by !**/*.pb.go
  • protocol/x/accountplus/types/genesis.pb.go is excluded by !**/*.pb.go
Files selected for processing (9)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts (1 hunks)
  • proto/dydxprotocol/accountplus/accountplus.proto (1 hunks)
  • proto/dydxprotocol/accountplus/genesis.proto (1 hunks)
  • protocol/x/accountplus/genesis.go (1 hunks)
  • protocol/x/accountplus/genesis_test.go (1 hunks)
  • protocol/x/accountplus/keeper/keeper.go (3 hunks)
  • protocol/x/accountplus/keeper/keeper_test.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce.go (1 hunks)
  • protocol/x/accountplus/keeper/timestampnonce_test.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/genesis.ts
  • protocol/x/accountplus/keeper/timestampnonce_test.go
Files skipped from review as they are similar to previous changes (7)
  • proto/dydxprotocol/accountplus/accountplus.proto
  • proto/dydxprotocol/accountplus/genesis.proto
  • protocol/x/accountplus/genesis.go
  • protocol/x/accountplus/genesis_test.go
  • protocol/x/accountplus/keeper/keeper.go
  • protocol/x/accountplus/keeper/keeper_test.go
  • protocol/x/accountplus/keeper/timestampnonce.go

@teddyding
Copy link
Contributor

Could you add label feature:timestamp_nonce to this and future PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants