Only slash the funds that participated the misbehavior
In the current implementation, all the PendingDeposit and PendingNominatorUnlocks will be slashed, this seems unfair:
- For
PendingDeposit, the nominator's stake has not participated in the staking yet but got slashed due to the misbehavior that was conducted by the operator previously. - For
PendingNominatorUnlocks, suppose the nominator issue withdraws at domain block#10and the operator gets slashed due to submitting a fraudulent ER of domain block#100, the nominator's withdrawal may still get slashed but the misbehavior is conducted after the nominator's withdrawal is exited from staking thus this withdrawal is innocent in some sense.
So we should not slash PendingDeposit and only slash PendingNominatorUnlocks that are created after the misbehavior.
This is "nice to have". Staking on someone is a risk, this edge case removes only a tiny bit of risk in a single edge-case. Not worth spending effort on this, I'm not even sure it should ever be fixed.
Yeah, the risk is inevitable but it certainly brings a better UX.
If we get back to this we should think more on security implications before implementing. For example an operator may withdraw a part of stake before committing a fraud so he loses less money by committing the fraud.
If an operator decided to withdraw funds and then wait for funds to be unlocked and then proceed to conduct malicious behavior, then there is nothing protocol can do and technically those funds were not part of staking/ unlocking at the time fraud proof is submitted.
Currently, our implementation does not slash funds that deposited but not finalised since epoch did not finish and technically never part of staking until epoch
For example an operator may withdraw a part of stake before committing a fraud so he loses less money by committing the fraud.
To add to @vedhavyas comment, if they withdraw stake before committing fraud then they would have less opportunity to commit fraud due to smaller stake, which seems appropriate.