Utilize leftover dust in conversions.#4287
Merged
mergify[bot] merged 2 commits intomainfrom Feb 5, 2025
Merged
Conversation
2d68670 to
6d5c700
Compare
6d5c700 to
c97f79d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4287 +/- ##
==========================================
- Coverage 74.03% 74.03% -0.01%
==========================================
Files 345 345
Lines 110047 110046 -1
==========================================
- Hits 81476 81472 -4
- Misses 28571 28574 +3 ☔ View full report in Codecov by Sentry. |
3 tasks
sug0
approved these changes
Feb 3, 2025
grarco
approved these changes
Feb 3, 2025
batconjurer
approved these changes
Feb 4, 2025
3 tasks
mergify bot
added a commit
that referenced
this pull request
Feb 5, 2025
Utilize leftover dust in conversions. (backport #4287)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe your changes
An attempt to address the reported bug where users' MASP balances are potentially underestimated. This bug is caused by
compute_exchanged_amountnot attempting to consolidate dust and apply conversions on that. This PR attempts to address this issue by always bringing relevant dust back intoinputbefore attempting a conversion. Under the assumption that the ledger's current epoch does not change during applying conversions, this code algorithm should terminate because:output(so that output is greater than before) progressing the loop in the processoutputagain. Hence the (one-way) conversion progresses the loop.Checklist before merging
breaking::labelsnamada-docsreponamada-indexerornamada-masp-indexer, a corresponding PR is opened in that repo