kleros-v2
kleros-v2 copied to clipboard
Allow Dispute Kits to unstake ineligible jurors
Problem
For the 1 Human 1 Vote Dispute Kit, it is possible that some large staked jurors might not be registered on Proof of Humanity. In such a case, they would end up being drawn often from the sortition tree but later filtered out. It is highly inefficient and costly.
Proposed solution
Some team members have suggested that KlerosCore should allow a DisputeKit to unstake such ineligible jurors as follow:
https://github.com/kleros/kleros-v2/blob/51ec1d2894560781371fa8ca97e2b5f08311bed3/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol#L233-L241
https://github.com/kleros/kleros-v2/blob/51ec1d2894560781371fa8ca97e2b5f08311bed3/contracts/src/arbitration/KlerosCore.sol#L481-L487
Analysis
A) If there are 2 Dispute Kits with different eligibility criteria using the same subcourt
Then one Dispute Kit might decide to unstake a juror while this juror is still eligible in the other Dispute Kit. It would be unfair to the juror as he would miss some opportunities. There is no easy way to prevent that.
B) Should unstaking ineligible jurors take place in the usual Staking phase?
- Yes because that's what phases are made for. But then the juror could re-stake immediately after.
- No and by-pass the DelayedStakes to prevent the juror from re-staking immediately after, but this might still happen if it takes more than maxDrawingTime to draw and KlerosCore cycles through the phases. In addition it breaks the design of the phases and creates a new path for unstaking.
This issue should be viewed as an optimisation which benefits the bot operators. It does not benefit the end users with either better functionality or performance.
For now we are waiting for more clarity on the possibility of making the sortition sum tree more modular #137 + the possibility of simplifying the phases in Kleros Core.
#137 has been implemented so we can revisit this.
Unstake ineligible jurors from court X:
- only during Staking phase
- and only if they are ineligible from all the DisputeKits allowed by the court in question.

Currently we cannot iterate through the dispute kits to implement this logic.
Worst case just unstake without checking all the DKs.
Easier to implement now after #1357