-
Notifications
You must be signed in to change notification settings - Fork 340
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
feat(rollapp): add vm type to rollapp registration #1040
feat(rollapp): add vm type to rollapp registration #1040
Conversation
WalkthroughThe changes introduce a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Rollapp
participant Validator
participant ErrorHandler
User->>CLI: Create Rollapp with vm-type
CLI->>Rollapp: Initialize with vmType
Rollapp->>Validator: Validate vmType
Validator-->>Rollapp: Valid
Rollapp-->>CLI: Rollapp created
CLI-->>User: Success response
User->>CLI: Create Rollapp with invalid vm-type
CLI->>Rollapp: Initialize with vmType
Rollapp->>Validator: Validate vmType
Validator-->>Rollapp: Invalid
Rollapp->>ErrorHandler: Handle ErrInvalidVMType
ErrorHandler-->>CLI: Error response
CLI-->>User: Error response
Assessment against linked issues
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 Configuration 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.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
ibctesting/utils_test.go (1)
130-130
: Update function calls to match the new signature.Several instances of
createRollapp
in the test files still use the old signature. These need to be updated to include the newrollappType
parameter.
x/rollapp/keeper/msg_server_create_rollapp_test.go
- Line 1:
suite.createRollapp(nil)
ibctesting/genesis_transfer_test.go
- Line 1:
s.createRollapp(false, nil)
ibctesting/transfers_enabled_test.go
- Line 1:
s.createRollapp(false, nil)
Please update these instances to match the new function signature.
Analysis chain
LGTM! But verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
createRollapp
match the new signature.
Verify the function usage in the codebase with the new signature.
The initial search results show multiple instances of
createRollapp
and related functions. To ensure all calls match the new signature, we need to inspect the parameters passed in each call.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `createRollapp` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'createRollapp'Length of output: 6631
Script:
#!/bin/bash # Description: Extract full context of createRollapp function calls to verify parameters. # Search for createRollapp function calls and include more context lines to see the parameters. rg --type go -A 10 $'createRollapp'Length of output: 10728
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
x/rollapp/types/rollapp.pb.go
is excluded by!**/*.pb.go
x/rollapp/types/tx.pb.go
is excluded by!**/*.pb.go
Files selected for processing (16)
- CHANGELOG.md (1 hunks)
- app/apptesting/test_suite.go (1 hunks)
- app/upgrades/v4/upgrade.go (1 hunks)
- ibctesting/utils_test.go (1 hunks)
- proto/dymensionxyz/dymension/rollapp/rollapp.proto (1 hunks)
- proto/dymensionxyz/dymension/rollapp/tx.proto (1 hunks)
- x/incentives/client/cli/query_test.go (1 hunks)
- x/incentives/keeper/suite_test.go (1 hunks)
- x/rollapp/client/cli/tx_create_rollapp.go (3 hunks)
- x/rollapp/client/cli/tx_submit_fraud_proposal.go (1 hunks)
- x/rollapp/keeper/msg_server_create_rollapp_test.go (11 hunks)
- x/rollapp/keeper/msg_server_update_rollapp_test.go (4 hunks)
- x/rollapp/types/errors.go (1 hunks)
- x/rollapp/types/message_create_rollapp.go (3 hunks)
- x/rollapp/types/message_create_rollapp_test.go (3 hunks)
- x/rollapp/types/rollapp.go (3 hunks)
Files skipped from review due to trivial changes (1)
- x/rollapp/client/cli/tx_submit_fraud_proposal.go
Additional context used
GitHub Check: build
x/rollapp/types/rollapp.go
[failure] 35-35:
undefined: types
GitHub Check: Analyze
x/rollapp/types/rollapp.go
[failure] 35-35:
undefined: types
Additional comments not posted (34)
x/rollapp/types/message_create_rollapp.go (2)
18-18
: LGTM! The new parametervmType
is correctly integrated.The function signature and the struct initialization are correctly updated to include the new
vmType
parameter.Also applies to: 28-28
62-62
: LGTM! The new fieldVmType
is correctly integrated into theGetRollapp
method.The method now correctly includes
msg.VmType
in its return values.x/rollapp/client/cli/tx_create_rollapp.go (5)
17-17
: LGTM! The command usage is correctly updated to include the new argumentvm-type
.The command usage now correctly reflects the new required argument.
19-19
: LGTM! The command example is correctly updated to include the new argumentvm-type
.The command example now correctly reflects the new required argument.
20-20
: LGTM! The command arguments are correctly updated to include the new argumentvm-type
.The command arguments now correctly reflect the new required argument.
25-27
: LGTM! The VM type validation is correctly implemented.The VM type is validated against a predefined set of values and an error is returned if the provided
vm-type
is invalid.
57-57
: LGTM! The message creation logic is correctly updated to include the new argumentvm-type
.The message creation logic now correctly reflects the new required argument.
proto/dymensionxyz/dymension/rollapp/rollapp.proto (3)
56-60
: LGTM! The new enumerationVMType
is correctly defined.The new enumeration defines three possible values:
Unspecified
,EVM
, andWASM
.
61-62
: LGTM! The new fieldvm_type
is correctly added to theRollapp
message.The new field is properly integrated into the message.
64-64
: LGTM! The field tag update forsealed
is correctly implemented.The field
sealed
has been moved to a new tag to accommodate the newvm_type
field.proto/dymensionxyz/dymension/rollapp/tx.proto (1)
41-42
: Addition ofvm_type
field toMsgCreateRollapp
The addition of the
vm_type
field enhances theMsgCreateRollapp
message by allowing the specification of the rollapp machine type, which can be either EVM or WASM. This change is consistent with the PR objectives and improves the flexibility of rollapp configurations.Ensure that the
vm_type
field is properly validated and utilized in the rollapp creation logic.x/incentives/client/cli/query_test.go (1)
41-41
: Addition ofVmType
field toCreateDefaultRollapp
The addition of the
VmType
field in theCreateDefaultRollapp
method ensures that the rollapp being created will utilize the EVM type. This change is consistent with the PR objectives and improves the specificity of rollapp configurations.Ensure that the
VmType
field is properly validated and utilized in the rollapp creation logic.x/rollapp/types/errors.go (1)
45-45
: Addition ofErrInvalidVMType
error variableThe addition of the
ErrInvalidVMType
error variable enhances the error handling capabilities by specifically addressing issues related to invalid VM types. This change is consistent with the PR objectives and improves feedback for developers and users.Ensure that this error is properly used in the rollapp creation and validation logic.
app/apptesting/test_suite.go (1)
49-49
: LGTM! Verify the usage of the newVmType
field.The
VmType
field is correctly added and initialized torollapptypes.Rollapp_EVM
.Ensure that the usage of the new
VmType
field is consistent throughout the codebase.Verification successful
The
VmType
field is consistently used throughout the codebase.The search results indicate that the
VmType
field is correctly integrated and utilized in various parts of the codebase, including tests and protobuf definitions.
x/incentives/keeper/suite_test.go
x/rollapp/types/message_create_rollapp_test.go
x/rollapp/types/rollapp.pb.go
x/rollapp/types/message_create_rollapp.go
x/rollapp/types/rollapp.go
x/rollapp/types/tx.pb.go
x/incentives/client/cli/query_test.go
x/rollapp/keeper/msg_server_update_rollapp_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
app/upgrades/v4/upgrade.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new `VmType` field. # Test: Search for the `VmType` field usage. Expect: Consistent usage of the new field. rg --type go 'VmType'Length of output: 3748
x/rollapp/types/rollapp.go (2)
24-24
: Add thevmType
parameter to theNewRollapp
function.The
vmType
parameter is correctly added to the function signature.
86-89
: LGTM! The validation logic for theVmType
field is correctly implemented.The
ValidateBasic
method now includes validation for theVmType
field.x/rollapp/types/message_create_rollapp_test.go (3)
30-30
: LGTM! TheVmType
field is correctly added to the test case.The
VmType
field is correctly added and initialized toRollapp_EVM
in the "valid - full features" test case.
74-74
: LGTM! TheVmType
field is correctly added to the test case.The
VmType
field is correctly added and initialized toRollapp_EVM
in the "valid address" test case.
160-160
: LGTM! TheVmType
field is correctly added to the test case.The
VmType
field is correctly added and initialized toRollapp_EVM
in the "invalid metadata: invalid logo data uri" test case.app/upgrades/v4/upgrade.go (1)
150-151
: LGTM! But verify the handling of theVmType
field in the codebase.The addition of the
VmType
field aligns with the PR objectives. Ensure that the new field is properly handled in the rest of the codebase.Verification successful
The
VmType
field is properly integrated and handled across the codebase.The addition of the
VmType
field aligns with the PR objectives, and its usage is consistent in various parts of the codebase, including protobuf definitions, message creation, validation, and tests.
- The placeholder value
rollapptypes.Rollapp_EVM
is used consistently, but ensure it is appropriate for all contexts or consider making it dynamic if needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the `VmType` field in the codebase. # Test: Search for the usage of the `VmType` field. Expect: Proper handling in the codebase. rg --type go -A 5 $'VmType'Length of output: 16305
x/incentives/keeper/suite_test.go (1)
219-219
: LGTM! But verify the handling of theVmType
field in the codebase.The addition of the
VmType
field aligns with the PR objectives. Ensure that the new field is properly handled in the rest of the codebase.x/rollapp/keeper/msg_server_update_rollapp_test.go (3)
46-46
: LGTM! But verify the handling of theVmType
field in the codebase.The addition of the
VmType
field aligns with the PR objectives. Ensure that the new field is properly handled in the rest of the codebase.Verification successful
LGTM! The
VmType
field is properly handled in the codebase.The
VmType
field is integrated into various parts of the codebase, including protobuf definitions, message creation, and testing, indicating that it is well-supported and correctly handled.
- Files and locations confirming proper handling:
x/rollapp/types/tx.pb.go
x/rollapp/types/rollapp.go
x/rollapp/types/message_create_rollapp.go
x/rollapp/keeper/msg_server_update_rollapp_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
app/upgrades/v4/upgrade.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the `VmType` field in the codebase. # Test: Search for the usage of the `VmType` field. Expect: Proper handling in the codebase. rg --type go -A 5 $'VmType'Length of output: 16305
181-181
: LGTM! But verify the handling of theVmType
field in the codebase.The addition of the
VmType
field aligns with the PR objectives. Ensure that the new field is properly handled in the rest of the codebase.Verification successful
LGTM! The
VmType
field is properly handled in the codebase.The addition of the
VmType
field aligns with the PR objectives and is correctly integrated into the protobuf messages, validation logic, and test cases.
- Files and locations:
x/rollapp/types/tx.pb.go
x/rollapp/types/message_create_rollapp_test.go
x/rollapp/types/rollapp.go
x/rollapp/types/message_create_rollapp.go
x/rollapp/types/rollapp.pb.go
x/rollapp/keeper/msg_server_update_rollapp_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
app/upgrades/v4/upgrade.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the `VmType` field in the codebase. # Test: Search for the usage of the `VmType` field. Expect: Proper handling in the codebase. rg --type go -A 5 $'VmType'Length of output: 16305
121-121
: LGTM! But verify the handling of theVmType
field in the codebase.The addition of the
VmType
field aligns with the PR objectives. Ensure that the new field is properly handled in the rest of the codebase.Verification successful
The
VmType
field appears to be properly handled in the codebase.The field is integrated into various parts of the code, including message creation, validation, and protobuf serialization/deserialization, indicating thorough handling.
- Files and contexts where
VmType
is handled:
x/rollapp/types/rollapp.go
x/rollapp/types/message_create_rollapp.go
x/rollapp/types/tx.pb.go
x/rollapp/types/rollapp.pb.go
- Various test files
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the `VmType` field in the codebase. # Test: Search for the usage of the `VmType` field. Expect: Proper handling in the codebase. rg --type go -A 5 $'VmType'Length of output: 16305
x/rollapp/keeper/msg_server_create_rollapp_test.go (9)
36-36
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
58-58
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
70-70
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
133-133
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
199-199
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
260-260
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
278-278
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
322-322
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.
350-350
: LGTM!The inclusion of the
VmType
field enhances the test by specifying the VM type for the rollapp.CHANGELOG.md (1)
46-46
: LGTM!The inclusion of the
VMType
field in the changelog is consistent with the PR objectives and provides necessary information to users and developers.
…ype-to-rollapp-registration
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
x/rollapp/types/tx.pb.go
is excluded by!**/*.pb.go
Files selected for processing (1)
- proto/dymensionxyz/dymension/rollapp/tx.proto (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- proto/dymensionxyz/dymension/rollapp/tx.proto
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- x/rollapp/types/message_create_rollapp_test.go (12 hunks)
- x/rollapp/types/rollapp.go (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- x/rollapp/types/message_create_rollapp_test.go
- x/rollapp/types/rollapp.go
@@ -12,25 +14,30 @@ import ( | |||
|
|||
func CmdCreateRollapp() *cobra.Command { |
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.
@zale144 I guess it's better to add long
description with possible fields and expected values
no need for adding manual entry to changelog as it will collide with the automated process |
Description
Closes #1036
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
----;
For Reviewer:
---;
After reviewer approval:
Summary by CodeRabbit
New Features
VMType
field to enhance Rollapp functionality, allowing specific configurations based on virtual machine types such as EVM and WASM.vm-type
argument for creating Rollapps, improving clarity and specificity.Bug Fixes
Documentation