Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRA-617] Integrate PML and Megavault #2331
[TRA-617] Integrate PML and Megavault #2331
Changes from all commits
25d99e0
a03943b
c6bb787
3c6074a
d40ab11
84f1ebb
e1d0d6c
a2bcb7b
68f7397
2e94210
f82e1a6
ab9aebd
9aa85a3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
💡 Codebase verification
ExportGenesis Function Missing ListingVaultDepositParams
The
ExportGenesis
function does not includeListingVaultDepositParams
, which prevents the export of the newly set parameters.Action Required:
ExportGenesis
function to includeListingVaultDepositParams
in the returned genesis state.Example update:
Analysis chain
LGTM with suggestions for improvement
The addition of
SetListingVaultDepositParams
aligns well with the PR objectives of integrating Megavault into PML. The error handling is consistent with the existing pattern in the function.Suggestions for improvement:
ExportGenesis
function to include the newListingVaultDepositParams
in the returned genesis state.Consider updating the
ExportGenesis
function as follows:To ensure the correctness and completeness of the implementation, please run the following verification:
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 3965
Script:
Length of output: 304
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.
💡 Codebase verification
Additional
NewKeeper
Instances MissingvaultKeeper
ParameterThe verification revealed that only the
protocol/x/listing/keeper/keeper.go
file has been updated to include thevaultKeeper
parameter in theNewKeeper
function. Other modules still invokeNewKeeper
without this parameter, which may lead to inconsistencies or runtime issues.Modules to Address:
Analysis chain
LGTM. Verify NewKeeper usage across the codebase.
The changes to the
NewKeeper
function are consistent with the addition of theVaultKeeper
field to theKeeper
struct. The new parameter allows for proper dependency injection, which is good for modularity and testability.To ensure that all calls to
NewKeeper
have been updated to include thevaultKeeper
parameter, run the following script:Please review the output to confirm that all
NewKeeper
calls have been updated correctly.Also applies to: 45-45
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 47020
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.
Handle potential errors when retrieving vault deposit parameters
The function retrieves the vault deposit parameters without handling the case where they might be unset or invalid. If
GetListingVaultDepositParams
fails to retrieve valid parameters, it could lead to a panic or unintended behavior.Consider adding error handling to ensure that
vaultDepositParams
are valid:Or handle the case appropriately based on how
GetListingVaultDepositParams
behaves when parameters are missing.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.
Potential integer overflow when converting block height to
uint32
Casting
ctx.BlockHeight()
fromint64
touint32
may cause an integer overflow if the block height exceeds the maximum value of auint32
. This could lead to incorrect share lock expiration times.Consider using
uint64
for the lock expiration calculation to prevent overflow:And ensure that the
LockShares
method accepts auint64
parameter for the lock expiration block height.