Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispute kit structure simplification #1320

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

unknownunknown1
Copy link
Contributor

@unknownunknown1 unknownunknown1 commented Nov 8, 2023

  1. disputeKitNodes[] and DisputeKitNode structure replaced with simple disputeKits[] array that stores the addresses of all added dispute kits.
  2. Preemptively added disabled boolean was also removed. It was added earlier in case of future upgrades but since the struct doesn't exist anymore it can be added with a simple mapping, if needed.
  3. Previously the main requirement for new dispute kits was that the root dispute kit must always be supported by General court, but that actually was a mistake since even Sybil resistant dispute kit can't possibly be supported by General court simply because its disputes can go up to 511 jurors. On the other hand we could make Sybil resistant DK the child of Classic DK but in any case this type of structure adds complexity and can lead to human errors, esp for more nuanced cases. So right now the main requirement for all dispute kits is the support of Classic dispute kit which actually makes it feature parity with V1. So if in case of a court jump during appeal the parent court doesn't support the current DK it will simply switch to Classic and continue from there.
  4. Following the previous point, SEARCH_ITERATIONS is removed as not needed

PR-Codex overview

This PR focuses on refactoring the DisputeKit functionality and adding support for new dispute kits.

Detailed summary

  • Refactored the DisputeKit functionality by removing the DisputeKitNode struct and replacing it with an array of IDisputeKit.
  • Added support for new dispute kits by adding a new function addNewDisputeKit and modifying the enableDisputeKits function.
  • Updated the event DisputeKitCreated to remove the _parent parameter.
  • Added checks to ensure that the Classic dispute kit is always supported by all courts.

The following files were skipped due to too many changes: contracts/src/arbitration/KlerosCore.sol

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

netlify bot commented Nov 8, 2023

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 4a007e3
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/657208f4516e540008dcaad4
😎 Deploy Preview https://deploy-preview-1320--kleros-v2.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaybuidl jaybuidl force-pushed the fix/dispute-kit-structure branch from 7c1bfd2 to 838e7bf Compare December 7, 2023 17:38
@jaybuidl jaybuidl added Compatibility: ABI change 🗯 Smart contract ABI is changing. Package: Subgraph Court subgraph labels Dec 7, 2023
@jaybuidl jaybuidl changed the title fix(KlerosCore): dispute kit structure fix Dispute kit structure simplification Dec 7, 2023
Copy link

sonarqubecloud bot commented Dec 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

codeclimate bot commented Dec 7, 2023

Code Climate has analyzed commit 4a007e3 and detected 0 issues on this pull request.

View more on Code Climate.

@jaybuidl jaybuidl added this to the testnet-3 milestone Dec 7, 2023
@jaybuidl jaybuidl merged commit 4a007e3 into kleros:dev Dec 7, 2023
10 of 13 checks passed
@jaybuidl jaybuidl linked an issue Dec 7, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compatibility: ABI change 🗯 Smart contract ABI is changing. Package: Contracts Court smart contracts Package: Subgraph Court subgraph Type: Enhancement ✨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dispute Kits data structure simplification
2 participants