Delegator slashing
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
At the moment, when a transcoder [faults](https://github.com/livepeer/wiki/blob/master/SPEC.md#faults), the transcoder is slashed, but its delegators are not. We can create a stronger incentive for delegators to delegate toward quality transcoders that do not fault (whether it be purposefully or accidental due to a client malfunction) by also applying slashing penalties to a transcoder's delegators.
The BondingManager contract can keep track of the blocks at which a transcoder was slashed in a manner similar to the description for this [comment](https://github.com/livepeer/LIPs/pull/8#issuecomment-393993719) and if a transcoder is slashed, the slashing penalty will be immediately applied to the transcoder's total stake, but will not be immediately applied to its own stake. Instead, the slashing penalty will be applied to all delegators of a transcoder (since the transcoder is also a delegator the slashing penalty will also be applied in this case) when they claim earnings through the round in which the transcoder was slashed. If the transcoder called `BondingManager#reward()` during the round, a delegator will first credit its stake with its reward share for the round. Then, if the transcoder was slashed during the round, the tracked slashing penalty is applied to the delegator's stake. Note: if the transcoder was slashed before it called `BondingManager#reward()` the order of these steps still works because the delegator would be credited with 0 reward shares for the round and then the slashing penalty would be applied to the delegator's stake. At the end of these steps, if the transcoder was slashed, a delegator's stake will be reduced by the same slashing percentage that the transcoder's total stake was reduced by when it was first slashed. Since we apply the slashing penalty to a delegator's stake for the round during which the slash occurred and since delegators cannot execute bonding related actions i.e. `BondingManager#bond()`, `BondingManager#unbond()` unless they have claimed all earnings through the current round the delegator's stake should always reflect any slashing penalties from being delegated to a transcoder that faulted at the time of rebonding or unbonding.
An example:
Let Alice be a transcoder with a total delegated stake of 100 LPT with 20 LPT delegated towards itself. Alice's reward cut is 0% meaning that she does not keep any rewards for herself as a transcoder (she still can claim reward shares as a delegator towards herself). Let Bob be a delegator with 20 LPT delegated toward Alice. Let Eve be a delegator with 60 LPT delegated toward Alice.
- Alice calls `BondingManager#reward()` in round 100, minting 100 LPT which is placed in the reward pool for round 100 and increases her total delegated stake to 200
- Alice calls `BondingManager#reward()` in round 101, minting 100 LPT which is placed in the reward pool for round 101 and increases her total delegated stake to 300
- In round 101, Alice is slashed for double claiming a segment. Let the slashing percentage for double claims be 20%
Alice's total delegated stake becomes `300 - (300 * .2) = 240` and she is kicked out of the transcoder pool.
Alice wants her remaining LPT so she automatically claims earnings through round 101 when she unbonds:
- For round 100, Alice's stake represents `20 / 100 = .2` of the total delegated stake. After claiming earnings through round 100, Alice's stake = `20 + (100 * .2) = 40`
- For round 101, Alice's stake represents `40 / 200 = .2` of the total delegated stake. After claiming earnings through round 101, Alice's stake = `40 + (100 * .2) = 60`
- After applying the 20% slashing penalty, Alice's stake = `60 - (60 * .2) = 48`
Eve wants her remaining LPT so she automatically claims earnings through round 101 when she rebonds to another transcoder:
- For round 100, Eve's stake represents `60 / 100 = .6` of the total delegated stake. After claiming earnings through round 100, Eve's stake = `60 + (100 * .6) = 120`
- For round 101, Eve's stake represents `120 / 200 = .6` of the total delegated stake. After claiming earnings through round 101, Eve's stake = `120 + (100 * .6) = 180`
- After applying the 20% slashing penalty, Eve's stake = `180 - (180 * .2) = 144`
Bob wants his remaining LPT so he automatically claims earnings through round 101 when he rebonds to another transcoder:
- For round 100, Bob's stake represents `20 / 100 = .2` of the total delegated stake. After claiming earnings through round 100, Alice's stake = `20 + (100 * .2) = 40`
- For round 101, Bob's stake represents `40 / 200 = .2` of the total delegated stake. After claiming earnings through round 101, Bob's stake = `40 + (100 * .2) = 60`
- After applying the 20% slashing penalty, Alice's stake = `60 - (60 * .2) = 48`
At this point, the sum of the stakes of Alice, Eve and Bob = 48 + 144 + 48 = 240 which is Alice's total delegated stake as a transcoder after she is slashed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the BondingManager contract and trace reward(), bond(), and unbond(), then read the linked SPEC faults section and LIPs pull request comment. Done means slashing records are tracked and delegator stakes receive the specified penalty when earnings are claimed through the slash round, while the described stake totals remain consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100