smartcontract,client: add topology CLI commands#3512
Draft
ben-malbeclabs wants to merge 1 commit intobc/rfc18-pr1from
Draft
smartcontract,client: add topology CLI commands#3512ben-malbeclabs wants to merge 1 commit intobc/rfc18-pr1from
ben-malbeclabs wants to merge 1 commit intobc/rfc18-pr1from
Conversation
Adds `doublezero link topology {create,delete,clear,backfill,list}` subcommands.
- sdk/rs: topology command structs (create, delete, clear, backfill, list)
- cli: topology CLI wrappers with clap arg parsing and unit tests
- client/doublezero: wire topology subcommands into link command dispatch
- clear: auto-discovers tagged links when --links omitted; batches 29/tx
This was referenced Apr 10, 2026
Draft
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.
RFC-18 flex-algo · PR 2 of 5 · see
rfcs/rfc-0018-flex-algo.mdDepends on: #3497 (PR 1)
Series: #3497 · #3512 · #3513 · #3514 · #3515
Summary of Changes
doublezero link topologysubcommands:create,delete,clear,list,backfilldoublezero_sdk::commands::topologytopology listdisplays name, admin-group bit, flex-algo number, BGP color community, constraint, and linked link counttopology clearremoves a topology from all links that reference it;topology backfillallocates flex-algo node segments on all activated devices for a given topologylink topologysubcommand group into the existingdoublezero linkcommand treeDiff Breakdown
Heavy on new code — all five CLI commands and six SDK commands are new files with no prior equivalent.
Key files (click to expand)
smartcontract/cli/src/topology/list.rs— lists all TopologyInfo accounts; shows BGP color (128 + admin_group_bit), constraint, and how many links are tagged with each topologysmartcontract/cli/src/topology/clear.rs— removes a topology from all links that reference it; confirms or dry-runs before submitting transactionssmartcontract/cli/src/topology/create.rs— creates a topology with name, constraint (include-anyorexclude); admin-group bit and flex-algo number are allocated automatically onchainsmartcontract/cli/src/topology/backfill.rs— callsBackfillTopologyfor a named topology, optionally scoped to specific device pubkeyssmartcontract/sdk/rs/src/commands/topology/backfill.rs— SDK command forBackfillTopology; includes unit tests with mock clientsmartcontract/sdk/rs/src/commands/topology/list.rs— SDK command for listing topology accounts; includes unit testsTesting Verification
cargo test -p doublezero_sdk -p doublezero_clipassescargo clippy -- -D warningscleanmake rust-fmtapplied before commit