Skip to content

Add Polkadot Hub TestNet support to Clearnode sandbox#618

Open
mAsyamJ wants to merge 1 commit intolayer-3:mainfrom
mAsyamJ:main
Open

Add Polkadot Hub TestNet support to Clearnode sandbox#618
mAsyamJ wants to merge 1 commit intolayer-3:mainfrom
mAsyamJ:main

Conversation

@mAsyamJ
Copy link

@mAsyamJ mAsyamJ commented Mar 9, 2026

This PR adds Polkadot Hub TestNet to the sandbox blockchain configuration.

Network details:

This is an EVM-compatible Polkadot test network intended for development and testing. The balance_checker address is set to a placeholder and can be replaced during integration.

Summary by CodeRabbit

  • New Features
    • Added support for Polkadot Hub Testnet blockchain network.

This PR adds Polkadot Hub TestNet to the sandbox blockchain configuration.

Network details:
- Name: polkadot_hub_testnet
- Chain ID: 420420417
- Environment: sandbox
- RPC: https://services.polkadothub-rpc.com/testnet

This is an EVM-compatible Polkadot test network intended for development and testing.
The balance_checker address is set to a placeholder and can be replaced during integration.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

A new blockchain configuration entry for Polkadot Hub Testnet is added to the sandbox configuration file with its identifier and contract address mappings set to zero addresses.

Changes

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

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A testnet hops into our config with care,
Polkadot joins the sandbox lair,
New addresses bloom, though zero they stay,
Configuration grows in a simple way! 🌟

🚥 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 pull request title accurately summarizes the main change: adding Polkadot Hub TestNet support to the Clearnode sandbox configuration. It is concise, specific, and clearly describes the primary objective.
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

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@clearnode/chart/config/sandbox/blockchains.yaml`:
- Around line 29-34: The polkadot_hub_testnet blockchain entry is missing
required fields so validation in the blockchain config (see the validation that
checks for channel_hub_address or locking_contract_address) will fail; update
the polkadot_hub_testnet contract_addresses block to either add a valid
channel_hub_address or locking_contract_address (at least one present) or mark
the entry disabled: true until addresses are available so the validation in the
blockchain config (blockchain_config.go validation that enforces "must specify
at least one of channel_hub_address or locking_contract_address") passes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 881fb9b5-4db0-4dfc-a72c-794328ac5d3f

📥 Commits

Reviewing files that changed from the base of the PR and between 40b7fb8 and a307454.

📒 Files selected for processing (1)
  • clearnode/chart/config/sandbox/blockchains.yaml

Comment on lines +29 to +34
- name: polkadot_hub_testnet
id: 420420417
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
# Description: Find code that reads custody/adjudicator/balance_checker from blockchain config

echo "=== Searching for usage of contract_addresses fields ==="
rg -n -C3 'balance_checker|adjudicator|custody' --type=go --type=yaml -g '!**/blockchains.yaml'

echo ""
echo "=== Searching for YAML parsing of contract_addresses ==="
rg -n -C3 'contract_addresses' --type=go

Repository: layer-3/nitrolite

Length of output: 5853


🏁 Script executed:

# Find the Blockchain struct definition and see what fields are actually used
rg -n -A 20 'type Blockchain struct' --type=go

echo ""
echo "=== Searching for YAML unmarshaling patterns ==="
rg -n 'yaml:' clearnode/chart/config/sandbox/blockchains.yaml

echo ""
echo "=== Find files that load blockchains.yaml ==="
rg -n 'blockchains\.yaml' --type=go -A 3

echo ""
echo "=== Search for fields actually used from blockchain config ==="
rg -n 'ChannelHubAddress|LockingContractAddress|blockchain\.' --type=go -B 2 -A 2 | head -100

Repository: layer-3/nitrolite

Length of output: 7868


🏁 Script executed:

# Read the blockchains.yaml file to see the full entry and surrounding context
cat -n clearnode/chart/config/sandbox/blockchains.yaml | sed -n '20,40p'

echo ""
echo "=== Check if the file has ChannelHubAddress field for polkadot_hub_testnet ==="
rg -A 10 'polkadot_hub_testnet' clearnode/chart/config/sandbox/blockchains.yaml

Repository: layer-3/nitrolite

Length of output: 1105


🏁 Script executed:

# Read the entire blockchains.yaml to understand the structure
cat clearnode/chart/config/sandbox/blockchains.yaml

Repository: layer-3/nitrolite

Length of output: 1229


🏁 Script executed:

# Read the blockchain_config.go file to understand how YAML is parsed
cat -n clearnode/store/memory/blockchain_config.go

Repository: layer-3/nitrolite

Length of output: 5850


Add required contract addresses or disable this blockchain entry.

The polkadot_hub_testnet entry is missing both channel_hub_address and locking_contract_address. The configuration validation will fail on startup with: "blockchain 'polkadot_hub_testnet' must specify at least one of channel_hub_address or locking_contract_address" (see clearnode/store/memory/blockchain_config.go lines 89–91).

The contract_addresses section (custody, adjudicator, balance_checker) is not used by the system and has no effect.

Either:

  1. Provide real contract addresses for at least one of channel_hub_address or locking_contract_address
  2. Set disabled: true until addresses are available
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@clearnode/chart/config/sandbox/blockchains.yaml` around lines 29 - 34, The
polkadot_hub_testnet blockchain entry is missing required fields so validation
in the blockchain config (see the validation that checks for channel_hub_address
or locking_contract_address) will fail; update the polkadot_hub_testnet
contract_addresses block to either add a valid channel_hub_address or
locking_contract_address (at least one present) or mark the entry disabled: true
until addresses are available so the validation in the blockchain config
(blockchain_config.go validation that enforces "must specify at least one of
channel_hub_address or locking_contract_address") passes.

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