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
feat(x/gov): limit deposited coins to accepted proposal denom #18189
feat(x/gov): limit deposited coins to accepted proposal denom #18189
Changes from 2 commits
edffa7c
39a4d9c
9239dd5
c210001
601a1f2
11f1eaf
585e0d8
fd6ef30
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.
can we add a godoc and a mention in the readme about this feature.
If a user sends a valid token and invalid token the tx will be rejected, etc
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.
Added 👍🏾
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.
The new function
validateDepositDenom
is introduced to validate the deposit denomination against the accepted denominations specified in the governance parameters. This is a good addition as it ensures that only valid denominations are accepted for deposit. However, the error message in line 280 and 285 could be more informative by specifying which denomination(s) are invalid.[USER_EXPERIENCE]
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.
won't do, as it requires looping through the whole depositAmount, which could be very big.
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.
@julienrbrt I understand your concern about the potential performance impact of looping through a large
depositAmount
. However, it's important to note that the loop is already present in the current implementation to validate each coin in thedepositAmount
against theacceptedDenoms
.The suggestion was to enhance the error message by including the invalid denominations, which would require storing these invalid denominations during the existing loop. The additional cost would be the storage of these invalid denominations, which is relatively small compared to the cost of the loop itself.
That being said, if the size of
depositAmount
is expected to be significantly large, and performance is a critical concern, it might be better to stick with the current implementation. The trade-off here is between a more informative error message and the potential performance impact.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.
Oh wow, you can respond. Amazing.
Yes, performance is a concern.
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.
@julienrbrt I understand. Performance is indeed a critical aspect to consider, especially in systems handling large amounts of data. In this case, maintaining the current implementation without the additional storage and processing for invalid denominations is a reasonable decision. It's always important to balance the trade-offs between user experience and system performance. Thank you for your clarification.