-
Notifications
You must be signed in to change notification settings - Fork 106
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-87] add x/vault protos #1169
Conversation
WalkthroughThe recent updates focus on enhancing the Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
protocol/x/vault/types/tx.pb.go
is excluded by:!**/*.pb.go
protocol/x/vault/types/vault.pb.go
is excluded by:!**/*.pb.go
Files selected for processing (14)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts (4 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.rpc.msg.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts (1 hunks)
- indexer/packages/v4-protos/src/codegen/google/bundle.ts (1 hunks)
- proto/dydxprotocol/vault/tx.proto (1 hunks)
- proto/dydxprotocol/vault/vault.proto (1 hunks)
- protocol/app/basic_manager/basic_manager.go (2 hunks)
- protocol/app/msgs/all_msgs.go (1 hunks)
- protocol/testutil/app/app.go (3 hunks)
- protocol/x/vault/keeper/msg_server_deposit_to_vault.go (1 hunks)
- protocol/x/vault/types/msg_deposit_to_vault.go (1 hunks)
Check Runs (11)
install-runsim completed (5)
v4-proto-py-gen completed (1)
v4-proto-js-gen completed (1)
protocol-gen completed (1)
lint completed (1)
indexer-gen completed (1)
check-bc-breaking completed (1)
check-sample-pregenesis-up-to-date completed (1)
build completed (1)
validate-yaml completed (1)
format completed (1)
Additional comments: 19
indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts (1)
- 1-2: The update from
_101
to_102
in the import statement seems appropriate. Ensure that the new version of the module is fully compatible and does not introduce any breaking changes.indexer/packages/v4-protos/src/codegen/google/bundle.ts (1)
- 1-14: The reordering and addition of imports in this file, along with the updates to the
proto/dydxprotocol/vault/vault.proto (1)
- 8-34: The definitions in
vault.proto
, including theVaultType
enum,VaultId
, andNumShares
messages, are well-structured. Ensure that the custom type used fornum_shares
is correctly implemented and thoroughly tested to maintain data integrity.proto/dydxprotocol/vault/tx.proto (1)
- 16-33: The message definitions in
tx.proto
, includingMsgDepositToVault
andMsgDepositToVaultResponse
, are appropriately structured for handling deposit operations. Ensure that the custom types used, especially forquote_quantums
, are correctly implemented and thoroughly tested to ensure data integrity.indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts (1)
- 20-20: The addition of the
vault
entity to thecreateRPCMsgClient
function is a logical step to enable RPC calls for vault operations. Ensure that thevault/tx.rpc.msg
module is correctly implemented and tested to support these operations effectively.protocol/app/basic_manager/basic_manager.go (1)
- 39-39: Adding
vaultmodule
to the list ofAppModuleBasic
instances is a crucial step in integrating the new vault functionality into the application. Ensure that thevaultmodule
is properly implemented and tested to maintain the integrity of the application.indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts (3)
- 7-15: The
MsgDepositToVault
interface is well-defined, with clear comments and appropriate field types. Ensure thatquoteQuantums
is correctly handled in all relevant operations, especially considering its typeUint8Array
.- 36-97: The encoding and decoding functions for
MsgDepositToVault
are correctly implemented, following the protobufjs conventions. It's important to ensure comprehensive testing, particularly for edge cases in the encoding and decoding processes.- 101-131: The
MsgDepositToVaultResponse
interface and its associated functions are minimal, as expected for a response type without specific fields. This simplicity is appropriate unless future requirements necessitate additional response data.indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts (5)
- 5-11: The
VaultType
enum is correctly defined with appropriate comments. Ensure that all potential vault types are covered, and consider future extensibility for new vault types.- 54-59: The
VaultId
interface is well-structured, providing a clear way to uniquely identify vaults. Ensure that thenumber
field is sufficient for identifying vaults within a type and consider any potential for collisions.- 72-74: The
NumShares
interface correctly represents the number of shares in a vault. Given its use ofUint8Array
fornumShares
, ensure that there's a consistent approach to interpreting this data across the application.- 83-134: The encoding and decoding functions for
VaultId
are implemented following the protobufjs conventions. It's important to ensure these functions are thoroughly tested, especially for edge cases.- 138-179: Similarly, the encoding and decoding functions for
NumShares
follow the correct conventions. Ensure that the handling ofUint8Array
fornumShares
is consistent and well-documented throughout the application.indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts (1)
- 90-174: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [93-324]
The reordering of imports and updates to references in
bundle.ts
appear to be correctly implemented, enhancing the organization within thedydxprotocol
namespace. Ensure that all references are correctly updated across the codebase to reflect these changes, avoiding any broken imports or references.protocol/app/msgs/all_msgs.go (1)
- 237-239: The addition of
"/dydxprotocol.vault.MsgDepositToVault": {},
correctly aligns with the PR's objectives to introduce new functionalities related to vault operations. This change is well-placed within theAllTypeMessages
map, ensuring that the new vault-related message type is registered and recognized by the application.However, considering the potential for future expansions in the
vault
functionality or other areas, it might be beneficial to consider a strategy for organizing these message types. For instance, grouping related message types or introducing comments to delineate sections could enhance readability and maintainability as the list grows.protocol/testutil/app/app.go (3)
- 66-66: The addition of
vaulttypes
import is necessary for incorporating vault functionality into the test utilities. Looks good.- 204-205: The inclusion of
vaulttypes.GenesisState
in theGenesisStates
interface is a necessary update to handle vault-related genesis state. This change aligns well with the PR's objectives.- 259-260: Adding a case for
vaulttypes.GenesisState
in theUpdateGenesisDocWithAppStateForModule
function is essential for updating the genesis document with vault-related state. This change is consistent and necessary for the introduction of vault functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- protocol/app/msgs/all_msgs.go (1 hunks)
- protocol/app/msgs/normal_msgs.go (2 hunks)
Check Runs (18)
install-runsim completed (5)
call-build-ecs-service-vulcan / (vulcan) Check docker image build completed (1)
v4-proto-py-gen completed (1)
call-build-ecs-service-socks / (socks) Check docker image build completed (1)
v4-proto-js-gen completed (1)
call-build-ecs-service-comlink / (comlink) Check docker image build completed (1)
protocol-gen completed (1)
call-build-ecs-service-roundtable / (roundtable) Check docker image build completed (1)
lint completed (1)
call-build-ecs-service-ender / (ender) Check docker image build completed (1)
validate-yaml completed (1)
format completed (1)
golangci-lint completed (1)
check-build-bazooka completed (1)
check-bc-breaking completed (1)
check-sample-pregenesis-up-to-date completed (1)
build completed (1)
indexer-gen completed (1)
Files skipped from review as they are similar to previous changes (1)
- protocol/app/msgs/all_msgs.go
Additional comments: 2
protocol/app/msgs/normal_msgs.go (2)
- 22-22: The import statement for
vault "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
has been correctly added to include the new vault types. This is necessary for the subsequent use ofvault.MsgDepositToVault
andvault.MsgDepositToVaultResponse
in theNormalMsgsDydxCustom
map.- 239-240: The addition of
"/dydxprotocol.vault.MsgDepositToVault": &vault.MsgDepositToVault{}
and"/dydxprotocol.vault.MsgDepositToVaultResponse": nil
to theNormalMsgsDydxCustom
map correctly registers the new vault messages. This is essential for enabling the handling of these messages within the application. However, it's important to ensure that the corresponding message handlers are implemented and tested thoroughly to handle these new message types effectively.Please confirm that the message handlers for
MsgDepositToVault
andMsgDepositToVaultResponse
have been implemented and covered by unit tests to ensure correct behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- protocol/app/msgs/all_msgs.go (1 hunks)
- protocol/app/msgs/normal_msgs.go (2 hunks)
- protocol/app/msgs/normal_msgs_test.go (1 hunks)
Check Runs (18)
install-runsim completed (5)
call-build-ecs-service-vulcan / (vulcan) Check docker image build completed (1)
call-build-ecs-service-socks / (socks) Check docker image build completed (1)
v4-proto-py-gen completed (1)
call-build-ecs-service-roundtable / (roundtable) Check docker image build completed (1)
protocol-gen completed (1)
call-build-ecs-service-comlink / (comlink) Check docker image build completed (1)
indexer-gen completed (1)
call-build-ecs-service-ender / (ender) Check docker image build completed (1)
v4-proto-js-gen completed (1)
lint completed (1)
check-build-bazooka completed (1)
validate-yaml completed (1)
format completed (1)
build completed (1)
check-bc-breaking completed (1)
golangci-lint completed (1)
check-sample-pregenesis-up-to-date completed (1)
Files skipped from review as they are similar to previous changes (2)
- protocol/app/msgs/all_msgs.go
- protocol/app/msgs/normal_msgs.go
Additional comments: 1
protocol/app/msgs/normal_msgs_test.go (1)
- 141-143: The addition of vault messages
"/dydxprotocol.vault.MsgDepositToVault"
and"/dydxprotocol.vault.MsgDepositToVaultResponse"
to theexpectedMsgs
array inTestNormalMsgs_Key
is correctly implemented and logically categorized.Ensure that the
NormalMsgs
map is updated to include these new messages, as this test assumes their presence.
Changelist
add x/vault protos
Test Plan
N/A
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.