You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The delegation contracts assume that delegators start contributing to the rewards earned by the validator from the point when they delegate their stake. However, this is not true since the delegated stake is only added to the validator's deposit in the epoch after next. Smilarly, the contracts assume that unstaking has immediate effect on the validator's deposit i.e. the delegator's contribution to the rewards earned by the validator are decreased accordingly. This is also not correct and it could be misused by delegators to maximize their share of the rewards at the expense of other delegators by staking in the first and unstaking in the last block of an epoch and thereby receiving a share of the rewards for up to 3599 additional blocks during which they were not contributing to the rewards earned by the validator.
For instance, a staker who delegated 10% of the total deposit of a validator who controls 10% of the total stake (at the current staking ratio this amounts to 52m ZIL), could earn up to 3599 * 51000 / 3600 * 0.1 * 0.1 ~ 510 ZIL additionally. The draining attack can be repeated every 14,400 blocks i.e. 4 hours.
One way of restoring fairness is to introduce a bonus/malus based on the staking block.number % 3600 and the unstaking block.number % 3600.
The text was updated successfully, but these errors were encountered:
DrZoltanFazekas
changed the title
Incorrect reward attribution due to stake (de)activation delayed by up to 2 epochs
Distorted reward attribution due to stake (de)activation delayed by up to 2 epochs
Dec 13, 2024
The delegation contracts assume that delegators start contributing to the rewards earned by the validator from the point when they delegate their stake. However, this is not true since the delegated stake is only added to the validator's deposit in the epoch after next. Smilarly, the contracts assume that unstaking has immediate effect on the validator's deposit i.e. the delegator's contribution to the rewards earned by the validator are decreased accordingly. This is also not correct and it could be misused by delegators to maximize their share of the rewards at the expense of other delegators by staking in the first and unstaking in the last block of an epoch and thereby receiving a share of the rewards for up to 3599 additional blocks during which they were not contributing to the rewards earned by the validator.
For instance, a staker who delegated 10% of the total deposit of a validator who controls 10% of the total stake (at the current staking ratio this amounts to 52m ZIL), could earn up to
3599 * 51000 / 3600 * 0.1 * 0.1 ~ 510
ZIL additionally. The draining attack can be repeated every 14,400 blocks i.e. 4 hours.One way of restoring fairness is to introduce a bonus/malus based on the staking
block.number % 3600
and the unstakingblock.number % 3600
.The text was updated successfully, but these errors were encountered: