cli: verify MulticastPublisherBlock in resource verify#3554
Merged
Conversation
Extend `doublezero resource verify` to cover `MulticastPublisherBlock`, the global IP block from which multicast publisher users allocate their dz_ip. The command now checks that every publisher user's in-range dz_ip is allocated in the extension and that every allocation has a matching user, with the existing `--fix` flow handling both directions. Legacy publishers whose dz_ip was allocated before the MulticastPublisherBlock extension existed may have an IP outside the block's range; those are ignored rather than reported as discrepancies.
juan-malbeclabs
approved these changes
Apr 21, 2026
Contributor
juan-malbeclabs
left a comment
There was a problem hiding this comment.
Clean implementation, follows the existing verifier pattern well. Two small comments inline.
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 verifyto cover theMulticastPublisherBlockresource extension, the global IP block from which multicast publisher users allocate theirdz_ip. Previously only 7 of 10ResourceTypevariants were verified; publishers'dz_ipallocations were invisible to the tool.dz_ipmust be allocated in the extension, and every allocation must have a matching user. Discrepancies flow through the existinginsert_usage/check_discrepancieshelpers and are auto-fixable via--fix.dz_ipwas allocated before this extension existed and falls outside the block's range (e.g. prior toMulticastPublisherBlock). Without this guard, those would be reported asUsedButNotAllocatedand--fixwould then fail becauseallocate_specificrejects out-of-range IPs.MulticastPublisherBlockto the "Resources checked" summary output.Diff Breakdown
Mostly tests and a small, pattern-following addition to the verify CLI. Core logic is the new
verify_multicast_publisher_blockfunction plus imports/wiring.Key files (click to expand)
smartcontract/cli/src/resource/verify.rs— newverify_multicast_publisher_blockfunction, output + counter wiring, plus 2 new tests (happy path, out-of-range ignore) and updates to 4 existing tests to register the new extension.Testing Verification
test_verify_multicast_publisher_block_happy_path— extension has148.51.120.5allocated, one publisher user holds it, expect no discrepancies.test_verify_multicast_publisher_ignores_out_of_range_dz_ip— covers two edge cases: a publisher with a legacydz_ipoutside the block's range, and a non-publisherUserType::Multicastuser with an in-rangedz_ip; both must be ignored.resource::verifytests pass; fulldoublezero_clisuite (296 tests) passes.