-
Notifications
You must be signed in to change notification settings - Fork 198
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: bump movevm and point #248
Conversation
Caution Review failedThe pull request is closed. WalkthroughWalkthroughThe updates introduce enhancements across various components, focusing on improving the management of library versions and gas tracking mechanisms. Key changes include a version bump to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Querier
participant Keeper
participant VirtualMachine
User->>Querier: Make view query
Querier->>Keeper: Call ExecuteViewFunction
Keeper->>VirtualMachine: Execute function with gas tracking
VirtualMachine->>Keeper: Return results and gas used
Keeper-->>Querier: Provide output and gas used
Querier-->>User: Respond with results and gas used
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 (
|
Dependency ReviewThe following issues were found:
License Issuesgo.mod
Denied Licenses: GPL-1.0-or-later, LGPL-2.0-or-later OpenSSF Scorecard
Scanned Manifest Filesgo.mod
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #248 +/- ##
==========================================
+ Coverage 40.50% 40.53% +0.03%
==========================================
Files 264 264
Lines 25087 25065 -22
==========================================
Hits 10161 10161
+ Misses 13351 13332 -19
+ Partials 1575 1572 -3
|
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
Outside diff range, codebase verification and nitpick comments (2)
x/move/keeper/querier.go (1)
Verify and update function calls to handle
gasUsed
return valueThe
View
function now returns an additionalgasUsed
value, but current function calls do not handle this new return value. Review and update these calls to ensure they correctly capture and utilizegasUsed
where necessary.
- Files to review:
x/move/keeper/querier_test.go
: Test cases invokingView
.x/move/keeper/querier.go
: Calls within theLegacyView
function.x/move/client/cli/query.go
: CLI interactions withView
.Analysis chain
Line range hint
291-315
:
Verify usage of updated function signature.The
View
function now returns an additionalgasUsed
value. Ensure that all calls to this function handle the new return value correctly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `View` handle the new return value. # Test: Search for the function usage. Expect: All occurrences handle the new return value. rg --type go -A 5 $'View('Length of output: 88
Script:
#!/bin/bash # Description: Verify all function calls to `View` handle the new return value. # Test: Search for the function usage. Expect: All occurrences handle the new return value. rg --type go -A 5 $'View\\('Length of output: 15251
x/move/keeper/handler.go (1)
Ensure all usages of
executeViewFunction
handle the new return value.The function
executeViewFunction
has been updated to return an additionalgasUsed
value. However, some calls to this function do not capture this new return value. Please update the following locations to handlegasUsed
appropriately:
x/move/keeper/vesting.go
: The calls toexecuteViewFunction
do not capturegasUsed
.Analysis chain
Line range hint
563-608
:
Verify usage of updated function signature.The
executeViewFunction
now returns an additionalgasUsed
value. Ensure that all calls to this function handle the new return value correctly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `executeViewFunction` handle the new return value. # Test: Search for the function usage. Expect: All occurrences handle the new return value. rg --type go -A 5 $'executeViewFunction('Length of output: 133
Script:
#!/bin/bash # Description: Verify all function calls to `executeViewFunction` handle the new return value. # Corrected Test: Search for the function usage. Expect: All occurrences handle the new return value. rg --type go -A 5 'executeViewFunction'Length of output: 1439
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
go.mod
is excluded by!**/*.mod
go.sum
is excluded by!**/*.sum
,!**/*.sum
Files selected for processing (15)
- Dockerfile (1 hunks)
- cmd/move/move.go (3 hunks)
- x/ibc-hooks/move-hooks/ack_test.go (6 hunks)
- x/ibc-hooks/move-hooks/receive_test.go (4 hunks)
- x/ibc-hooks/move-hooks/timeout_test.go (4 hunks)
- x/ibc/nft-transfer/keeper/relay_test.go (1 hunks)
- x/move/config/config.go (2 hunks)
- x/move/keeper/api_test.go (2 hunks)
- x/move/keeper/bank_test.go (1 hunks)
- x/move/keeper/handler.go (7 hunks)
- x/move/keeper/keeper.go (4 hunks)
- x/move/keeper/querier.go (4 hunks)
- x/move/keeper/vesting.go (2 hunks)
- x/move/types/keys.go (2 hunks)
- x/move/types/vm_engine.go (1 hunks)
Files skipped from review due to trivial changes (2)
- Dockerfile
- x/move/keeper/vesting.go
Additional comments not posted (27)
x/move/types/vm_engine.go (3)
26-32
: Ensure correct handling ofgasBalance
inExecuteEntryFunction
.The
ExecuteEntryFunction
method now takes agasBalance
pointer. Verify that the function's implementation correctly handles this parameter, including checks for nil pointers and appropriate updates to the gas balance.
19-24
: Ensure correct handling ofgasBalance
inExecuteViewFunction
.The
ExecuteViewFunction
method now takes agasBalance
pointer, which implies that the function might modify the gas balance during execution. Ensure that this change is reflected in the function's implementation and that proper checks are in place to handle potential nil pointers.
34-40
: Ensure correct handling ofgasBalance
inExecuteScript
.The
ExecuteScript
method now takes agasBalance
pointer. Ensure that the implementation correctly manages this parameter, with checks for nil pointers and appropriate modifications to the gas balance as needed.x/move/config/config.go (1)
Line range hint
1-53
:
Verify the impact of removing cache capacities.The removal of
DefaultModuleCacheCapacity
andDefaultScriptCacheCapacity
simplifies the configuration. Ensure that no other parts of the codebase depend on these configurations.Verification successful
No Impact from Removing Cache Capacities Found
The removal of
DefaultModuleCacheCapacity
andDefaultScriptCacheCapacity
appears to have no impact on the rest of the codebase, as there are no references to these constants elsewhere. This suggests that their removal is safe and does not affect other parts of the system.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing cache capacities. # Test: Search for any usage of the removed cache capacities. Expect: No dependencies on these configurations. rg --type go 'DefaultModuleCacheCapacity|DefaultScriptCacheCapacity'Length of output: 70
x/move/types/keys.go (1)
Line range hint
1-78
:
Verify the impact of removing checksum-related functions.The removal of checksum-related functions and constants indicates a simplification. Ensure that there are no dependencies on these functions elsewhere in the codebase.
Verification successful
Checksum-related functions and constants removed safely.
The removal of checksum-related functions and constants in
x/move/types/keys.go
does not impact the rest of the codebase, as there are no dependencies found. This change simplifies the code without affecting functionality.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing checksum-related functions. # Test: Search for any usage of the removed checksum functions. Expect: No dependencies on these functions. rg --type go 'GetChecksumPrefix|GetChecksumKey|ChecksumSeparator'Length of output: 67
x/ibc-hooks/move-hooks/timeout_test.go (2)
69-69
: Ignoring unused return value is appropriate.The change to ignore the second return value of
ExecuteViewFunction
is appropriate, as it is not used in the test.Also applies to: 90-90
162-162
: Ignoring unused return value is appropriate.The change to ignore the second return value of
ExecuteViewFunction
is appropriate, as it is not used in the test.Also applies to: 183-183
x/ibc-hooks/move-hooks/receive_test.go (4)
83-83
: Ignoring unused return value is appropriate.The change to ignore the second return value of
ExecuteViewFunction
is appropriate, as it is not used in the test.
165-165
: Ignoring unused return value is appropriate.The change to ignore the second return value of
ExecuteViewFunction
is appropriate, as it is not used in the test.
222-222
: Ignoring unused return value is appropriate.The change to ignore the second return value of
ExecuteViewFunction
is appropriate, as it is not used in the test.
27-31
: Structured memo enhances semantic clarity.The change to use a structured JSON object for the
Memo
field enhances the semantic clarity and potential for complex interactions.Ensure that the new memo structure aligns with the intended logic in the codebase.
Verification successful
Structured memo format is correctly handled.
The
validateAndParseMemo
function inx/ibc-hooks/move-hooks/util.go
confirms that the structured JSON memo format is supported and processed correctly. The function checks for the presence of themove
key and parses its data, ensuring the new format is accommodated. No further changes are necessary.
x/ibc-hooks/move-hooks/util.go
:validateAndParseMemo
processes structured JSON.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the new structured memo in the codebase. # Test: Search for the handling of the `Memo` field in the codebase. Expect: Handling of the structured JSON object. rg --type go '"move":\s*\{\s*"message":\s*null\s*\}'Length of output: 54
Script:
#!/bin/bash # Description: Search for functions handling the `Memo` field in the codebase to verify if the new structured format is accommodated. # Search for any references to the `Memo` field in Go files. rg --type go 'Memo'Length of output: 8223
Script:
#!/bin/bash # Description: Extract the implementation of `validateAndParseMemo` to verify handling of structured memo. # Use ast-grep to find the implementation of `validateAndParseMemo` in Go files. ast-grep --lang go --pattern 'func validateAndParseMemo($_) { $$$ }'Length of output: 70
Script:
#!/bin/bash # Description: Search for the definition of `validateAndParseMemo` specifically within the `x/ibc-hooks/move-hooks` directory. # Use rg to search for the function definition in the specified directory. rg --type go 'func validateAndParseMemo' x/ibc-hooks/move-hooks/Length of output: 138
Script:
#!/bin/bash # Description: Extract the full implementation of `validateAndParseMemo` from `x/ibc-hooks/move-hooks/util.go`. # Use rg to extract the function implementation with surrounding context. rg --type go -A 20 'func validateAndParseMemo' x/ibc-hooks/move-hooks/util.goLength of output: 549
x/ibc/nft-transfer/keeper/relay_test.go (1)
36-36
: Handling additional return value is appropriate.The change to handle an additional unnamed return value from
ExecuteViewFunction
is appropriate, as it is not used in the current logic.Verify that this aligns with the updated function signature in the codebase.
x/ibc-hooks/move-hooks/ack_test.go (1)
76-76
: Simplification of return value handling.The use of an underscore (
_
) to ignore the second return value fromExecuteViewFunction
is a good practice when the value is not needed. This change improves code readability by focusing on the relevant outputs.Also applies to: 97-97, 114-114, 192-192, 213-213, 230-230
x/move/keeper/bank_test.go (1)
216-216
: Verify the impact of changing"mint"
to"mint_to"
.The change in the string parameter suggests a shift in the operation being tested. Ensure that this aligns with the intended functionality and that the test logic accurately reflects the new behavior.
x/move/keeper/api_test.go (1)
222-222
: Simplification of return value handling.The use of an underscore (
_
) to ignore the first return value fromExecuteViewFunction
is a good practice when the value is not needed. This change improves code readability by focusing on the relevant outputs.Also applies to: 290-290, 297-297
x/move/keeper/querier.go (1)
Line range hint
362-386
:
Verify usage of updated function signature.The
ViewJSON
function now returns an additionalgasUsed
value. Ensure that all calls to this function handle the new return value correctly.x/move/keeper/handler.go (2)
202-214
: Verify correctness of gas calculation and consumption.The
executeEntryFunction
method now usesgasBalance
to calculategasUsed
. Ensure that this logic is correctly implemented and consistent with the intended behavior.
317-329
: Verify correctness of gas calculation and consumption.The
executeScript
method now usesgasBalance
to calculategasUsed
. Ensure that this logic is correctly implemented and consistent with the intended behavior.x/move/keeper/keeper.go (3)
Line range hint
400-450
:
Verify correctness of internal logic changes.The
IterateVMStore
function has undergone changes to its internal logic. Ensure that these changes are correctly implemented and consistent with the intended behavior.Verification successful
Function
IterateVMStore
is correctly implemented. The function exists in the codebase and uses a callback mechanism to iterate over VM store entries, handling different types of entries appropriately. No issues were found with its implementation.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify correctness of internal logic changes in `IterateVMStore`. # Test: Search for the logic of `IterateVMStore`. Expect: Correct implementation of internal logic changes. rg --type go -A 10 $'IterateVMStore('Length of output: 119
Script:
#!/bin/bash # Description: Correctly search for the `IterateVMStore` function definition and implementation. # Corrected Test: Search for the `IterateVMStore` function definition. rg --type go -A 20 'func IterateVMStore('Length of output: 134
Script:
#!/bin/bash # Description: Search for the `IterateVMStore` function definition and implementation with corrected regex. # Corrected Test: Search for the `IterateVMStore` function definition by escaping parentheses. rg --type go -A 20 'func IterateVMStore\('Length of output: 44
Script:
#!/bin/bash # Description: Search for functions related to `IterateVMStore` or similar functionality. # Search for any function containing 'VMStore' in its name. rg --type go -A 20 'func .*VMStore\('Length of output: 3489
88-94
: Verify correctness of VM initialization and error handling.The
NewKeeper
function now initializes the VM usingvmtypes.InitiaVMConfig
and includes error handling. Ensure that this logic is correctly implemented and robust.Verification successful
Ensure Robustness in VM Initialization and Error Handling
The
NewKeeper
function inx/move/keeper/keeper.go
initializes the VM withvmtypes.InitiaVMConfig
and handles errors by panicking if the VM creation fails. This approach is straightforward but consider adding more context to the error message or using a more graceful error handling strategy to improve robustness and maintainability.
- File:
x/move/keeper/keeper.go
- Lines: 88-94
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify correctness of VM initialization and error handling. # Test: Search for the logic of `NewKeeper`. Expect: Correct initialization and error handling. rg --type go -A 10 $'NewKeeper('Length of output: 104
Script:
#!/bin/bash # Description: Verify correctness of VM initialization and error handling. # Test: Search for the logic of `NewKeeper`. Expect: Correct initialization and error handling. rg --type go -A 10 $'NewKeeper\\('Length of output: 55451
Script:
#!/bin/bash # Description: Verify correctness of VM initialization and error handling in the specific file. # Test: Search for the `NewKeeper` function specifically in `x/move/keeper/keeper.go`. rg --type go -A 10 -g 'x/move/keeper/keeper.go' $'NewKeeper\\('Length of output: 753
Script:
#!/bin/bash # Description: Capture more lines of the `NewKeeper` function to verify VM initialization and error handling. # Test: Search for the `NewKeeper` function and capture additional lines to include the VM initialization. rg --type go -A 30 -g 'x/move/keeper/keeper.go' $'NewKeeper\\('Length of output: 1887
Line range hint
140-149
:
Verify correctness of internal logic changes.The
SetModule
function has undergone changes to its internal logic. Ensure that these changes are correctly implemented and consistent with the intended behavior.cmd/move/move.go (6)
52-52
: Declaration offlagCompilerVersion
is appropriate.The constant is well-named and consistent with existing flag declarations.
53-53
: Declaration offlagLanguageVersion
is appropriate.The constant is well-named and consistent with existing flag declarations.
618-618
: Addition offlagCompilerVersion
to command flags is appropriate.The flag is added with a clear description and a reasonable default value.
619-619
: Addition offlagLanguageVersion
to command flags is appropriate.The flag is added with a clear description and a reasonable default value.
727-732
: Integration offlagCompilerVersion
ingetBuildConfig
is correct.The flag is retrieved with error handling and correctly added to the build configuration options.
733-738
: Integration offlagLanguageVersion
ingetBuildConfig
is correct.The flag is retrieved with error handling and correctly added to the build configuration options.
the value of `ResourceSeparator` has been changed to 1 see initia-labs/initia#248 for details
## Description The value of `ResourceSeparator` has been changed to `1` in Initia. See initia-labs/initia#248 for details Closes: MILK-105 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist *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.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
## Description The value of `ResourceSeparator` has been changed to `1` in Initia. See initia-labs/initia#248 for details Closes: MILK-105 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist *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.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit 72d59a2)
Description
Closes: #XXXX
Author Checklist
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.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...