sdk/go,controller: add TopologyInfo deserialization and flex-algo controller support#3515
Open
ben-malbeclabs wants to merge 23 commits intomainfrom
Open
sdk/go,controller: add TopologyInfo deserialization and flex-algo controller
support#3515ben-malbeclabs wants to merge 23 commits intomainfrom
ben-malbeclabs wants to merge 23 commits intomainfrom
Conversation
This was referenced Apr 10, 2026
3272eb1 to
72ca31d
Compare
This was referenced Apr 10, 2026
9fada61 to
1e48cde
Compare
…pport - Add flex_algo_node_segments field to Interface::V2; add deserialize_legacy_v2_interface for reading pre-RFC-18 accounts - Add MigrateDeviceInterfaces processor: rewrites pre-RFC-18 device accounts (no flex_algo bytes) to new V2 layout; idempotent so the activator startup sweep can call it unconditionally; accepts foundation, device owner, or activator authority as signer - Wire MigrateDeviceInterfaces into entrypoint and instructions - Update ActivateLink to pass unicast_default_topology_pda unconditionally; processor tags link only when account is initialized - Update topology backfill/create processors - Remove V3 discriminant from smartcontract Go SDK; DeserializeInterfaceV2 now reads flex_algo_node_segments unconditionally (requires migration) - Register topology commands in Rust SDK - Add integration tests for MigrateDeviceInterfaces: idempotency, authorization (unauthorized/activator/non-signer), legacy account migration
…mmands FlexAlgo teardown commands (no traffic-engineering, no next-hop resolution ribs, no router traffic-engineering) were emitted unconditionally whenever FlexAlgoEnabled=false. In e2e, no --features-config is passed so Config is nil. Issuing these no-ops on fresh cEOS caused configure session errors which rolled back the entire session, including the no neighbor command used to remove disconnected users. Fix: guard all FlexAlgo cleanup branches with else-if $.Config so they only fire when a features config was loaded (FlexAlgo was deployed or is being disabled). When Config is nil, the controller was never configured for FlexAlgo, so there is nothing to clean up. Update all render fixtures and the flex-algo-disabled test case (now uses a non-nil Config with FlexAlgo.Enabled=false) to match.
…o deserialization, and IndexType numbering
Config non-nil causes tunnel.tmpl to emit 'no traffic-engineering' cleanup lines in all non-flex-algo tests, breaking IBRL fixture comparisons.
…llback When flex-algo is disabled after being enabled, the controller was not emitting 'no node-segment ipv4 index X flex-algo TOPOLOGY' cleanup lines on Loopback255. Root cause: FlexAlgoNodeSegments was only populated when flex-algo was enabled, so the template had nothing to iterate over during rollback. Fix: populate FlexAlgoNodeSegments whenever a features config is loaded (not just when enabled), so the template can emit cleanup lines even when flex-algo is being disabled.
…enant deserialization - add missing IncludeTopologies deserialization in DeserializeTenant (root cause of community stamping not working) - fix resolveTenantColors fallback to use case-insensitive comparison - uppercase all topology name references in tunnel.tmpl that were missing ToUpper (node-segment flex-algo, isis flex-algo, traffic-engineering flex-algo) - update fixtures to match new uppercase output
b102bd9 to
33ab59c
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.
RFC-18 flex-algo · PR 5 of 5 · see
rfcs/rfc-0018-flex-algo.mdDepends on: #3497 (PR 1) — does not require PRs 2–4; can merge after PR 1
Series: #3497 · #3512 · #3513 · #3514 · #3515
Summary of Changes
TopologyInfoaccount type to the Go SDK (state.go,deserialize.go,client.go), includingTopologyType,TopologyConstraint,LinkTopologies/LinkFlagsonLink, andIncludeTopologiesonTenantFeaturesConfigYAML support (--features-configflag on controller) gating flex-algo IS-IS and BGP color community stamping; disabled by defaultresolveTenantColors, and emits IS-IS flex-algo node segment and link configuration into the Arista EOS templatee2e/compatibility_test.goto set the mandatory upgrade boundary for 20 RFC-18 interface/link operations tobefore: "0.18.0"(v0.17.0 was released before RFC-18 merged)Diff Breakdown
Fixtures are two new EOS golden configs; most of the test weight is in render tests and the features config test. Core logic is the controller server, template, and Go SDK deserialization.
Key files (click to expand)
controlplane/controller/internal/controller/server.go— populatesTopologiesmap in state cache; resolvesLinkTopologiespubkeys to topology names andUnicastDrainedfromLinkFlags; computesTenantTopologyColorsstring; warns when flex-algo enabled but no topologies foundcontrolplane/controller/internal/controller/templates/tunnel.tmpl— adds IS-IS flex-algo node segment config and BGP color community stamping blocks, gated byFlexAlgoEnabled()and non-emptyTenantTopologyColors; guards cleanup commands behindConfig != nilto avoid EOS session rollback in e2econtrolplane/controller/internal/controller/features_config.go— new:FeaturesConfigstruct withflex_algo.enabled, parsed from YAML; loaded via--features-configflagcontrolplane/controller/internal/controller/models.go— addsLinkTopologies,UnicastDrained,FlexAlgoNodeSegments,TenantTopologyColorsto controller model typessmartcontract/sdk/go/serviceability/state.go— addsTopologyType,TopologyConstraint,TopologyInfo,LinkTopologies/LinkFlagsonLink,IncludeTopologiesonTenantsmartcontract/sdk/go/serviceability/client.go— addsListTopologiesto the Go SDK clientcontrolplane/controller/internal/controller/render_test.go— new render tests for flex-algo enabled and disabled pathscontrolplane/controller/internal/controller/fixtures/base.config.flex-algo.txt— expected EOS config with IS-IS flex-algo segments and BGP color communitiesTesting Verification
go test ./smartcontract/sdk/go/... ./controlplane/controller/...— all pass includingrender_flex_algo_enabled_successfullyandrender_flex_algo_disabled_cleanup_successfullyTestE2E_IBRL,TestE2E_IBRL_WithAllocatedAddr,TestE2E_Multicast— all pass; flex-algo cleanup commands are guarded so they don't fire in e2e (where controller runs without--features-config)before: "0.18.0"boundary for RFC-18 interface/link operations