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
Foundry recently had a large delegation to our validator. We noticed that the delegator instantly started earning rewards, even though the stake weight of the pool had not yet increased. It seems like the new stake doesn’t become active for a few epochs, but instantly starts earning a share of the rewards (which in turn decreases rewards for all other delegators).
This is a massive problem as the delegators are 2 separate parties. It seems like a malicious delegator could abuse this mechanism to constantly take rewards from other innocent delegators.
What is even more confusing is that the new delegator earned rewards in epoch 2657 and 2658, but no other delegator saw decreased rewards until epochs 2659 and 2660 (and all delegators including the new one saw decreased rewards during those 2 epochs).
Where are the extra rewards during 2657 and 2658 coming from?
Why were rewards decreased in 2660 if the new stake was active and earning rewards at that point?
Why does the pool size increase in epoch 2658 but rewards don't increase until epoch 2660?
Version
1.40.0
Node type
RPC (Default)
Are you a validator?
I am a validator.
Relevant log output
Not relevant
Node head info
Not relevant
Node upgrade history
Not relevant
DB reset history
Not relevant
The text was updated successfully, but these errors were encountered:
While this is not precise, it's by design. This is how the staking pool was implemented.
The main reason is the stake proposal becomes active only after 2 epochs, so for the 2 epochs the rewards are given for the previous stake amount, while the pool size has increased.
The new delegated stake immediately receives staking pool shares and the portion of the rewards from the next epoch. What's also the case is the pool will receive the rewards for the 2 epochs after any delegator unstakes. So if a large delegator unstakes, the remaining pool delegations will share the rewards for the previous stake amount for the 2 epochs, but the unstaked delegator doesn't. So it's not possible to abuse the rewards this way without having to unstake.
Example:
Initially pool has 10K NEAR and receives 10% APY.
A large delegator comes in and stakes 90K NEAR.
For the next 2 epochs, the pool will effectively receive 1% APY, because their stake is now 100K, but rewards are only for the 10K
Next, the APY is back to 10% for the rewards of the total stake of 100K.
The large delegator decides to unstake 90K.
For the next 2 epochs, the rewards are coming for 100K stake, but distributed across 10K delegations. This makes effective 100% APY.
The large delegator can withdraw and APY is back to 10% on 10K rewards.
This seems like very poor design. If the large delegator stakes for a long time, any delegator that has to unstake before they do will never see those extra rewards on the back end. Why not just delay rewards to the new delegator for 2 epochs?
Contact Details
[email protected]
What happened?
Foundry recently had a large delegation to our validator. We noticed that the delegator instantly started earning rewards, even though the stake weight of the pool had not yet increased. It seems like the new stake doesn’t become active for a few epochs, but instantly starts earning a share of the rewards (which in turn decreases rewards for all other delegators).
You can see the delegator staked in epoch 2657, and instantly earned rewards during that epoch. https://nearscope.net/delegator/4855ba0899d235ab059689db02686e6574cf1a70d10bbc77ed0d82d1d9b07b16/tab/rewards
However, our validator didn't see an increase in total rewards until epoch 2660. https://nearscope.net/validator/foundry.poolv1.near/tab/rewards
This is a massive problem as the delegators are 2 separate parties. It seems like a malicious delegator could abuse this mechanism to constantly take rewards from other innocent delegators.
What is even more confusing is that the new delegator earned rewards in epoch 2657 and 2658, but no other delegator saw decreased rewards until epochs 2659 and 2660 (and all delegators including the new one saw decreased rewards during those 2 epochs).
Version
Node type
RPC (Default)
Are you a validator?
Relevant log output
Node head info
Node upgrade history
DB reset history
The text was updated successfully, but these errors were encountered: