kleros / kleros-v2

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

disableSubcourt() function for the Governor only #97

Open jaybuidl opened 2 years ago

jaybuidl commented 2 years ago

Problem

In KlerosLiquid there is no way to force jurors to unstake even for the Governor. This is problematic in 2 cases:

In both cases, it is likely that some users will never unstake. Therefore some PNK will remain staked, which may hinder some operations.

Solution

Operational considerations

When using this function, the governor should have previously changed the subcourt parameters to make it impossible to create new disputes in the subcourt to disable. Wait for the on-going disputes to resolve. Then let the Governor execute disableSubcourt(). Otherwise some locked tokens may remain, that would require calling disableSubcourt() again at a later time.

jaybuidl commented 2 years ago

Relates to #98 which is more a Dispute Kit specific optimization to draw jurors more efficiently.

jaybuidl commented 2 years ago

@unknownunknown1

unknownunknown1 commented 2 years ago

The simplest solution to this is to mark a specific court as disabled, create a dispute for this court, set the parameters accordingly so it's impossible to stake and vote in this court, and then remove all drawn jurors upon execution. WDYT? https://github.com/kleros/kleros-v2/commit/6a7cd82c0f44fd1e9353d4a53dbc3a2bbd37e0b6

Note that at first we discussed the possibility of using the existing unstaking functionalitty of the court https://github.com/kleros/kleros-v2/blob/d751b6c210b6b05cc2c321a02de5fddb6a00a77f/contracts/src/arbitration/KlerosCore.sol#L821 but we decided that'd be too excessive since it unstakes from the parent courts as well. So the proposed solution is basically the advanced version of it.

The alternative to this would be to manually store every juror staked in the court and if we want to disable subcourt we just iterate through them and unstake. I don't think it's more optimal though