Skip to content

Conversation

mani99brar
Copy link
Contributor

@mani99brar mani99brar commented Aug 29, 2025

  • Added FailedResolution event, emitted when claim sent from Inbox does not match with claim on Outbox during a dispute resolution.
  • Fixed emission of Verified event to emit only when the dispute is resolved in resolveDisputeForClaim().
  • Added a require in startVerification() to ensure that the claim can not be updated after it's been challenged.

Copy link

netlify bot commented Aug 29, 2025

Deploy Preview for veascan ready!

Name Link
🔨 Latest commit 8d2cab0
🔍 Latest deploy log https://app.netlify.com/projects/veascan/deploys/68b17cef7009330008181636
😎 Deploy Preview https://deploy-preview-432--veascan.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.

Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

Adds a FailedResolution(uint256) event to three outbox contracts. Updates startVerification to require no active challenger and to emit Verified only on success; otherwise emit FailedResolution. Updates resolveDisputedClaim to emit Verified only on successful resolution and FailedResolution on failure; removes prior unconditional Verified emissions.

Changes

Cohort / File(s) Summary of Changes
Arbitrum → Ethereum Outbox
contracts/src/arbitrumToEth/VeaOutboxArbToEth.sol
Added FailedResolution event. startVerification now requires no challenger and emits Verified only on success; emits FailedResolution on failure. resolveDisputedClaim emits Verified on successful hash check; otherwise FailedResolution; removed unconditional Verified emission.
Arbitrum → Gnosis Outbox
contracts/src/arbitrumToGnosis/VeaOutboxArbToGnosis.sol
Added FailedResolution event. startVerification now requires no challenger and conditionally emits Verified or FailedResolution. resolveDisputedClaim conditionally emits Verified on success or FailedResolution on failure; removed unconditional Verified emission.
Gnosis → Arbitrum Outbox
contracts/src/gnosisToArbitrum/VeaOutboxGnosisToArb.sol
Added FailedResolution event. resolveDisputedClaim now emits Verified only when a non-zero claimed stateRoot path succeeds; emits FailedResolution when no claim or failure; removed unconditional Verified emission.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Outbox as Outbox Contract
  participant Storage as Claim Storage

  rect rgb(245,245,255)
  note over User,Outbox: startVerification
  User->>Outbox: startVerification(epoch, claim)
  Outbox->>Storage: load Claim(epoch)
  Outbox-->>User: require(claim.challenger == 0x0)
  alt verification succeeds
    Outbox->>Storage: update claim status
    Outbox-->>User: emit Verified(epoch)
  else verification fails
    Outbox-->>User: emit FailedResolution(epoch)
  end
  end
Loading
sequenceDiagram
  autonumber
  participant Resolver as Resolver (any caller)
  participant Outbox as Outbox Contract
  participant Storage as Claim Storage

  rect rgb(245,255,245)
  note over Resolver,Outbox: resolveDisputedClaim
  Resolver->>Outbox: resolveDisputedClaim(epoch)
  Outbox->>Storage: read claim/roots
  alt claim/roots validate
    Outbox->>Storage: update honest party / finalize
    Outbox-->>Resolver: emit Verified(epoch)
  else validation fails or no claim
    Outbox-->>Resolver: emit FailedResolution(epoch)
  end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I tap my paw on ledger stone,
Events now tell success… or groan.
Verified? I thump in cheer!
FailedResolution? Ears up, clear.
Claims unchecked shall not proceed—
A tidy trail for every deed.
On-chain carrots, truth indeed. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/outbox-resolution

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
contracts/src/arbitrumToGnosis/VeaOutboxArbToGnosis.sol (1)

287-302: Emit Verified event on failure branch to unblock relayers
Relayers filtering only on Verified(_) will miss on-chain stateRoot updates when the claim hash mismatches. Add emit Verified(_epoch); in the else block before emit FailedResolution(_epoch):

         } else {
-            emit FailedResolution(_epoch);
+            emit Verified(_epoch);
+            emit FailedResolution(_epoch);
         }
🧹 Nitpick comments (2)
contracts/src/gnosisToArbitrum/VeaOutboxGnosisToArb.sol (1)

82-85: Index the epoch in FailedResolution for parity with Verified

Verified(_epoch) is indexed in this contract; FailedResolution(_epoch) should be indexed too for consistent filtering and off-chain querying.

-    event FailedResolution(uint256 _epoch);
+    event FailedResolution(uint256 indexed _epoch);
contracts/src/arbitrumToGnosis/VeaOutboxArbToGnosis.sol (1)

84-87: Event addition LGTM; consider indexing _epoch (optional)

FailedResolution is fine. If you want uniform log filtering, consider indexing _epoch here and (optionally) in Verified for this file in a follow-up, but this would change event signatures.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ffb594f and 8d2cab0.

📒 Files selected for processing (3)
  • contracts/src/arbitrumToEth/VeaOutboxArbToEth.sol (3 hunks)
  • contracts/src/arbitrumToGnosis/VeaOutboxArbToGnosis.sol (3 hunks)
  • contracts/src/gnosisToArbitrum/VeaOutboxGnosisToArb.sol (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: mani99brar
PR: kleros/vea#430
File: contracts/src/interfaces/inboxes/IVeaInbox.sol:0-0
Timestamp: 2025-08-27T07:02:45.825Z
Learning: The sendMessage signature simplification in IVeaInbox.sol and related call site updates across relay-cli and test files were fixed in a separate PR by mani99brar.
⏰ 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). (6)
  • GitHub Check: Redirect rules - veascan
  • GitHub Check: Header rules - veascan
  • GitHub Check: test
  • GitHub Check: dependency-review
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Pages changed - veascan
🔇 Additional comments (5)
contracts/src/gnosisToArbitrum/VeaOutboxGnosisToArb.sol (1)

271-287: Emit Verified on claimless resolution and verify off-chain consumers
State is updated unconditionally when L1 resolution succeeds, but Verified is only emitted if a claim exists; indexers/relayers relying solely on Verified may miss finalization for epochs without claims. To avoid liveness breaks, emit Verified in the else branch and confirm in your off-chain relayer repo that this change poses no regressions.

         } else {
-            emit FailedResolution(_epoch);
+            emit Verified(_epoch);
+            emit FailedResolution(_epoch);
         }
contracts/src/arbitrumToGnosis/VeaOutboxArbToGnosis.sol (1)

227-227: Good guard against starting verification on challenged claims

Prevents starting verification when a challenger exists; aligns with verifySnapshot’s guard.

contracts/src/arbitrumToEth/VeaOutboxArbToEth.sol (3)

88-91: Event addition LGTM

FailedResolution improves observability of unsuccessful resolution paths.


281-282: Good: block startVerification when already challenged

Prevents inconsistent verification start on challenged claims; consistent with challenge/verify flow.


343-358: Ensure Verified event is emitted on state finalization
stateRoot/latestVerifiedEpoch are updated unconditionally, but Verified is only emitted when the claim matches. Off-chain relayers relying on Verified may never see the finalization. If suppressing Verified here is intentional, confirm that all consumers also handle FailedResolution or poll the on-chain state directly.

@mani99brar mani99brar marked this pull request as ready for review August 29, 2025 10:21
@mani99brar mani99brar requested a review from jaybuidl as a code owner August 29, 2025 10:21
@mani99brar mani99brar merged commit 571a1eb into dev Aug 30, 2025
14 checks passed
@mani99brar mani99brar deleted the fix/outbox-resolution branch August 30, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants