Draft
Conversation
Community stamping only resolved colors for users with a tenant assigned. Since most users (all of mainnet, most of testnet) have no tenant, they were silently skipped. Add an else branch that calls resolveTenantColors with nil includeTopologies, which falls through to the default UNICAST-DEFAULT color.
When creating a VPNv4 loopback with onchain allocation, the instruction now accepts optional topology PDA accounts and allocates a FlexAlgoNodeSegment for each. This replaces the activator's post- activation backfill that was lost during the activator removal. The CLI automatically discovers existing topologies and passes them to the instruction, so `doublezero device interface create ... --loopback-type vpn-ipv4` assigns all node segments atomically — no manual steps. Also rename BackfillTopology → AssignTopologyNodeSegments across the codebase (instruction discriminant 110 unchanged).
- cli/device-interface-get: cache list_topology in a HashMap so we don't refetch per flex-algo segment - create/update: validate topology accounts by first-byte AccountType::Topology in addition to program-owner - update: allow contributor.owner to drive update_topologies, not just the foundation allowlist - update: size kept Vec by max(existing, desired) so we don't realloc when the desired set grows - tests: add test_update_topologies_allowed_for_contributor exercising the contributor-owner authorization branch - changelog: add Unreleased entries covering this PR's smartcontract, controller, and CLI changes
- create processor: reject duplicate topology PDAs in CreateDeviceInterface with InvalidArgument before allocating an SR ID, matching the dedupe in UpdateDeviceInterface. - sdk: compute topology_count once via u8::try_from(names.len()) on both create and update commands so > 255 topologies returns an error instead of silently wrapping. - sdk: in UpdateDeviceInterfaceCommand, return an error when topology_names is provided but OnChainAllocation is disabled, instead of silently dropping the request. - cli: normalize --topologies names with to_ascii_uppercase to match the canonical form used to derive topology PDAs.
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
Address the four unresolved Copilot review threads on #3648:
CreateDeviceInterfaceso a caller can't allocate two flex-algo SR IDs for the same topology — mirrors the existing dedupe inUpdateDeviceInterface.topology_countviau8::try_from(topology_names.len())in the Rust SDK'sCreateDeviceInterfaceCommandandUpdateDeviceInterfaceCommandso passing more than 255 topology names errors out instead of silently wrapping.UpdateDeviceInterfaceCommand, return an error when topology reconciliation is requested but theOnChainAllocationfeature flag is off, instead of silently dropping the request.--topologiesnames withto_ascii_uppercaseto match the canonical form used to derive topology PDAs.Stacks on top of #3648 (base
bc/rfc18-devnet-fixes).Related RFC: rfcs/rfc-0018-flex-algo.md
Testing Verification
test_create_device_interface_rejects_duplicate_topology_accountsininterface_onchain_allocation_test.rsexercises the dedupe path onCreateDeviceInterface.cargo test -p doublezero-serviceability— full smartcontract suite passes, including the existingtest_update_topologies_*cases.cargo test -p doublezero_sdk device::interfaceandcargo test -p doublezero_cli device::interfacecover the SDK / CLI changes.