fix(specs): align AVALANCHEC debug addon and AVALANCHEP methods with avalanchego - #2330
fix(specs): align AVALANCHEC debug addon and AVALANCHEP methods with avalanchego#2330LudiSistemas wants to merge 1 commit into
Conversation
|
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: |
PR Summary by QodoAlign Avalanche C- and P-Chain specs with upstream APIs
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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 exposestraceBlockByNumber,traceBlockByHash,traceCall,traceTransaction,traceBadBlockandtraceChain, so everydebug_traceBlockrelay currently ends as a node error on the provider. The method is now overridden withenabled: falsein the/C/rpcdebug collection, the same patternavalanche.jsonalready uses for methods coreth does not implement. Everything else in the inherited debug collection stays as is, including thedebug_getRaw*family that theenabledverification relies on; those exist in coreth under theinternal-debugapi.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.getStakeandplatform.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 publicplatform.*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.jsonandavalanche_p.jsoninto the spec keeper and ranExpandSpecplusValidateSpecfor AVAX, AVAXT, AVALANCHEC, AVALANCHECT, AVALANCHEP and AVALANCHEPT. All six expand and validate, and the expanded AVALANCHEC debug collection shows onlydebug_traceBlockdisabled.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...
prefix in the
PR title, you can find examples of