Add Polkadot Hub TestNet support to Clearnode sandbox#618
Add Polkadot Hub TestNet support to Clearnode sandbox#618mAsyamJ wants to merge 1 commit intolayer-3:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughA 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
clearnode/chart/config/sandbox/blockchains.yaml
| - name: polkadot_hub_testnet | ||
| id: 420420417 | ||
| contract_addresses: | ||
| custody: "0x0000000000000000000000000000000000000000" | ||
| adjudicator: "0x0000000000000000000000000000000000000000" | ||
| balance_checker: "0x0000000000000000000000000000000000000000" |
There was a problem hiding this comment.
🧩 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=goRepository: 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 -100Repository: 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.yamlRepository: layer-3/nitrolite
Length of output: 1105
🏁 Script executed:
# Read the entire blockchains.yaml to understand the structure
cat clearnode/chart/config/sandbox/blockchains.yamlRepository: 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.goRepository: 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:
- Provide real contract addresses for at least one of
channel_hub_addressorlocking_contract_address - Set
disabled: trueuntil 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.
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