smartcontract: revert default Interface to V2; keep V3 for migrate/backfill#3653
Merged
smartcontract: revert default Interface to V2; keep V3 for migrate/backfill#3653
Conversation
…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.
a037495 to
ed83135
Compare
ben-dz
approved these changes
May 3, 2026
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
CurrentInterfaceVersiontoInterfaceV2soCreateDeviceInterfaceandUpdateDeviceInterfacestop writing the RFC-18InterfaceV3encoding onchain. V3 is staying for now just for compilation support for Topology.MigrateDeviceInterfacesandBackfillTopologywritingInterfaceV3— both are admin-controlled andflex_algo_node_segmentsonly lives on V3, so the migrate/backfill paths still need it.TryFrom<&InterfaceV3> for InterfaceV2and a newInterface::into_v3()accessor so call sites can opt into the V3 view (backfill idempotency check, admin migrate-needed check) without forcing V3 on everyone viainto_current_version().Testing Verification
make rust-lintcleanmake rust-testpasses (79 test groups, 0 failures), including the targetedtest_migrate_device_interfaces_legacy_account,test_topology_backfill_populates_vpnv4_loopbacks, andtest_topology_backfill_allocates_sr_id_from_onchain_resourcewhich exercise the V3 paths that must keep workingprocess_create_device_interfacenow produces anInterface::V2variant (discriminant 1) via the existingtest_state_device_serialization