Skip to content

Comments

chore(clearnode): arc testnet support#523

Open
reubenr0d wants to merge 1 commit intoerc7824:mainfrom
reubenr0d:rr/arc-testnet
Open

chore(clearnode): arc testnet support#523
reubenr0d wants to merge 1 commit intoerc7824:mainfrom
reubenr0d:rr/arc-testnet

Conversation

@reubenr0d
Copy link

@reubenr0d reubenr0d commented Feb 2, 2026

Contract are yet to be deployed; for Hackmoney.

Summary by CodeRabbit

Release Notes

  • Chores
    • Added support for Arc testnet (blockchain ID: 5042002) to the supported networks.

@reubenr0d reubenr0d requested a review from a team as a code owner February 2, 2026 11:48
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @reubenr0d, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces initial support for the 'arc_testnet' by adding its configuration to the clearnode sandbox environment. This is a foundational step, specifically for Hackmoney, with contract addresses currently set as placeholders, awaiting their actual deployment.

Highlights

  • New Blockchain Configuration: Added a new blockchain entry for 'arc_testnet' to the blockchains.yaml configuration file.
  • Testnet ID and Placeholder Addresses: The 'arc_testnet' is configured with ID 5042002 and placeholder contract addresses (all zeros) for custody, adjudicator, and balance checker, indicating contracts are yet to be deployed.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

A new blockchain configuration entry named arc_testnet has been added to the sandbox blockchains configuration file with ID 5042002 and zero-initialized contract addresses for custody, adjudicator, and balance_checker contracts.

Changes

Cohort / File(s) Summary
Sandbox Blockchain Configuration
clearnode/chart/config/sandbox/blockchains.yaml
Added new arc_testnet blockchain entry with ID 5042002 and zero-initialized contract addresses (custody, adjudicator, balance_checker).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A testnet appears, all shiny and new,
With zeros in place where contracts will brew,
Arc's sandbox awaits, on chain 5042002,
Configuration magic—hop, hop, we're through! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for arc testnet to the clearnode configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds configuration for the arc_testnet in the sandbox environment. The contract addresses are placeholders as the contracts are not yet deployed. To prevent potential runtime errors, I've suggested disabling this blockchain configuration until the contract addresses are finalized.

adjudicator: "0xBa28DC8F50d076Df76fF9959f31A320686faa373"
balance_checker: "0x714698e8fe7896bb84A46c0705944c4a48580819"
- name: arc_testnet
id: 5042002
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The PR description mentions that the contracts are not yet deployed, and placeholder zero addresses are used. While this passes the configuration validation, it will likely lead to runtime errors when the application tries to interact with these contracts. To prevent this, it's better to disable this blockchain configuration until the contracts are deployed and their addresses are available. You can do this by adding disabled: true.

  id: 5042002
  disabled: true

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: 1

🤖 Fix all issues with AI agents
In `@clearnode/chart/config/sandbox/blockchains.yaml`:
- Around line 29-34: Add runtime zero-address checks in blockchain_config.go's
verifyVariables() so configs with contract addresses equal to
"0x0000000000000000000000000000000000000000" are rejected; specifically, after
existing regex/format validation, check bc.ContractAddresses.Custody,
bc.ContractAddresses.Adjudicator, and bc.ContractAddresses.BalanceChecker and
return a descriptive error (including bc.Name) if any equals the zero address so
downstream code such as channel_service.go never receives a zero contract
address.

Comment on lines +29 to +34
- name: arc_testnet
id: 5042002
contract_addresses:
custody: "0x0000000000000000000000000000000000000000"
adjudicator: "0x0000000000000000000000000000000000000000"
balance_checker: "0x0000000000000000000000000000000000000000"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for zero address validation patterns
rg -n -C3 '0x0+\b|zero.*address|address.*zero|invalid.*address' --type=go --type=py --type=ts --type=js

Repository: erc7824/nitrolite

Length of output: 27330


🏁 Script executed:

#!/bin/bash
# Search for blockchain configuration loading/validation
rg -n -C3 'blockchains\.yaml|contract_addresses|LoadBlockchains|parseBlockchains' --type=go --type=py --type=ts --type=js

Repository: erc7824/nitrolite

Length of output: 3211


🏁 Script executed:

#!/bin/bash
# Find how the blockchains.yaml file is used
fd -e yaml | xargs grep -l blockchains
find . -type f \( -name "*.go" -o -name "*.py" -o -name "*.ts" -o -name "*.js" \) -exec grep -l "blockchains\|contract.*address" {} \;

Repository: erc7824/nitrolite

Length of output: 1152


🏁 Script executed:

# Find the contractAddressRegex definition
rg -n "contractAddressRegex" clearnode/

Repository: erc7824/nitrolite

Length of output: 983


🏁 Script executed:

# Look at the full validation logic in blockchain_config.go
head -70 clearnode/blockchain_config.go | tail -30

Repository: erc7824/nitrolite

Length of output: 1521


🏁 Script executed:

# Check if zero addresses are used elsewhere in the sandbox config
cat clearnode/chart/config/sandbox/blockchains.yaml | head -50

Repository: erc7824/nitrolite

Length of output: 1218


🏁 Script executed:

# Search for where contract addresses are used in actual code
rg -n "ContractAddresses|custody|adjudicator|balance_checker" clearnode/*.go --type=go -A 2 -B 2 | head -100

Repository: erc7824/nitrolite

Length of output: 5837


🏁 Script executed:

# Look for contract call patterns and guards
rg -n "\.Call\(|\.Transact\(|contract.*address.*==" clearnode/ --type=go -A 2 -B 2 | head -80

Repository: erc7824/nitrolite

Length of output: 4657


🏁 Script executed:

# Check channel service where contracts are likely used
cat clearnode/channel_service.go | head -150

Repository: erc7824/nitrolite

Length of output: 5382


Zero addresses will load and be used directly without runtime validation.

The zero addresses in this configuration pass the format validation (regex: ^0x[0-9a-fA-F]{40}$) and will load successfully into the system. They are used directly in contract operations (e.g., in channel_service.go) without any checks preventing zero address usage. Any contract interaction will fail or cause unexpected behavior.

Add runtime validation to reject zero addresses at configuration load time:

Suggested validation in blockchain_config.go verifyVariables()
// After format validation, add zero address check
zeroAddress := "0x0000000000000000000000000000000000000000"
if bc.ContractAddresses.Custody == zeroAddress {
    return fmt.Errorf("custody contract address cannot be zero address for blockchain '%s'", bc.Name)
}
if bc.ContractAddresses.Adjudicator == zeroAddress {
    return fmt.Errorf("adjudicator contract address cannot be zero address for blockchain '%s'", bc.Name)
}
if bc.ContractAddresses.BalanceChecker == zeroAddress {
    return fmt.Errorf("balance checker contract address cannot be zero address for blockchain '%s'", bc.Name)
}
🤖 Prompt for AI Agents
In `@clearnode/chart/config/sandbox/blockchains.yaml` around lines 29 - 34, Add
runtime zero-address checks in blockchain_config.go's verifyVariables() so
configs with contract addresses equal to
"0x0000000000000000000000000000000000000000" are rejected; specifically, after
existing regex/format validation, check bc.ContractAddresses.Custody,
bc.ContractAddresses.Adjudicator, and bc.ContractAddresses.BalanceChecker and
return a descriptive error (including bc.Name) if any equals the zero address so
downstream code such as channel_service.go never receives a zero contract
address.

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.

1 participant