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

db-sync delegation/rewards #465

Closed
dorin100 opened this issue Apr 23, 2021 · 3 comments
Closed

db-sync delegation/rewards #465

dorin100 opened this issue Apr 23, 2021 · 3 comments
Labels

Comments

@dorin100
Copy link
Collaborator

dorin100 commented Apr 23, 2021

  • delegate addresses and check the delegations in db-sync
  • wait for addresses to get rewards and check the rewards in db-sync
  • withdraw the rewards and check the results in db-sync
  • undelegate address and check the results in db-sync
  • redelegate address to a different pool (in same/different epoch) and check the results in db-sync
  • delete/retire pool and check the delegated address in db-sync
  • check the rewards received by a stake address from multiple sources - Multiple rewards streams #413
@ArturWieczorek
Copy link
Collaborator

Check orphaned rewards

Currently db-sync maintains its own copy of ledger state.
One of the uses of this ledger-state is to populate the Reward table which contains (addr_id, amount, epoch_no, pool_id, block_id)
However the data retrieved from legder-state includes rewards for stake addresses that have been de-registered (which means the rewards go back to the reserves) and are hence invalid (see issue: The rewards was distributed to non-registered stake address )

Pool profitability calculation requires the inclusion of the rewards for these invalid addresses and to solve that issue an OrphanedReward table was added that contains the same columns as the Reward table so that by consulting both tables, pool profitability can still be calculated.

orphaned rewards occur when a stake address earns rewards in epoch N but has been de-registered before the rewards can be distributed at the start of epoch N + 2

orphaned_rewards do not get paid out but get sent back to the reserves.

@dorin100
Copy link
Collaborator Author

most probable orphaned_rewards table will be removed at some point so we should not spend time on automating it for the moment;

the other above actions are good candidates to automation

@mkoura
Copy link
Collaborator

mkoura commented Jan 10, 2022

All the mentioned checks are already implemented and used in tests.

@mkoura mkoura closed this as completed Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants