kleros / kleros-v2

Kleros version 2
https://v2.kleros.builders
MIT License
61 stars 43 forks source link

Allow Dispute Kits to unstake ineligible jurors #98

Open jaybuidl opened 2 years ago

jaybuidl commented 2 years ago

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?

jaybuidl commented 2 years ago

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.

jaybuidl commented 1 year ago

137 has been implemented so we can revisit this.

Unstake ineligible jurors from court X:

image

jaybuidl commented 1 year ago

Currently we cannot iterate through the dispute kits to implement this logic.

Worst case just unstake without checking all the DKs.

jaybuidl commented 7 months ago

Easier to implement now after #1357