Skip to content

Devnet redeployment #77

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

Merged
merged 3 commits into from
Apr 18, 2025
Merged

Devnet redeployment #77

merged 3 commits into from
Apr 18, 2025

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Apr 17, 2025

PR-Codex overview

This PR updates several components of the project, primarily focusing on upgrading Solidity versions, modifying contract addresses, and updating dependencies to improve functionality and compatibility.

Detailed summary

  • Updated pragma solidity version from 0.8.18 to 0.8.24 in multiple contracts.
  • Changed contract addresses in subgraph.yaml and README.md.
  • Updated startBlock in subgraph.yaml.
  • Modified arbitratorAddress in templates/index.ts.
  • Upgraded viem version from 2.22.22 to 2.27.2 in package.json.
  • Updated various dependencies in package.json files across the project.
  • Adjusted logic in setDisputeTemplate.ts to include getContractAtWithSignerAddress.
  • Corrected parameter usage in Curate.ts for dispute handling.

The following files were skipped due to too many changes: yarn.lock, contracts/deployments/arbitrumSepoliaDevnet/CurateFactory.json, contracts/deployments/arbitrumSepoliaDevnet/CurateView.json, contracts/deployments/arbitrumSepoliaDevnet/CurateV2.json

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

Summary by CodeRabbit

  • Chores

    • Updated multiple dependencies across packages to newer versions, including Hardhat, ethers, @kleros/kleros-v2-contracts, gluegun, and viem.
    • Upgraded Solidity compiler version from 0.8.18 to 0.8.24 in smart contracts and configuration files.
    • Removed obsolete external deployment configuration from the project setup.
    • Updated deployed contract addresses for Arbitrum Sepolia network in documentation.
    • Incremented subgraph package version and updated related dependencies.
  • Refactor

    • Improved contract deployment logic for better network support and reliability.
    • Enhanced contract interaction scripts to use explicit signer authorization.
    • Updated dispute ID handling for consistent event processing.
    • Updated data source configuration and start block for subgraph indexing.
  • Bug Fixes

    • Corrected arbitrator address in shared template properties.

Copy link
Contributor

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update modifies multiple components across the repository. The deployment script now uses a mapping to resolve deployment names based on the network and fetches contract instances via a utility from @kleros/kleros-v2-contracts, replacing previous direct deployment lookups. Solidity source files in the contracts have their compiler pragma bumped from 0.8.18 to 0.8.24. The Hardhat configuration removes external deployment paths and updates the Solidity version. Package dependencies are refreshed in contracts, subgraph, and web projects, with several libraries upgraded to newer versions. Additionally, some contract addresses and signer usage in scripts were updated.

Changes

File(s) Change Summary
contracts/deploy/00-curate-v2.ts Refactored to use deployment name mapping and getContractsEthers for contract fetching; replaced .address with .target.
contracts/hardhat.config.ts, contracts/src/CurateFactory.sol, contracts/src/CurateV2.sol, contracts/src/CurateView.sol Updated Solidity compiler version to 0.8.24; removed external deployment paths from Hardhat config.
contracts/package.json Upgraded Hardhat, ethers, TypeScript typings, and @kleros/kleros-v2-contracts dependencies to newer versions.
subgraph/package.json Upgraded gluegun devDependency from ^5.1.2 to ^5.2.0.
web/package.json Upgraded viem dependency from ^2.22.22 to ^2.27.2.
contracts/scripts/setDisputeTemplate.ts Changed contract instance retrieval to use signer-aware method with deployer's address.
contracts/README.md Updated deployed contract addresses URLs for Arbitrum Sepolia network.
templates/index.ts Updated hardcoded arbitrator address constant.
subgraph/src/Curate.ts Changed parameter and field from arbitrableDisputeID to arbitratorDisputeID in handleRequestChallenged function.
subgraph/subgraph.yaml Updated CurateFactory contract address and startBlock for arbitrum-sepolia network data source.

Sequence Diagram(s)

sequenceDiagram
    participant DeployScript
    participant HRE
    participant Deployments
    participant ContractsUtil

    DeployScript->>HRE: Access Hardhat runtime environment
    DeployScript->>Deployments: Get current network name
    DeployScript->>ContractsUtil: getContractsEthers(provider, deploymentName)
    ContractsUtil-->>DeployScript: Return contract instances (klerosCore, evidence, disputeTemplateRegistry)
    DeployScript->>DeployScript: Use .target of contracts for deployment logic
Loading

