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

Reward Calc Wart #999

Closed
1 task
dorin100 opened this issue Mar 29, 2022 · 6 comments
Closed
1 task

Reward Calc Wart #999

dorin100 opened this issue Mar 29, 2022 · 6 comments

Comments

@dorin100
Copy link
Collaborator

dorin100 commented Mar 29, 2022

info

I am not sure what we (Node QA team) can test here. Waiting for more details from Vitor.

  • Scenario 1
Start with a registered stake credential which is earning rewards.
De-register the stake credential (you'll need to withdraw the rewards in order to do this) before 4k/f-many slots have elapsed in the current epoch (k is the security parameter, f is the active slot coefficient, 4k/f is equal to two days on mainnet).
Re-register the stake credential after 4k/f many slots have elapsed in the epoch.
Check that this stake credential received rewards at the epoch boundary. 
@JaredCorduan
Copy link

Note that there are actually two reward warts. Descriptions of both can be found in the Shelley Spec, see section 17.1 and 17.2 (in the appendix). The one in 17.2 is the one that we fixed in Babbage.

The github issue for 17.2 is IntersectMBO/cardano-ledger#2477
The github pull request to fix 17.2 is IntersectMBO/cardano-ledger#2569

To test that 17.2 is indeed fixed in babbage:

  • Start with a registered stake credential which is earning rewards.
  • De-register the stake credential (you'll need to withdraw the rewards in order to do this) before 4k/f-many slots have elapsed in the current epoch (k is the security parameter, f is the active slot coefficient, 4k/f is equal to two days on mainnet).
  • Re-register the stake credential after 4k/f many slots have elapsed in the epoch.
  • Check that this stake credential received rewards at the epoch boundary.

@mkoura
Copy link
Collaborator

mkoura commented Apr 28, 2022

We already have a test that de-register stake address at the beginning of an epoch and re-register the same address close to the end of the same epoch (it says "second half of an epoch" in the comment, but it is last 60 seconds out of 200 secs long epoch). In next epoch it checks that the stake address has NOT received rewards at the epoch boundary.
See https://github.com/input-output-hk/cardano-node-tests/blob/a86518aab2f8f80dd84117d7e3089c4c4a8407b7/cardano_node_tests/tests/test_staking_rewards.py#L1563-L1588

@dorin100
Copy link
Collaborator Author

Awesome! This means this test should automatically fail when moving to Vasil (because rewards will be paid to the stake address).

@dorin100 dorin100 changed the title Reward Calc Wart - draft Reward Calc Wart May 3, 2022
@mkoura
Copy link
Collaborator

mkoura commented May 26, 2022

I've just spent an hour debugging why the test is failing in Babbage 🤦‍♂️

@mkoura
Copy link
Collaborator

mkoura commented Jun 1, 2022

Done in #1107

@mkoura mkoura closed this as completed Jun 1, 2022
@JaredCorduan
Copy link

thank you @mkoura ! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants