Skip to content

Migrate from deprecated subnet-cli, fix version drift in update scripts, fix chain ID validation in RPC tests#110

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-47553609-541975479-5a524a44-f539-4c12-a5da-57795289e076
Draft

Migrate from deprecated subnet-cli, fix version drift in update scripts, fix chain ID validation in RPC tests#110
Copilot wants to merge 2 commits intomainfrom
copilot/fix-47553609-541975479-5a524a44-f539-4c12-a5da-57795289e076

Conversation

Copy link

Copilot AI commented Mar 3, 2026

The validator update scripts were hardcoding versions 3 major releases behind what the README documents (v1.10.11/v0.5.6 vs v1.14.1/v0.8.0), creating a concrete downgrade risk. Additionally, rpc_test.py's test_chain_id() never validated the returned chain ID — it silently passed regardless of the RPC response.

Version canonicalization

  • New .versions.env at repo root: single source of truth for AVALANCHEGO_VERSION=1.14.1 and SUBNET_EVM_VERSION=0.8.0
  • chains/update-validator-mainnet.sh and chains/update-validator-testnet.sh now source .versions.env instead of hardcoding stale versions; AVALANCHEGO_PREVIOUS_VERSION remains a local variable for operators to set per their installed state

CI guard against future drift

  • New .github/workflows/check-versions.yml fails the build if README.md version references diverge from .versions.env, preventing silent drift going forward

subnet-cli deprecation

  • New subnet-cli/README.md with a prominent deprecation notice directing operators to the Avalanche CLI workflow
  • Deprecation header comments added to chains/install-subnet-cli.sh and subnet-cli/install-subnet-cli.sh

RPC test fix

  • test_chain_id() now sets "id": 1 in the JSON-RPC payload (it was incorrectly using the expected chain ID as the request id) and asserts int(response['result'], 16) == chain_id:
# Before: chain_id was only used as the JSON-RPC request id, never validated
def test_chain_id(rpc_url, chain_id):
    payload = {"jsonrpc": "2.0", "method": "eth_chainId", "id": chain_id}
    ...

# After: response result is actually compared against the expected chain ID
returned_chain_id = int(response_data['result'], 16)
assert returned_chain_id == chain_id, f"Chain ID mismatch: expected {chain_id}, got {returned_chain_id}"
  • New rpc/requirements.txt with requests>=2.28.0 and websockets>=10.0
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature][High] Migrate from deprecated subnet-cli to avalanche CLI, fix version drift in update scripts</issue_title>
<issue_description>## Summary

The repository relies on the deprecated subnet-cli tool (ava-labs/subnet-cli, pinned at v0.0.2 from 2022) for critical validator operations, while the modern avalanche CLI is already partially documented in the README. Additionally, the validator update scripts hardcode versions that are 3 major versions behind what the README documents.

Findings

1. subnet-cli tool is deprecated and non-functional

Files: All scripts in subnet-cli/ directory (7 files), chains/install-subnet-cli.sh, subnet-cli/install-subnet-cli.sh, README "Create a Subnet" section (lines 98-208)

The subnet-cli (v0.0.2) has been replaced by avalanche CLI (ava-labs/avalanche-cli). The README already documents the new approach in "Import Existing L1 in Avalanche CLI" (line 349+), confirming awareness of the transition. However:

  • The subnet-cli/ directory with 7 scripts still references the old tool
  • install-subnet-cli.sh downloads v0.0.2 (from 2022)
  • The "Create a Subnet" section shows subnet-cli wizard output from 2022
  • No deprecation notice exists in the old sections

A new operator following the "Create a Subnet" documentation will download and attempt to use a broken, unmaintained tool.

2. Version constants are 3 major versions behind

Files: chains/update-validator-mainnet.sh (lines 3-5), chains/update-validator-testnet.sh (lines 3-5)

Current state:

Source avalanchego subnet-evm
README (mainnet/testnet) v1.14.1 v0.8.0
update-validator-mainnet.sh v1.10.11 v0.5.6
update-validator-testnet.sh v1.10.11 v0.5.6

An operator running the update scripts would downgrade their node by 3 major versions compared to what the README describes. This is a concrete operational risk.

3. rpc_test.py never validates chain ID

File: rpc/rpc_test.py, lines 40-52

The test_chain_id() function receives a chain_id parameter but uses it only as the JSON-RPC request id field — it never compares the response's result against the expected chain ID (mainnet: 10507, testnet: 10508). The test always exits 0 regardless of what the RPC returns, providing false confidence.

Suggested Approach

  1. Deprecate subnet-cli/ directory: Add a prominent deprecation notice pointing to the avalanche CLI workflow
  2. Create a VERSIONS or .versions.env file at the repo root with canonical version constants:
    AVALANCHEGO_VERSION=1.14.1
    SUBNET_EVM_VERSION=0.8.0
    
  3. Update update-validator-*.sh to source from the shared version file
  4. Add CI check (GitHub Action) that verifies README version references match the versions file
  5. Fix rpc_test.py to assert int(response_data['result'], 16) == expected_chain_id
  6. Add requirements.txt for Python test dependencies (requests, websockets)

Expected Impact

  • Prevents operators from installing outdated or broken software
  • Eliminates version drift as a class of bugs
  • Makes RPC tests actually catch misconfigurations
  • Improves contributor onboarding experience

Generated by Health Monitor with Omni</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…tion, add CI version check

Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot AI changed the title [WIP] [Feature][High] Migrate from deprecated subnet-cli to avalanche CLI, fix version drift in update scripts Migrate from deprecated subnet-cli, fix version drift in update scripts, fix chain ID validation in RPC tests Mar 3, 2026
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.

[Feature][High] Migrate from deprecated subnet-cli to avalanche CLI, fix version drift in update scripts

2 participants