-
Notifications
You must be signed in to change notification settings - Fork 709
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 removing/simplifying SlashingSpans
and SpanSlash
from staking pallet
#2650
Comments
Archived PR introducing that logic: paritytech/substrate#3846 Archived PR links to a now removed paper explaining the design, but pretty sure that's the paper in question: https://github.com/w3f/research/blob/master/docs/Polkadot/security/slashing/npos.md After my initial reading it seems like the system changes so drastically since its inception that the slashing span logic is mostly redundant. Nevertheless they present some properties which could still prove useful to maintain for our new strategy. Main point of interest is if this assumption/goal still holds:
Above is the problem of overslashing right? Just to make sure I understand with an example: There seems to be some focus on the past era slashing which somewhat complicates maintaining the above property as we can slash someone during era e and then find some more offences in e+1 which would warrant extra slashes. Those slashes if applied cumulatively with the ones from e could easily exceed the base nominators' exposure. Although since all of our slashes are deferred by 27 eras (unbonding period) then can't we simply adjust the actual slash amounts that will be applied once we are sure everything in this era is finalized? Might me missing some crucial detail so call me out. |
We could go through the document piece by piece and descide what still feels relevant. It'd be useful to reconstruct whatever recently looked useful for parachains too, but maybe that's why deferred slashing kept coming up. Anyways.. Yes, we do not want slashes to exceed exposure for several reasons, including (*) below. We've agreed on deferred slashing, yes? If so, yes we could simplify things by using deffered slashing I guess. How exactly? We'd have spome deffered slashing queue, nominators are eligable for fast unstaking only if not in the queue, and fast unstaking still need some time like 24 hours, so all slashes should appear in the queue almost a full unbonding period before being applied. All slashed account have a slashing log which contains the amount, validator, and slashing time. After the unbonding period aka 27 days, we process an individual slash maybe like this:
We'd discussed 100% slashed of course, but this document predates parachains, so it focuses upon equivocation offenses in babe and grandpa. In particular, approvals breaks this statement "only minimal concerns about multiple miss-behaviours from the same validator in one era", so soundness slashes could handle some max differently, but being 100% makes this unimportant. (*) We do like when information about who control what DOTs surfaces through the slashing system. We could've the opposite perspective ala zk staking, but we do have whales so that's quite a big trade off. We've another concern here about overworking NPoS too, meaning it sucks if you can protect yourself by making NPoS slower. |
Yes. The only point of contention was BEEFY but we did not handle that case (yet). It's a separate issue. All other offences will be deferred based on the un-bonding period IIRC. Not sure I follow the design so let me reiterate some items: We have a slashes/offences queue. Things are added to the queue chronologically so we also consume them in that order. Each item is processed 27 days after it is added. Queue holds the unprocessed offences. There is a slashing log which contains your slashes which are cleared 27 days after being added. Example:Mostly for my own sanity in understanding it. Example NPoS solution state:
Example log state (nom1 perspective):
we have two values of m:
Example queue state:
when
We update the slash log (nom1 perspective):
We compute QuestionsDo we even need slow 28 days un-bond at this point? Honest people if queue is empty can simply fast unstake. Slashed users can submit their slow un-bond sure but it will execute only after 27 days. If they did it a few days after their offence it will execute a few days after they are penalised. At this point they could've waited for the fast-unstake after the queue is emptied and the slash is applied. Never using 28 days un-bond is literally optimal in every single scenario. TLDRApply slashes 27 days after depositing them. |
It's overly complex anyways, and tracking validator-nominator pairs suck. It also ignores one important detail. All equivocation slashes determine their maximum slash level by correlation. Individually grandpa or babe equivocations matter little, so we slash maybe 0% but if many happen together then this precentage rises, until 100% in grandpa maybe. Instead of simple maximums, we slash half of the incoming slash minus the total slashed in the slash log. We could avoid tracking validator-nominator pairs too I think: A validator v havhase a slashing log L = {(p,t)} which contains the precentage and time. After the unbonding period aka 27 days, we process an individual slash maybe like this:
In this, we largely ignore that multiple validators nominate the same validator. If V first gets A slashed, and then gets B slashed later, then B benefits dramatically from A being slashed first. Although unfortunate, I'm not sure this matters so much. We coul do some similar computation on the the nominator side instead I guess, which afaik fixes this but causes other concerns, not sure the best options right now. |
TODOs:
|
SlashingSpans
and SpanSlash
from staking palletSlashingSpans
and SpanSlash
from staking pallet
Currently
SlashingSpans
andSpanSlash
are used only for keeping track if a validator needs to be chilled on an offence or not. FurthermoreSpanSlash
keeps track of slash and reward amount viaSpanRecord
but this values are never used. Also after #1962 is merged offenders no longer will be chilled in favour of disabling them.Consider if slashing spans are used for a case I am missing or they can be completely removed.
cc @gpestana
The text was updated successfully, but these errors were encountered: