Skip to content

feat: Avalanche C and P chains specs#2247

Merged
Harraken merged 5 commits into
mainfrom
avalanche-update-specs
Mar 30, 2026
Merged

feat: Avalanche C and P chains specs#2247
Harraken merged 5 commits into
mainfrom
avalanche-update-specs

Conversation

@sotskov-do

@sotskov-do sotskov-do commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

User description

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • read the contribution guide
  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the main branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Enable Avalanche C- and P-chain flows by adding detailed mainnet and testnet specifications that enumerate the supported API collections, verifications, and imports for Lava providers. Adjust the provider examples and initialization scripts so test setups reference the new chain IDs, endpoints, and internal paths required by Avalanche nodes.

TopicDetails
Env Setup Scripts Adjust the scripts and provider example configs to use the new AVALANCHECT/AVALANCHEPT chain IDs, required internal paths, and AVA_BASE_URL endpoint variables when spinning up C- or P-chain providers and consumers.
Modified files (4)
  • config/provider_examples/avalanche_c_chain_example.yml
  • config/provider_examples/avalanche_p_chain_example.yml
  • scripts/pre_setups/init_avax_c_only_with_node.sh
  • scripts/pre_setups/init_avax_p_only_with_node.sh
Latest Contributors(1)
UserCommitDate
NadavLevifeat(smart-router)!: i...March 11, 2026
Avalanche Specs Capture new Avalanche C/P mainnet and testnet specs in Lava by defining their API collections, compute unit pricing, verifications, and imports across the specs/mainnet-1/specs/avalanche_* and specs/testnet-2/specs/avalanche_* JSON proposals.
Modified files (4)
  • specs/mainnet-1/specs/avalanche_c.json
  • specs/mainnet-1/specs/avalanche_p.json
  • specs/testnet-2/specs/avalanche_c.json
  • specs/testnet-2/specs/avalanche_p.json
Latest Contributors(1)
UserCommitDate
NadavLevifeat(smart-router)!: i...March 11, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Separate Avalanche C and P chain specs to testnet-2

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Separated Avalanche C and P chain specifications into testnet-2
• Removed mainnet-1 Avalanche specs, consolidating to testnet
• Updated setup scripts to use separate chain IDs (AVAXCT, AVAXPT)
• Added provider configuration examples for both chains
• Enhanced C-chain spec with Warp APIs and atomic transaction support
Diagram
flowchart LR
  A["mainnet-1 Avalanche specs"] -->|removed| B["Consolidated specs"]
  C["testnet-2 Avalanche C spec"] -->|added| B
  D["testnet-2 Avalanche P spec"] -->|added| B
  E["Setup scripts"] -->|updated chain IDs| F["AVAXCT/AVAXPT"]
  G["Provider configs"] -->|added examples| H["C-chain & P-chain"]
Loading

Grey Divider

File Changes

1. scripts/pre_setups/init_avax_c_only_with_node.sh ⚙️ Configuration changes +11/-12

Update C-chain setup to use testnet specs

• Replaced dynamic spec loading with explicit spec list including testnet-2 avalanche_c.json
• Changed environment variable from AVA_C_RPC to AVA_BASE_URL with updated documentation
• Updated chain ID from AVAXC to AVAXCT for provider staking
• Enhanced node URLs with multiple endpoints (HTTP RPC, WebSocket, AVAX atomic)
• Added internal-path mappings for /C/rpc and /C/avax

scripts/pre_setups/init_avax_c_only_with_node.sh


2. scripts/pre_setups/init_avax_p_only_with_node.sh ✨ Enhancement +80/-0

New Avalanche P-chain testnet setup script

• New setup script for Avalanche P-chain testnet configuration
• Includes spec proposal with testnet-2 avalanche_p.json
• Configures provider with AVAXPT chain ID and port 2221
• Sets up provider YAML with /P internal-path mapping
• Implements consumer portal on port 3360

scripts/pre_setups/init_avax_p_only_with_node.sh


3. config/provider_examples/avalanche_c_chain_example.yml 📝 Documentation +15/-0

