Skip to content
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

Increase the accuracy of rewards by minting based on the real reward. #4369

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

murisi
Copy link
Collaborator

@murisi murisi commented Feb 12, 2025

Describe your changes

This PR is an attempt to slightly mitigate #4372 by reducing the amount of unclaimable rewards created by the rewards algorithm. The approach taken is to try and reduce the amount of NAM minted for non-native tokens so that it's closer to what can actually be claimed. And this reduction is achieved by minting NAM based on the deflated rewards for non-native tokens (which is what is actually put into the allowed conversions) rather than the inflated rewards they are based on. Because clients can combine (deflated) reward NAM[0] with pre-existing NAM[0] in their balance to meet the threshold for conversion to the current epoch and because the distribution algorithm now works with deflated amounts, it no longer ignores the dust arising during the mint amount computations.

To see the impact of this PR, note that the dust left at the MASP address after all shielded tokens are unshielded in https://github.com/anoma/namada/pull/4369/files#diff-78668f42dcc983dea532ff370112f41796cfae99510ea10156df37c4e1e4e0d2L2285 has gone down from nam: 0.003216 to nam: 0.000012.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.53%. Comparing base (f037759) to head (d413757).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
crates/shielded_token/src/conversion.rs 96.36% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4369   +/-   ##
=======================================
  Coverage   74.53%   74.53%           
=======================================
  Files         339      339           
  Lines      110504   110524   +20     
=======================================
+ Hits        82359    82377   +18     
- Misses      28145    28147    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@murisi murisi force-pushed the murisi/increase-masp-minting-accuracy branch from 147c124 to d5da654 Compare February 13, 2025 10:39
@batconjurer batconjurer self-requested a review February 13, 2025 13:49
@murisi murisi added the do-not-merge Do not merge for now label Feb 14, 2025
@murisi murisi force-pushed the murisi/increase-masp-minting-accuracy branch from d5da654 to d413757 Compare February 26, 2025 13:11
@github-actions github-actions bot added the backport-libs-0.149 Backport libraries to 0.149 maintenance branch label Feb 26, 2025
@murisi murisi requested a review from tzemanovic February 27, 2025 06:06
@murisi murisi removed the do-not-merge Do not merge for now label Feb 27, 2025
@tzemanovic tzemanovic added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Feb 27, 2025
mergify bot added a commit that referenced this pull request Feb 27, 2025
@mergify mergify bot merged commit 395b2ba into main Feb 27, 2025
27 of 28 checks passed
@mergify mergify bot deleted the murisi/increase-masp-minting-accuracy branch February 27, 2025 17:33
mergify bot added a commit that referenced this pull request Feb 27, 2025
Increase the accuracy of rewards by minting based on the real reward. (backport #4369)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-libs-0.149 Backport libraries to 0.149 maintenance branch MASP merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants