-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider automatic rebaging when rewards are received or slashes happen #442
Comments
@gpestana this will be closed by the end of having target list fully implemented. |
@gpestana can you confirm if this is the case? |
Automatically rebaging of nominators can be done by the stake-tracker pallet #1933. The only downside I see is the extra costs of the score update and potential rebaging of the nominator node for each nominator's stake update. OTOH, it may improve the security as it does not require nominators to explicitly rebag to get the max nominator stake as possible in the snapshot. I will make sure the rebaging happens for nominators too in stake-tracker and close this issue once #1933 is merged.
What are your concerns, if any, of using the stake-tracker to keep the voter list sorted? |
My only concern is weight. Given that the stake-trakcer is now recording everything, a potential reward payout can possibly be pretty big. Do you have an estimate of how big the weight of a |
I calculated the overhead of keeping both target and voter lists sorted at payout time and did some back of the envelope calculations wrt to the overhead per operation. The TL;DR; is:
More details here https://hackmd.io/FH8Uhi2aQ5mD0aMm-BbqMQ |
Thanks for the write-up and calculations, very informative! A couple of comments:
|
This number was obtained in a few recent eras in Polkadot. Not very demonstrative of the worst case scenario.
I'd expect to be relatively expensive to perform an attack that relies on the voter/target list rebaging due to rewards. The main reason being that the exposed nominators per validator need to be high, which means that the attacker would have to bond multiple nominators. On the other hand, even if it's relatively cheap to perform this attack, there are two factors that help preventing the attack: 1. In general, a reward per era should not be high enough to trigger a voter/target rebagging for each tuple of (validator, nominator) in exposed to an era. moreover, 2) we have ultimate control over the number of exposures per pages, so we can be conservative and make the number of exposures/pages relatively low. To confirm the assumptions above, I'll improve the estimates and costs to get a better and more realist number of the weight overhead of keeping the target and voter list up to date at rewards/slashing, given diff conditions. But at this point I'm inclined to say that there is no fundamental problem with keeping target and voter list always sorted, given the paged exposure implementation and the staking <> stake-tracker integration (and an eventual pagination of slashes). |
Currently, we don't rebag nominators to the correct bag after rewards and slashes.
As of paritytech/substrate#12645, we would have to keep track of validators as well in a bags-list, and they would HAVE TO BE ACCURATE, both for rewards.
Perhaps we should do the same for nominators too.
The text was updated successfully, but these errors were encountered: