Skip to content

Resource Extension: add a verify/fix command#2810

Merged
elitegreg merged 5 commits intomainfrom
gm/resource_verify
Feb 4, 2026
Merged

Resource Extension: add a verify/fix command#2810
elitegreg merged 5 commits intomainfrom
gm/resource_verify

Conversation

@elitegreg
Copy link
Contributor

Summary of Changes

  • Adds doublezero resource verify command to verify missing/leaked resources
  • Has a --fix option to repair

Testing Verification

  • Unit tests
  • Tested by hand with a local validator

@elitegreg elitegreg requested a review from Copilot February 4, 2026 15:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a verification command for resource allocations with automatic repair capability. The doublezero resource verify command checks for discrepancies between allocated resources and their actual usage across accounts, identifying both orphaned allocations and missing resource entries. A --fix option enables automatic repair of identified issues.

Changes:

  • Added resource verification functionality to detect allocation discrepancies
  • Implemented --fix flag for automated repair with user confirmation
  • Extended CLI trait and implementation to support verification command

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
smartcontract/test/start-test.sh Updated activator command to include --onchain-allocation flag
smartcontract/programs/doublezero-serviceability/src/resource.rs Added Display trait and Hash derive for ResourceType and IdOrIp
smartcontract/programs/common/src/types/network_v4.rs Implemented Hash trait for NetworkV4
smartcontract/cli/src/resource/verify.rs Implemented complete verification logic with discrepancy detection and repair
smartcontract/cli/src/resource/mod.rs Registered new verify module
smartcontract/cli/src/doublezerocommand.rs Added get_all() method to CliCommand trait
client/doublezero/src/main.rs Integrated verify command into main CLI
client/doublezero/src/cli/resource.rs Added verify subcommand to resource commands

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elitegreg elitegreg enabled auto-merge (squash) February 4, 2026 17:47
@elitegreg elitegreg merged commit 30d59d6 into main Feb 4, 2026
21 checks passed
@elitegreg elitegreg deleted the gm/resource_verify branch February 4, 2026 19:00
bgm-malbeclabs pushed a commit that referenced this pull request Feb 4, 2026
## Summary of Changes
* Adds `doublezero resource verify` command to verify missing/leaked
resources
* Has a  --fix option to repair

## Testing Verification
* Unit tests
* Tested by hand with a local validator
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.

2 participants