Possibly related PRs

  • Feat/dynamic contract address fetching #36: Refactors contract deployment scripts to dynamically fetch contract instances using getContractsEthers from @kleros/kleros-v2-contracts and updates contract address handling accordingly.

Poem

In the garden of code, new seeds are sown,
With Solidity fresh and dependencies grown.
The scripts now map networks with elegant care,
While contracts and configs get a versionaire.
From web to subgraph, all parts align—
A rabbit’s delight in this springtime refine!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 530bbb9 and 173a6ce.

📒 Files selected for processing (3)
  • subgraph/package.json (2 hunks)
  • subgraph/src/Curate.ts (2 hunks)
  • subgraph/subgraph.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • subgraph/subgraph.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • subgraph/package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (3)
subgraph/src/Curate.ts (3)

269-269: Parameter name update looks good

The update from _arbitrableDisputeID to _arbitratorDisputeID aligns with the function's expected parameters and matches how the arbitratorDisputeIDToItemID function is used elsewhere in the code (e.g., in the handleRuling function on line 247).


297-297: Consistent dispute ID field update

This change correctly updates the field assignment to use _arbitratorDisputeID which maintains consistency with the parameter change above and properly reflects the source of the dispute ID.


267-301:

✅ Verification successful

Verify GraphQL queries compatibility

The parameter and field name changes look good technically, but they might affect existing GraphQL queries that depend on this data.


🏁 Script executed:

#!/bin/bash
# Check if there are any GraphQL queries referencing the old dispute ID format

# Search for GraphQL queries in the repository
echo "Searching for GraphQL queries that might be affected by the dispute ID change..."
rg -t graphql "disputeID|arbitrableDisputeID|arbitratorDisputeID" --context 2

# Also check for any TypeScript/JavaScript code that might be querying the subgraph
echo "Searching for TypeScript/JavaScript code that might query the subgraph for dispute IDs..."
rg -t ts -t js "disputeID|arbitrableDisputeID|arbitratorDisputeID" --context 2 -g "!subgraph/src/Curate.ts"

Length of output: 2862


🏁 Script executed:

#!/bin/bash
set -e

echo "Locating all .graphql files in the repo..."
fd --glob '*.graphql' || { echo "No .graphql files found."; exit 0; }
echo

echo "Inspecting 'type Request' definitions in each .graphql file:"
for file in $(fd --glob '*.graphql'); do
  echo "=== $file ==="
  rg -n "type Request" -A 20 "$file" || echo "  → No 'type Request' definition here."
  echo
done

Length of output: 1420


All existing GraphQL queries remain compatible

I’ve confirmed that subgraph/schema.graphql still defines both
disputeID: BigInt
externalDisputeID: BigInt!

and every query in the repo (e.g.
• templates/index.tsSearchRequestByDisputeID($externalDisputeID: BigInt!)
• web/src/hooks/queries/useRequestsQuery.ts
• web/src/components/ActionButton/index.tsx
• web/src/components/HistoryDisplay/index.tsx
) continues to use those same fields. No field was removed or renamed, so no changes are needed.


🪧 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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai 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

Documentation and Community

  • 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

netlify bot commented Apr 17, 2025

Deploy Preview for curate-v2 failed. Why did it fail? →

Name Link
🔨 Latest commit 173a6ce
🔍 Latest deploy log https://app.netlify.com/sites/curate-v2/deploys/68014d6bf0533800086de64d

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 17, 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 (1)
contracts/scripts/setDisputeTemplate.ts (1)

30-30: Improved signer handling - good change!

This update explicitly provides the deployer's signer address when getting the contract instance, ensuring all contract interactions use the correct signer. This approach is more explicit and aligns with the script's subsequent governor check at line 38.

Consider addressing the warning at the top of the file (lines 5-6) about hardcoded Devnet values in a future update as indicated in the comment.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 518f1f1 and 530bbb9.

📒 Files selected for processing (3)
  • contracts/README.md (1 hunks)
  • contracts/scripts/setDisputeTemplate.ts (1 hunks)
  • templates/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • templates/index.ts
  • contracts/README.md
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 17, 2025
@jaybuidl jaybuidl marked this pull request as ready for review April 17, 2025 19:00
@jaybuidl jaybuidl requested review from tractorss and kemuru April 17, 2025 19:00
@jaybuidl jaybuidl added the Package: Subgraph Court subgraph label Apr 17, 2025
@jaybuidl jaybuidl merged commit 6461ba6 into master Apr 18, 2025
3 of 7 checks passed
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.

3 participants