Skip to content

Conversation

@jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Oct 8, 2025

PR-Codex overview

This PR focuses on enhancing the submitEvidence functionality in the Kleros arbitration system by adding an _arbitrable address parameter to related functions and events. This improves clarity and ensures that evidence submissions are correctly associated with their respective arbitrable contracts.

Detailed summary

  • Added _arbitrable parameter to submitEvidence in EvidenceModule.sol and ModeratedEvidenceModule.sol.
  • Updated Evidence event in IEvidence.sol to include _arbitrable.
  • Modified ModeratedEvidence event in ModeratedEvidenceModule.sol to include _arbitrable.
  • Adjusted test cases in index.ts to reflect the new _arbitrable parameter in evidence submission.

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

Summary by CodeRabbit

  • New Features
    • Evidence and ModeratedEvidence events now include the arbitrable address for clearer dispute traceability.
  • Refactor
    • Evidence submission now requires the arbitrable address as the first parameter; event argument order updated accordingly.
  • Documentation
    • Updated guidance to reflect the new arbitrable parameter in evidence submission and events.
  • Tests
    • Test scenarios updated to validate the new function signatures and event payloads.

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 7a74cf8
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/68e69c025472580008aeb4fd
😎 Deploy Preview https://deploy-preview-2167--kleros-v2-testnet.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 project configuration.

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for kleros-v2-testnet-devtools failed. Why did it fail? →

Name Link
🔨 Latest commit 7a74cf8
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/68e69c02729bb2000813c5c5

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 7a74cf8
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/68e69c02a09392000731135a
😎 Deploy Preview https://deploy-preview-2167--kleros-v2-neo.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 project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

Adds an explicit arbitrable address parameter to evidence submission functions and updates corresponding event signatures and emissions across EvidenceModule, ModeratedEvidenceModule, and IEvidence. Updates tests to reflect new function signatures and reordered/augmented event fields and indexing.

Changes

Cohort / File(s) Summary of changes
Evidence module API update
contracts/src/arbitration/evidence/EvidenceModule.sol
submitEvidence signature changed to include _arbitrable as first param; Evidence event emission updated to include arbitrable and four parameters; added dev note about end-user use.
Moderated evidence flow update
contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol
ModeratedEvidence event now includes address _arbitrable (indexed) and makes _party non-indexed; submitEvidence now takes _arbitrable first; emit order adjusted to (arbitrator, arbitrable, evidenceGroupID, submitter, evidence); comments updated.
Interface alignment
contracts/src/arbitration/interfaces/IEvidence.sol
Evidence event updated to add address indexed _arbitrable before _externalDisputeID; documentation updated accordingly.
Tests adaptation
contracts/test/evidence/index.ts
Tests updated for new submitEvidence parameter order and to assert new arbitrable field and event argument order in ModeratedEvidence/Evidence.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant EM as EvidenceModule
  participant E as Event Log

  U->>EM: submitEvidence(_arbitrable, _externalDisputeID, _evidence)
  EM-->>E: emit Evidence(_arbitrable, _externalDisputeID, msg.sender, _evidence)
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant MEM as ModeratedEvidenceModule
  participant ARB as IArbitratorV2
  participant E as Event Log

  U->>MEM: submitEvidence(_arbitrable, _evidenceGroupID, _evidence)
  MEM->>ARB: (internal checks/refs)
  MEM-->>E: emit ModeratedEvidence(ARBitrator, _arbitrable, _evidenceGroupID, msg.sender, _evidence)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Poem

A rabbit taps with tidy paws,
New args hop in with orderly laws.
Arbitrable first, the records sing,
Events now bloom in a tidier ring.
I nibble tests, they pass the checks—
Evidence trails with fewer specs.
Thump-thump: shipped with perfect hex! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Evidence event extra _arbitrable parameter” succinctly and accurately describes the main change, namely the addition of an _arbitrable argument to the Evidence event signature. It is specific, clear, and directly related to the primary update in the changeset without introducing unrelated details or vague language.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/extra-evidence-arbitrable-parameter

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2025

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
contracts/src/arbitration/evidence/EvidenceModule.sol (2)

61-67: Fix Natspec wording and optionally guard against zero arbitrable

  • Natspec for _externalDisputeID mentions “evidence group ID”. Replace with “external dispute ID” for consistency.
  • Optional: reject address(0) to avoid meaningless logs.

Apply:

-    /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsibility to submit the right evidence group ID.
+    /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter's responsibility to submit the correct external dispute ID.
 function submitEvidence(address _arbitrable, uint256 _externalDisputeID, string calldata _evidence) external {
-        emit Evidence(_arbitrable, _externalDisputeID, msg.sender, _evidence);
+        require(_arbitrable != address(0), "Invalid arbitrable");
+        emit Evidence(_arbitrable, _externalDisputeID, msg.sender, _evidence);
 }

5-5: Remove unused import

IArbitratorV2 is not used in this module.

-import "../interfaces/IArbitratorV2.sol";
contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol (1)

73-85: Align naming: use _evidenceGroupID in event (docs + identifier)

Function param is _evidenceGroupID but the event uses _externalDisputeID. Rename the event identifier and docs for clarity (types unchanged; ABI unaffected).

-    /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsibility to submit the right evidence group ID.
+    /// @param _evidenceGroupID Unique identifier of the evidence group this evidence belongs to.
 event ModeratedEvidence(
     IArbitratorV2 indexed _arbitrator,
     address indexed _arbitrable,
-    uint256 indexed _externalDisputeID,
+    uint256 indexed _evidenceGroupID,
     address _party,
     string _evidence
 );
contracts/test/evidence/index.ts (1)

151-167: Add standalone test for EvidenceModule’s Evidence event
All submitEvidence call sites have been updated; add a test that deploys EvidenceModule and asserts its Evidence(arbitrable, externalDisputeID, party, evidence) event to guard against regressions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d14f47 and 7a74cf8.

📒 Files selected for processing (4)
  • contracts/src/arbitration/evidence/EvidenceModule.sol (1 hunks)
  • contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol (3 hunks)
  • contracts/src/arbitration/interfaces/IEvidence.sol (1 hunks)
  • contracts/test/evidence/index.ts (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: hardhat-tests
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (2)
contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol (1)

195-199: Submit + emit changes look correct

Signature extended with _arbitrable and emit order matches event.

Also applies to: 220-221

contracts/src/arbitration/interfaces/IEvidence.sol (1)

8-18: No naming inconsistencies detected

Only _externalDisputeID appears in the codebase; there are no _evidenceGroupID references, so no identifier renames or doc updates are needed.

Likely an incorrect or invalid review comment.

@jaybuidl
Copy link
Member Author

jaybuidl commented Oct 8, 2025

Not relevant anymore following #2168

@jaybuidl jaybuidl closed this Oct 8, 2025
@jaybuidl jaybuidl deleted the feat/extra-evidence-arbitrable-parameter branch October 8, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evidence event is missing the arbitrable address which is tied to the externalDisputeID

2 participants