client/sentinel/cli: read interfaces from new_interfaces#3671
Merged
client/sentinel/cli: read interfaces from new_interfaces#3671
Conversation
Migrate Rust read callers (CLI, sentinel, client, controlplane admin, Rust SDK topology helper) from `device.interfaces` to `device.new_interfaces`, and adopt the `Device::find_interface` signature that returns `&NewInterface`. Drop `into_current_version()` / `into_v3()` calls at the migrated sites; field names line up directly on `NewInterface`. The legacy `interfaces` slot is still written on-disk via the per-write V2 projection from #3667; this PR only migrates reads. The temporary `Device::find_interface_legacy` helper is retained because the smartcontract program processors still depend on it; those migrate in a later issue. Activator is deliberately excluded — it is deprecated. Closes #3659
elitegreg
commented
May 5, 2026
With onchain allocation, `CreateDeviceInterface` activates the interface synchronously (Activated for loopbacks, Unlinked for physical), so an interface returned by `find_interface` will never be in `Pending` status by the time the poll observes it. Drop the `!= Pending` branch and return the interface as soon as the find succeeds. Addresses review feedback on #3671.
ben-dz
approved these changes
May 5, 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
device.interfacestodevice.new_interfaces, and adopt theDevice::find_interfacesignature that returns&NewInterface.into_current_version()/into_v3()calls at the migrated sites —NewInterfaceexposes the same field names directly.poll_for_device_interface_activatedto returnNewInterfaceinstead ofCurrentInterfaceVersion.NewInterfacefrom the Rust SDK so CLI display structs can take&NewInterface.The legacy
interfacesslot is still written on-disk via the per-write V2 projection from #3667; this PR only migrates reads. The temporaryDevice::find_interface_legacyhelper is retained because the smartcontract program processors (processors/link/*.rs,processors/device/interface/*.rs) still depend on it; those migrate in a later issue. Activator is deliberately excluded — it is deprecated.Design: https://gist.github.com/elitegreg/e1d27c97034656a980fa8d7628ae16c5
Depends on #3667
Closes #3659
Testing Verification
make rust-fmt,make rust-lint, andmake rust-testall pass on the branch.cargo test -p doublezero_cli -p doublezero-sentinel -p doublezero-admin -p doublezero -p doublezero_sdk -p doublezero-serviceability.device.interfaces/into_current_version/into_v3reads in the migrated areas viagrep. The smartcontract program (smartcontract/programs/...) and activator are intentionally untouched.interfaces: vec![CurrentInterfaceVersion {...}.to_interface()]andnew_interfaces: vec![]were inverted to populatenew_interfaces(via(&v2).try_into().unwrap()) so the migrated read paths see the data.