Skip to content

Staking reward inaccuracy #875

@sander2

Description

@sander2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions