sentinel: improve multicast publisher find/create commands#3507
Draft
sentinel: improve multicast publisher find/create commands#3507
Conversation
0e3e3ea to
f8b2d9a
Compare
- Multi-value --client filter (OR semantics) for find and create commands - --ip filter on create command to target specific validator IPs - Nearest device column in find output (geographic Haversine distance) - Dynamic device re-evaluation during create loop with local capacity tracking - Fix owner bug: multicast publisher users now created with validator's owner, not the sentinel payer - E2E test: separate sentinel keypair to catch owner assignment bugs
5c45baa to
914d31c
Compare
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
--clientfilter to bothfindandcreatecommands (OR semantics, repeatable flag)--ipfilter tocreatecommand for targeting specific validator IPsfindoutput showing the closest DZ device with available multicast publisher capacity (geographic Haversine distance from the validator's current device)createexecution so slots filled earlier in the run are reflected in subsequent device selection; warn-and-skip if no device has capacityDiff Breakdown
Primarily new logic: nearest-device selection, device info fetching, and the owner bug fix account for the bulk of additions.
Key files (click to expand)
crates/sentinel/src/nearest_device.rs— new module: Haversine distance, device capacity check,find_nearest_device_for_multicastcrates/sentinel/src/dz_ledger_reader.rs—DzDeviceInfostruct andfetch_device_infos(batch fetches Device + Location accounts)controlplane/doublezero-admin/src/cli/sentinel.rs— CLI wiring for all new flags, NEAREST DEVICE column, dynamic device re-evaluation loopcrates/sentinel/src/multicast_create.rs—CandidateFiltersgetsclients: Vec<String>andips: Vec<Ipv4Addr>;find_candidatesacceptsdevice_infoscrates/sentinel/src/dz_ledger_writer.rs— owner bug fix: explicitownerparam used for PDA derivation,user_payer, andownerfield (was usingpayer)crates/sentinel/src/multicast_find.rs—FindFilters.clients: Vec<String>replacesclient: Option<String>e2e/sentinel_multicast_publisher_test.go— dedicated sentinel keypair setup; assertsu.Owner == dn.Manager.PubkeyTesting Verification
multicast_create.rs,multicast_find.rs,nearest_device.rs, anddz_ledger_writer.rscover filter logic, capacity checks, Haversine distance, and instruction building with correct ownerTestE2E_SentinelMulticastPublisherCreatesPublishersupdated to use a separate sentinel keypair so the owner assertion would have caught the bug before this fix