Skip to content

activator,sdk: add topology event handler and update Python/TypeScript SDKs for RFC-18#3514

Draft
ben-malbeclabs wants to merge 5 commits intobc/rfc18-pr2from
bc/rfc18-pr4
Draft

activator,sdk: add topology event handler and update Python/TypeScript SDKs for RFC-18#3514
ben-malbeclabs wants to merge 5 commits intobc/rfc18-pr2from
bc/rfc18-pr4

Conversation

@ben-malbeclabs
Copy link
Copy Markdown
Contributor

@ben-malbeclabs ben-malbeclabs commented Apr 10, 2026

RFC-18 flex-algo · PR 4 of 5 · see rfcs/rfc-0018-flex-algo.md
Depends on: #3512 (PR 2)
Series: #3497 · #3512 · #3513 · #3514 · #3515

Summary of Changes

  • Adds process_topology_event to the activator: when a TopologyInfo account is created or updated, the activator calls BackfillTopology on all devices that have an activated VPNv4 loopback (idempotent — skips devices that already have a segment for this topology)
  • Adds --enable-flex-algo flag to the activator (default: off); topology events are ignored unless the flag is set
  • Updates Python SDK to deserialize TopologyConstraint, TopologyInfo, and FlexAlgoNodeSegment, and reads flex_algo_node_segments from V2 interface accounts
  • Updates TypeScript SDK to deserialize FlexAlgoNodeSegment from V2 interface accounts and adds a configurable request timeout to the RPC client
  • Updates binary fixtures for device, link, and tenant accounts to include the new V2 interface format fields

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 7 +315 / -27 +288
Scaffolding 5 +17 / -5 +12
Tests 1 +3 / -1 +2
Fixtures 3 Bin changes

Mostly core logic concentrated in the new topology event handler and Python SDK deserialization.

Key files (click to expand)
  • activator/src/process/topology.rs — new: topology event handler; lists all active devices, filters to those with activated VPNv4 loopbacks, batches BackfillTopology calls
  • activator/src/process/iface_mgr.rs — calls backfill after a VPNv4 loopback is activated, so newly provisioned devices immediately get node segments for existing topologies
  • activator/src/process/device.rs — topology-aware device processing
  • activator/src/processor.rs — wires in process_topology_event for AccountData::Topology events; adds enable_flex_algo guard
  • sdk/serviceability/python/serviceability/state.py — adds TopologyConstraint enum, TopologyInfo dataclass, FlexAlgoNodeSegment dataclass; reads flex_algo_node_segments vec from V2 interface accounts
  • sdk/serviceability/typescript/serviceability/state.ts — adds FlexAlgoNodeSegment type; reads it from V2 interface accounts
  • sdk/serviceability/typescript/serviceability/rpc.ts — adds configurable request timeout

Testing Verification

  • cargo test -p doublezero-activator — 76 tests pass
  • Python SDK: 115 tests pass (pytest, including fixture deserialization)
  • TypeScript SDK: 138 tests pass (bun test, including fixture deserialization)
  • cargo clippy -- -D warnings clean after fixing for_kv_map lint in topology.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant