kleros-v2
kleros-v2 copied to clipboard
disableSubcourt() function for the Governor only
Problem
In KlerosLiquid there is no way to force jurors to unstake even for the Governor. This is problematic in 2 cases:
- When a subcourt becomes obsolete, such as the Onboarding subcourt.
- When there is a major migration of the Arbitrator contract, such as the upcoming migration to v2.
In both cases, it is likely that some users will never unstake. Therefore some PNK will remain staked, which may hinder some operations.
Solution
- Create a
disableSubcourt()
function restricted to the Governor only which unstakes any user from the court. - Respect the phases of the court as usual: use
DelayedStakes
if not in Staking phase.
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.
Relates to #98 which is more a Dispute Kit specific optimization to draw jurors more efficiently.
@unknownunknown1
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