Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clearnode/chart/config/sandbox/blockchains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ blockchains:
custody: "0x442f5544983eA73ED75FbDD252bc03842D185284"
adjudicator: "0xBa28DC8F50d076Df76fF9959f31A320686faa373"
balance_checker: "0x714698e8fe7896bb84A46c0705944c4a48580819"
- name: polkadot_hub_testnet
id: 420420417
contract_addresses:
custody: "0x0000000000000000000000000000000000000000"
adjudicator: "0x0000000000000000000000000000000000000000"
balance_checker: "0x0000000000000000000000000000000000000000"
Comment on lines +29 to +34
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.