Skip to content

smartcontract: revert default Interface to V2; keep V3 for migrate/backfill#3653

Merged
elitegreg merged 2 commits intomainfrom
gm/interface-v2-default
May 3, 2026
Merged

smartcontract: revert default Interface to V2; keep V3 for migrate/backfill#3653
elitegreg merged 2 commits intomainfrom
gm/interface-v2-default

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

@elitegreg elitegreg commented May 2, 2026

Summary

  • Revert CurrentInterfaceVersion to InterfaceV2 so CreateDeviceInterface and UpdateDeviceInterface stop writing the RFC-18 InterfaceV3 encoding onchain. V3 is staying for now just for compilation support for Topology.
  • Keep MigrateDeviceInterfaces and BackfillTopology writing InterfaceV3 — both are admin-controlled and flex_algo_node_segments only lives on V3, so the migrate/backfill paths still need it.
  • Add TryFrom<&InterfaceV3> for InterfaceV2 and a new Interface::into_v3() accessor so call sites can opt into the V3 view (backfill idempotency check, admin migrate-needed check) without forcing V3 on everyone via into_current_version().

Testing Verification

  • make rust-lint clean
  • make rust-test passes (79 test groups, 0 failures), including the targeted test_migrate_device_interfaces_legacy_account, test_topology_backfill_populates_vpnv4_loopbacks, and test_topology_backfill_allocates_sr_id_from_onchain_resource which exercise the V3 paths that must keep working
  • Verified process_create_device_interface now produces an Interface::V2 variant (discriminant 1) via the existing test_state_device_serialization

…ckfill

CurrentInterfaceVersion is now InterfaceV2 again. CreateDeviceInterface
and UpdateDeviceInterface no longer write the V3 (RFC-18 flex-algo)
encoding onchain. MigrateDeviceInterfaces and BackfillTopology still
write V3 since they're admin-controlled and need flex_algo_node_segments.

Adds TryFrom<&InterfaceV3> for InterfaceV2 and Interface::into_v3() so the
two V3-aware paths can keep working.
@elitegreg elitegreg force-pushed the gm/interface-v2-default branch from a037495 to ed83135 Compare May 2, 2026 19:21
@elitegreg elitegreg marked this pull request as ready for review May 2, 2026 23:18
@elitegreg elitegreg enabled auto-merge (squash) May 2, 2026 23:31
@elitegreg elitegreg merged commit 6fef55a into main May 3, 2026
38 of 39 checks passed
@elitegreg elitegreg deleted the gm/interface-v2-default branch May 3, 2026 00:03
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.

2 participants