As per the natspec in function FjordStaking::addRewards
:
However, since new stakers have a financial incentive to claim rewards, they can exploit this by frontrunning the addReward
function call to trigger an epoch rollover. As a result, the newly added rewards are credited in the next epoch, allowing the new staker to unjustly earn a portion of the rewards.
Rewards added during an epoch are intended to be distributed among users who have staked their tokens for the entire duration of that epoch. However, a flaw in the system allows new stakers to manipulate the process. By frontrunning the addRewards
transaction, new stakers can trigger an epoch rollover, ensuring that the rewards intended for long-term stakers are also distributed to them. This creates a perverse incentive that undermines the core principle of staking, which is to reward long-term commitment.
Consider the following scenario:
Just one second before epoch 6 ends, Alice stakes 10 ether.
Immediately after the epoch ends, the reward admin submits a transaction to add rewards to the staking contract.
Alice notices this transaction in the mempool and decides to front-run it by staking an additional 1 wei and paying a higher gas fee to prioritize her transaction. This triggers an epoch rollover, advancing the contract to epoch 7.
The reward admin's transaction is then processed, and the rewards are added for epoch 7.
As a result, Alice is now entitled to claim a portion of the rewards. This situation is unfair to the other stakers, who kept their tokens locked for the entire epoch, while Alice only staked for a few seconds. This behavior undermines the fairness and integrity of the staking process.
Place in addReward.t.sol
.
Manual review.
Check if the rewarder admin action triggered an epoch rollover, if it didn't, revert:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.