Resource Extension: add a verify/fix command#2810
Merged
Conversation
There was a problem hiding this comment.
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
--fixflag 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.
vihu
reviewed
Feb 4, 2026
vihu
approved these changes
Feb 4, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
doublezero resource verifycommand to verify missing/leaked resourcesTesting Verification