Add C-chain provider configuration example

• New provider configuration example for Avalanche C-chain
• Demonstrates AVAXCT chain ID and multiple node URLs
• Includes internal-path mappings for /C/rpc, /C/ws, and /C/avax
• Documents requirement for warp-api-enabled node configuration

config/provider_examples/avalanche_c_chain_example.yml


View more (5)
4. config/provider_examples/avalanche_p_chain_example.yml 📝 Documentation +10/-0

Add P-chain provider configuration example

• New provider configuration example for Avalanche P-chain
• Demonstrates AVAXPT chain ID and single node URL
• Includes internal-path mapping for /P endpoint

config/provider_examples/avalanche_p_chain_example.yml


5. specs/mainnet-1/specs/avalanche_c.json ⚙️ Configuration changes +0/-309

Remove mainnet-1 Avalanche C spec

• Removed entire mainnet-1 Avalanche C-chain specification file
• Consolidates specs to testnet-2 location

specs/mainnet-1/specs/avalanche_c.json


6. specs/mainnet-1/specs/avalanche_p.json ⚙️ Configuration changes +0/-542

Remove mainnet-1 Avalanche P spec

• Removed entire mainnet-1 Avalanche P-chain specification file
• Consolidates specs to testnet-2 location

specs/mainnet-1/specs/avalanche_p.json


7. specs/testnet-2/specs/avalanche_c.json ✨ Enhancement +453/-0

Add testnet-2 Avalanche C-chain spec

• New comprehensive Avalanche C-chain specification for testnet-2
• Includes AVAXC mainnet and AVAXCT testnet chain definitions
• Adds Warp APIs (warp_getMessage, warp_getMessageSignature, etc.)
• Adds atomic transaction methods (avax.getAtomicTx, avax.issueTx)
• Supports multiple internal paths (/C/rpc, /C/avax) with proper API collections

specs/testnet-2/specs/avalanche_c.json


8. specs/testnet-2/specs/avalanche_p.json ✨ Enhancement +616/-0

Add testnet-2 Avalanche P-chain spec

• New comprehensive Avalanche P-chain specification for testnet-2
• Includes AVAXP mainnet and AVAXPT testnet chain definitions
• Defines platform RPC methods for P-chain operations
• Adds new methods like platform.getSubnet, platform.getAllValidatorsAt
• Includes validator fee configuration methods

specs/testnet-2/specs/avalanche_p.json


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 22, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Missing variables.sh file 🐞 Bug ✓ Correctness
Description
The new/modified Avalanche pre-setup scripts source "../vars/variables.sh" and require AVA_BASE_URL,
but the repository contains no scripts/vars/variables.sh, so the scripts will fail immediately when
executed on a fresh checkout.
Code

scripts/pre_setups/init_avax_p_only_with_node.sh[R1-47]

+#!/bin/bash
+__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+source "$__dir"/../useful_commands.sh
+. "${__dir}"/../vars/variables.sh
+
+LOGS_DIR=${__dir}/../../testutil/debugging/logs
+mkdir -p $LOGS_DIR
+rm $LOGS_DIR/*.log
+
+killall screen
+screen -wipe
+
+echo "[Test Setup] installing all binaries"
+make install-all
+
+echo "[Test Setup] setting up a new lava node"
+screen -d -m -S node bash -c "./scripts/start_env_dev.sh"
+screen -ls
+echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)"
+sleep 5
+wait_for_lava_node_to_start
+
+GASPRICE="0.00002ulava"
+specs="specs/mainnet-1/specs/ibc.json,specs/mainnet-1/specs/tendermint.json,specs/mainnet-1/specs/cosmossdk.json,specs/testnet-2/specs/lava.json,specs/testnet-2/specs/avalanche_p.json"
+lavad tx gov submit-legacy-proposal spec-add $specs --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
+wait_next_block
+wait_next_block
+lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
+sleep 4
+
+# Plans proposal
+lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
+wait_next_block
+wait_next_block
+lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
+
+sleep 4
+
+CLIENTSTAKE="500000000000ulava"
+PROVIDERSTAKE="500000000000ulava"
+
+PROVIDER1_LISTENER="127.0.0.1:2221"
+
+if [ -z "$AVA_BASE_URL" ]; then
+  echo "ERROR: Avalanche P-Chain endpoint is empty. Set AVA_BASE_URL in scripts/vars/variables.sh or environment. for example, 'api.avax-test.network/ext/bc'"
+  exit 1
+fi
Evidence
Both Avalanche setup scripts source a variables file at scripts/vars/variables.sh and exit if
AVA_BASE_URL is unset, but a repo-wide search shows there is no scripts/vars directory and no
variables.sh file, making this a guaranteed runtime failure when running the setups.

scripts/pre_setups/init_avax_p_only_with_node.sh[1-47]
scripts/pre_setups/init_avax_c_only_with_node.sh[1-47]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Avalanche pre-setup scripts source a non-existent `scripts/vars/variables.sh` and instruct users to set `AVA_BASE_URL` in that file. This makes the scripts fail immediately on fresh checkouts.
### Issue Context
- `init_avax_c_only_with_node.sh` and `init_avax_p_only_with_node.sh` both `source`/dot-include `../vars/variables.sh` and hard-require `AVA_BASE_URL`.
- The repository currently has no `scripts/vars/variables.sh` (and no `scripts/vars` directory).
### Fix Focus Areas
- scripts/pre_setups/init_avax_c_only_with_node.sh[1-47]
- scripts/pre_setups/init_avax_p_only_with_node.sh[1-47]
### Suggested fix
Either:
1) Add `scripts/vars/variables.sh` (and directory) with documented defaults including `AVA_BASE_URL`, or
2) Stop sourcing that file and rely solely on environment variables / CLI flags, and update the error message accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Empty object JSON-RPC params 🐞 Bug ⛯ Reliability
Description
The P-Chain spec uses "params":{} in JSON-RPC function templates for platform.getHeight, which
is inconsistent with most other spec templates and can be incompatible with servers expecting
params to be an array for no-argument methods, potentially breaking health and block-number
parsing.
Code

specs/testnet-2/specs/avalanche_p.json[R529-565]

+                                "name": "health",
+                                "parse_directive": {
+                                    "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"platform.getHeight\",\"params\":{},\"id\":1}",
+                                    "function_tag": "VERIFICATION",
+                                    "result_parsing": {
+                                        "parser_arg": [
+                                            "0",
+                                            "height"
+                                        ],
+                                        "parser_func": "PARSE_CANONICAL"
+                                    },
+                                    "api_name": "platform.getHeight"
+                                },
+                                "values": [
+                                    {
+                                        "expected_value": "*"
+                                    }
+                                ]
+                            }
+                        ],
+                        "parse_directives": [
+                            {
+                                "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"platform.getHeight\",\"params\":{},\"id\":1}",
+                                "function_tag": "GET_BLOCKNUM",
+                                "result_parsing": {
+                                    "parser_arg": [
+                                        "0",
+                                        "height"
+                                    ],
+                                    "parser_func": "PARSE_CANONICAL"
+                                },
+                                "api_name": "platform.getHeight"
+                            },
+                            {
+                                "function_tag": "GET_BLOCK_BY_NUM",
+                                "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"platform.getBlockByHeight\",\"params\":{\"height\":%d,\"encoding\":\"hex\"},\"id\":1}",
+                                "result_parsing": {
Evidence
In avalanche_p.json, the health verification and GET_BLOCKNUM parse directive call
platform.getHeight with params:{}. In the rest of the repo, spec JSON-RPC templates typically use
params:[] for no-argument methods (e.g., eth_blockNumber), making this an outlier and a potential
interoperability risk.

specs/testnet-2/specs/avalanche_p.json[529-565]
specs/mainnet-1/specs/fantom.json[108-126]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`specs/testnet-2/specs/avalanche_p.json` uses `"params":{}` for `platform.getHeight` in both health verification and GET_BLOCKNUM directive. Some JSON-RPC servers expect no-argument calls to use an empty array (`[]`), so this can cause request rejection and break health checks / block height parsing.
### Issue Context
Other specs in this repo generally encode no-argument JSON-RPC calls with `"params":[]`.
### Fix Focus Areas
- specs/testnet-2/specs/avalanche_p.json[529-565]
### Suggested fix
Change the `function_template` for `platform.getHeight` to use `"params":[]` (or omit `params` entirely if supported by the spec/template parser), and keep object params only for methods with named parameters (like `platform.getBlockByHeight`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +1 to +47
#!/bin/bash
__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "$__dir"/../useful_commands.sh
. "${__dir}"/../vars/variables.sh

LOGS_DIR=${__dir}/../../testutil/debugging/logs
mkdir -p $LOGS_DIR
rm $LOGS_DIR/*.log

killall screen
screen -wipe

echo "[Test Setup] installing all binaries"
make install-all

echo "[Test Setup] setting up a new lava node"
screen -d -m -S node bash -c "./scripts/start_env_dev.sh"
screen -ls
echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)"
sleep 5
wait_for_lava_node_to_start

GASPRICE="0.00002ulava"
specs="specs/mainnet-1/specs/ibc.json,specs/mainnet-1/specs/tendermint.json,specs/mainnet-1/specs/cosmossdk.json,specs/testnet-2/specs/lava.json,specs/testnet-2/specs/avalanche_p.json"
lavad tx gov submit-legacy-proposal spec-add $specs --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE &
wait_next_block
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
sleep 4

# Plans proposal
lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
wait_next_block
lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE

sleep 4

CLIENTSTAKE="500000000000ulava"
PROVIDERSTAKE="500000000000ulava"

PROVIDER1_LISTENER="127.0.0.1:2221"

if [ -z "$AVA_BASE_URL" ]; then
echo "ERROR: Avalanche P-Chain endpoint is empty. Set AVA_BASE_URL in scripts/vars/variables.sh or environment. for example, 'api.avax-test.network/ext/bc'"
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Missing variables.sh file 🐞 Bug ✓ Correctness

The new/modified Avalanche pre-setup scripts source "../vars/variables.sh" and require AVA_BASE_URL,
but the repository contains no scripts/vars/variables.sh, so the scripts will fail immediately when
executed on a fresh checkout.
Agent Prompt
### Issue description
The Avalanche pre-setup scripts source a non-existent `scripts/vars/variables.sh` and instruct users to set `AVA_BASE_URL` in that file. This makes the scripts fail immediately on fresh checkouts.

### Issue Context
- `init_avax_c_only_with_node.sh` and `init_avax_p_only_with_node.sh` both `source`/dot-include `../vars/variables.sh` and hard-require `AVA_BASE_URL`.
- The repository currently has no `scripts/vars/variables.sh` (and no `scripts/vars` directory).

### Fix Focus Areas
- scripts/pre_setups/init_avax_c_only_with_node.sh[1-47]
- scripts/pre_setups/init_avax_p_only_with_node.sh[1-47]

### Suggested fix
Either:
1) Add `scripts/vars/variables.sh` (and directory) with documented defaults including `AVA_BASE_URL`, or
2) Stop sourcing that file and rely solely on environment variables / CLI flags, and update the error message accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@sotskov-do sotskov-do changed the title feat: Avalanche C and P chains feat: Avalanche C and P chains specs Mar 22, 2026
@codecov

codecov Bot commented Mar 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
consensus 8.71% <ø> (ø)
protocol 33.92% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +1 to +5
{
"proposal": {
"title": "Add Specs: Avalanche C Chain",
"description": "Adding new specification support for relaying Avalanche C Chain data on Lava. Note: Warp APIs (warp_getMessage, etc.) require the node to be configured with warp-api-enabled=true",
"specs": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

specs/testnet-2/specs/avalanche_c.json adds /C/rpc, /C/avax, and Warp/atomic APIs but the repo lacks a specs/*_test.md behavior doc required by AGENTS.md — should we add/update it for Avalanche C or record an approved exemption?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
specs/testnet-2/specs/avalanche_c.json around lines 1-5, the change adds large API
surface area (collections /C/rpc and /C/avax plus Warp and atomic APIs) but no
specs/*_test.md behavioral document was added. Create a new file
specs/testnet-2/specs/avalanche_c_test.md that follows the repo's AGENTS.md Testing
Guidelines and contains clear GIVEN–WHEN–THEN scenarios covering: (1) basic /C/rpc
JSON-RPC calls (eth_blockNumber, eth_getBlockByNumber) including expected parsing and
chain-id verification, (2) Warp APIs (warp_getMessage, warp_getMessageSignature, etc.)
including node config dependency (warp-api-enabled=true), and (3) /C/avax atomic tx
endpoints (avax.getAtomicTx, avax.issueTx) including stateful/hanging behavior and
expected success/failure cases. If you intentionally will not add tests, add a short
approved-exemption note file (e.g. specs/testnet-2/specs/avalanche_c_test_exemption.md)
referencing AGENTS.md and the approval rationale and approver name.

Comment on lines +31 to +35
# Plans proposal
lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
wait_next_block
lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The plan proposal block is copied verbatim from init_avax_c_only_with_node.sh into the P setup, should we extract the shared flow into a single parameterized script/helper like init_avax_common.sh --chain-id?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Comment on lines +1 to +5
{
"proposal": {
"title": "Add Specs: Avalanche P Chain",
"description": "Adding new specification support for relaying Avalanche P Chain data on Lava",
"specs": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

specs/testnet-2/specs/avalanche_p.json defines /P but there's no specs/*_test.md GIVEN–WHEN–THEN write-up required by AGENTS.md, should we add the behavior doc or document an exemption?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
specs/testnet-2/specs/avalanche_p.json around lines 1-5, the commit adds a new Avalanche
P spec but no corresponding behavioral test write-up as required by AGENTS.md (Testing
Guidelines lines 17-19). Add a new file specs/testnet-2/specs/avalanche_p_test.md
containing clear GIVEN–WHEN–THEN narratives that cover the /P collection, the key
platform.* APIs (e.g., getBlock, getBlockByHeight, getHeight), and the
verification/parse_directives flow (happy path and at least one failure case).
Alternatively, if this spec should be exempt, update AGENTS.md (or add a
CONTRIBUTORS_EXEMPTIONS.md) with an explicit exemption entry referencing this file and
explaining why the GIVEN–WHEN–THEN doc is not applicable.

@github-actions

github-actions Bot commented Mar 22, 2026

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
7 files   ±0   0 ❌ ±0 

Results for commit ce0ccff. ± Comparison against base commit 4197251.

♻️ This comment has been updated with latest results.

@sotskov-do sotskov-do requested a review from Tomelia1999 March 22, 2026 17:33
Comment on lines +240 to +244
{
"function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":1}",
"function_tag": "GET_BLOCKNUM",
"result_parsing": {
"parser_arg": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

parse_directives is duplicated across specs, should we factor it into a shared helper/import like ETH1?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Comment on lines +511 to +514
"inheritance_apis": [],
"parse_directives": [],
"verifications": []
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warp_* add-on's verifications is empty so providers can register even if the node lacks warp-api-enabled=true, should we add a minimal verification like warp_getMessage?

Finding type: Logical Bugs | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
specs/testnet-2/specs/avalanche_c.json around lines 411 to 514, the warp add-on
collection (the JSON object with "collection_data" internal_path "/C/rpc" and "add_on":
"warp") has an empty "verifications" array. Add a minimal verification object to that
collection that calls a warp API (for example `warp_getMessage`) via a function_template
JSON-RPC request, sets a suitable function_tag (e.g. "VERIFICATION"), and specifies
result_parsing to assert a non-empty or present result (e.g. parser_func: "PARSE_BY_ARG"
or "DEFAULT" with parser_arg pointing to the result field). This will ensure
chain_fetcher.Validate detects lack of warp support at startup rather than at runtime.

@Harraken Harraken merged commit 9fb42df into main Mar 30, 2026
32 checks passed
@Harraken Harraken deleted the avalanche-update-specs branch March 30, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants