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

Staking reward inaccuracy #875

Closed
sander2 opened this issue Jan 23, 2023 · 0 comments · Fixed by #888
Closed

Staking reward inaccuracy #875

sander2 opened this issue Jan 23, 2023 · 0 comments · Fixed by #888
Labels
bug Something isn't working

Comments

@sander2
Copy link
Member

sander2 commented Jan 23, 2023

When calculating the staking rewards, we use the rounded stake. While there is no nomination, that should be fine since stake will always be an integer. However, with nomination enabled, slashing can result in non-integer stakes. See:

let stake =
SignedFixedPoint::<T>::checked_from_integer(Self::compute_stake_at_index(nonce, vault_id, nominator_id)?)
.ok_or(Error::<T>::TryIntoIntError)?;

I have a fix for this in a wip branch but it needs cleanup. Since there is a known bug in staking anyway that blocks nomination from being enabled, this fix has low prio.

@sander2 sander2 added the bug Something isn't working label Jan 23, 2023
@nud3l nud3l added this to Backlog Jan 23, 2023
@github-project-automation github-project-automation bot moved this to New 🆕 in Backlog Jan 23, 2023
@nud3l nud3l moved this from New 🆕 to Todo ⏳ in Backlog Jan 24, 2023
@github-project-automation github-project-automation bot moved this from Todo ⏳ to Done ✅ in Backlog Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant