-
Notifications
You must be signed in to change notification settings - Fork 983
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
Test enabling rewards after shielding and large amounts in the masp #3959
Conversation
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.
This is a review of just 1f05f77 . I think this approach is the way to go, thanks! Ah, I see the new MASP integration test is still failing. Let me see if I can spot the error...
My guess is that this issue is similar to having a shielded balance with the single note 1 [2^64 Wei] and trying to spend/send 1 [2^0 Wei] to another payment address. Though these two asset types concern the same underlying token, they are not convertible, and the MASP cannot use/break down the former amount (as far as I remember) to send the much smaller output. You would first need to unshield the 1 [2^64 Wei] note to get a transparent balance of 2^64 Wei, and then shield (2^64 - 1) [2^0 Wei] back to yourself and the other 1 [2^0 Wei] to your desired destination. So essentially the Insufficient funds
error would be correct in a sense. This is my guess based on how this test also broke #3954 ...
If the above guess is correct, then the resolution to this error is to adjust the amounts worked with in the new test to stop straddling the MASP digit boundaries. Or more adventurously, do the unshield-then-shield trick above. But I would lean towards the former solution and make a separate test to demonstrate the above inconvertibility behaviour.
1b41cbb
to
c1ef340
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3959 +/- ##
==========================================
- Coverage 73.99% 73.94% -0.05%
==========================================
Files 341 341
Lines 106614 106450 -164
==========================================
- Hits 78888 78715 -173
- Misses 27726 27735 +9 ☔ View full report in Codecov by Sentry. |
acafd29
to
c3ba7f7
Compare
@brentstone I think this PR might require some docs changes, because it changes the behavior of |
0u8.into(), | ||
)?; | ||
|
||
// Give Bertha some test tokens |
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.
Understatement of the year. Bertha has all of the tokens! 🤣
c3ba7f7
to
b771524
Compare
b771524
to
d923da9
Compare
d923da9
to
0a06602
Compare
0a06602
to
6cd9e94
Compare
// NB: the max reward rate needs to be quite big, to allow | ||
// the inflation being computed by the pd controller to | ||
// exceed the amount of test tokens in the masp | ||
max_reward_rate: Dec::from_str("999999999999999.0").unwrap(), |
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.
dayum
Describe your changes
Based on #3954 (DIFF)Rebases commits from #3954, therefore it essentially supersedes it.
This PR accomplishes the following:
To check the rest of the changes, check the description of #3954.
Checklist before merging
breaking::
labelsnamada-docs
reponamada-indexer
ornamada-masp-indexer
, a corresponding PR is opened in that repo