-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Lazy payouts #4407
Comments
CC @thiolliere |
Do you expect nominators to have to take any action, or do you only refer to validators here? I read this as validators only (triggering a payment to all their nominators) because:
That said, perhaps nominators should have a final appeal? E.g. if the limit is 100 eras, then a nominator can report a single validator after 90 eras and claim their reward share from that validator. |
Doing payouts lazily/passively is that it conflicts with rewards accruing onto the stash's bond. If we do it lazily, it would allow validators or nominators to dodge part of slashes. Let's say you have accrued X DOTs of potential rewards. If you trigger these rewards before an era in which you misbehave, you will be slashed out of If you trigger those rewards after the era where you're slashed, you'll be slashed only out of I don't see any easy workaround for this problem; it increases the complexity of the slashing code substantially because you would have to find a way to track the slashed portion of the potential reward across all slashing spans. |
i don't think it will matter in practise. the maximum amount of funds that would not be slashed will be around 4% of the annual (2 weeks/52 weeks), or, assuming 10% reward, 0.4% of your stake. that won't make much of a difference in terms of incentivisation. |
I chose my wording carefully. "Stakers". |
Currently, all payouts from an era are made actively at the end of the era. This is a big task and will only get worse as time goes on and the validator/nominator sets grow. Right now it takes so long that it's stalling the Kusama chain (#4313). It is also problematic as the immediacy conflicts with the fact that the session keys lag one session behind the actual staking selection, leading to the wrong validators being paid for one session in every era where the validation set changes (#4331, #4346 and #4220).
Instead, payouts should happen lazily/passively.
The Session module should, at the end of a session, report the accrued points of each validator together with the era number that the validator set is from back up to the Staking module, giving it full information about which validators should be rewarded. (It should explicitly report so that the number of sessions that the validator set lags behind continues to be immaterial for the Staking module.)
The Staking module should should retain a
last_payout_era
value for all staked accounts, and should keep a number of past instances of the exposure information on-chain (e.g. last 100 eras) as well as the historical validator points for each session.There should then be an explicit payout function which pays out any balance owed, taking into account all of the above information. Stakers would need to call it occasionally (at least once every 100 eras =~ 2 weeks on Kusama) to avoid missing out on their rewards.
This will fix #4121, #4331, and #4220 as well as help with #4313 . This fix will supersede #4346.
The text was updated successfully, but these errors were encountered: