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

MASP rewards estimation #3974

Merged
merged 9 commits into from
Nov 14, 2024
Merged

MASP rewards estimation #3974

merged 9 commits into from
Nov 14, 2024

Conversation

batconjurer
Copy link
Member

Describe your changes

Adds a cli command to estimate the amount of MASP rewards that will be accumulated by the next epoch.
This is done by applying the latest set of conversions for each asset again.

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:

@batconjurer batconjurer force-pushed the bat/masp-reward-estimations branch from 542fb1a to 4c756bd Compare November 5, 2024 09:48
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 96.65698% with 23 lines in your changes missing coverage. Please review.

Project coverage is 74.12%. Comparing base (ce88362) to head (16ddaf3).
Report is 79 commits behind head on main.

Files with missing lines Patch % Lines
crates/shielded_token/src/masp/test_utils.rs 85.10% 21 Missing ⚠️
crates/core/src/masp.rs 90.00% 1 Missing ⚠️
crates/shielded_token/src/masp/shielded_wallet.rs 99.81% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3974      +/-   ##
==========================================
+ Coverage   73.95%   74.12%   +0.16%     
==========================================
  Files         341      341              
  Lines      106442   107130     +688     
==========================================
+ Hits        78718    79405     +687     
- Misses      27724    27725       +1     

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

@batconjurer batconjurer requested a review from grarco November 11, 2024 09:47
@batconjurer batconjurer requested a review from grarco November 11, 2024 16:26
@batconjurer batconjurer requested a review from grarco November 12, 2024 09:22
@@ -1397,6 +1416,27 @@ fn masp_incentives() -> Result<()> {
assert!(captured.result.is_ok());
assert!(captured.contains("nam: 0.063"));

// Assert the rewards estimate is a number higher than the actual rewards
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this comment mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a sanity check. The total amount of rewards issued for an asset should increase with each epoch. So estimations should reflect that.

Copy link
Collaborator

@brentstone brentstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thx for all the tests. Just left a question, and can you look over my very small cleanup commit 16ddaf3 before tagging this PR with merge?

@batconjurer
Copy link
Member Author

LGTM! Thx for all the tests. Just left a question, and can you look over my very small cleanup commit 16ddaf3 before tagging this PR with merge?

Looks good, thanks for fixing those!

@brentstone brentstone added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Nov 14, 2024
mergify bot added a commit that referenced this pull request Nov 14, 2024
@mergify mergify bot merged commit e768857 into main Nov 14, 2024
24 checks passed
@mergify mergify bot deleted the bat/masp-reward-estimations branch November 14, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants