Skip to content

fix(specs): align AVALANCHEC debug addon and AVALANCHEP methods with avalanchego - #2330

Open
LudiSistemas wants to merge 1 commit into
mainfrom
fix/avalanche-specs-align-with-upstream
Open

fix(specs): align AVALANCHEC debug addon and AVALANCHEP methods with avalanchego#2330
LudiSistemas wants to merge 1 commit into
mainfrom
fix/avalanche-specs-align-with-upstream

Conversation

@LudiSistemas

Copy link
Copy Markdown
Collaborator

Closes: N/A (no tracking issue, found while auditing the Avalanche specs against avalanchego and coreth)

This PR makes two small corrections to the Avalanche specs in specs/mainnet-1/specs.

AVALANCHEC (avalanche_c.json)

AVALANCHEC inherits the ETH1 debug collection, which includes debug_traceBlock. Coreth's tracer API only exposes traceBlockByNumber, traceBlockByHash, traceCall, traceTransaction, traceBadBlock and traceChain, so every debug_traceBlock relay currently ends as a node error on the provider. The method is now overridden with enabled: false in the /C/rpc debug collection, the same pattern avalanche.json already uses for methods coreth does not implement. Everything else in the inherited debug collection stays as is, including the debug_getRaw* family that the enabled verification relies on; those exist in coreth under the internal-debug api.

AVALANCHEP (avalanche_p.json)

The mainnet spec was missing five methods that avalanchego serves on the platform chain: platform.getBalance, platform.getBlockchains, platform.getRewardUTXOs, platform.getStake and platform.getSubnets. Four of them were added to the testnet-2 spec in #2305 but never made it to mainnet-1, so the two files had drifted. All five are added with the same block parsing, categories and compute units as the neighbouring methods. With this the spec covers the complete public platform.* service.

Scope and risk

Both changes are either additive or disable a single method. No verifications, parse directives, extensions, collection flags or existing compute units are touched. AVALANCHECT and AVALANCHEPT pick the changes up through inheritance.

Files to review: specs/mainnet-1/specs/avalanche_c.json, specs/mainnet-1/specs/avalanche_p.json.

Verification

Loaded ethereum.json, avalanche.json, avalanche_c.json and avalanche_p.json into the spec keeper and ran ExpandSpec plus ValidateSpec for AVAX, AVAXT, AVALANCHEC, AVALANCHECT, AVALANCHEP and AVALANCHEPT. All six expand and validate, and the expanded AVALANCHEC debug collection shows only debug_traceBlock disabled. go test ./x/spec/... ./utils/keeper/... passes. Method lists were checked against coreth (eth/tracers/api.go, internal/ethapi/api.go, eth/api_debug.go) and avalanchego (vms/platformvm/service.go).


Author Checklist

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

I have...

@github-actions

Copy link
Copy Markdown

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title " fix(specs): align AVALANCHEC debug addon and AVALANCHEP methods with avalanchego". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Align Avalanche C- and P-Chain specs with upstream APIs

🐞 Bug fix ✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Disable unsupported debug_traceBlock relays for Avalanche C-Chain providers.
• Add five missing public PlatformVM methods to the Avalanche P-Chain specification.
• Propagate corrected behavior to testnet specifications through inheritance.
Diagram

graph TD
  ETH1["ETH1 Debug"] -->|"inherited APIs"| C["AVALANCHEC"] -->|"valid debug relays"| Coreth["Coreth C-Chain"]
  C -->|"imported by"| CT["AVALANCHECT"]
  P["AVALANCHEP"] -->|"routes P calls"| Go["AvalancheGo P-Chain"]
  P -->|"imported by"| PT["AVALANCHEPT"]
Loading
High-Level Assessment

The localized specification changes are the appropriate approach: override only the Coreth-incompatible inherited method and explicitly declare AvalancheGo-supported PlatformVM methods. Changing the shared ETH1 debug collection would incorrectly affect other EVM chains, while runtime filtering would move provider-specific compatibility outside the declarative spec layer.

Files changed (2) +97 / -1

Enhancement (1) +90 / -0
avalanche_p.jsonAdd missing PlatformVM API methods +90/-0

Add missing PlatformVM API methods

• Adds 'platform.getBalance', 'platform.getBlockchains', 'platform.getRewardUTXOs', 'platform.getStake', and 'platform.getSubnets'. Each method receives block parsing, deterministic categorization, and compute-unit settings consistent with neighboring APIs.

specs/mainnet-1/specs/avalanche_p.json

Bug fix (1) +7 / -1
avalanche_c.jsonDisable unsupported debug_traceBlock relays +7/-1

Disable unsupported debug_traceBlock relays

• Overrides the inherited 'debug_traceBlock' method as disabled for the '/C/rpc' debug collection. Other inherited Coreth debug methods and verification behavior remain unchanged.

specs/mainnet-1/specs/avalanche_c.json

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
consensus 8.96% <ø> (ø)
protocol 38.69% <ø> (+0.01%) ⬆️

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

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

@github-actions

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 8920435. ± Comparison against base commit 3247744.

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.

1 participant