Skip to content

client/sentinel/cli: read interfaces from new_interfaces#3671

Merged
elitegreg merged 3 commits intomainfrom
gm/3659-read-from-new-interfaces
May 5, 2026
Merged

client/sentinel/cli: read interfaces from new_interfaces#3671
elitegreg merged 3 commits intomainfrom
gm/3659-read-from-new-interfaces

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

Summary

  • 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 — NewInterface exposes the same field names directly.
  • Update poll_for_device_interface_activated to return NewInterface instead of CurrentInterfaceVersion.
  • Re-export NewInterface from the Rust SDK so CLI display structs can take &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 (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, and make rust-test all pass on the branch.
  • Verified per-crate with cargo test -p doublezero_cli -p doublezero-sentinel -p doublezero-admin -p doublezero -p doublezero_sdk -p doublezero-serviceability.
  • Confirmed no remaining device.interfaces / into_current_version / into_v3 reads in the migrated areas via grep. The smartcontract program (smartcontract/programs/...) and activator are intentionally untouched.
  • Test fixtures that previously set interfaces: vec![CurrentInterfaceVersion {...}.to_interface()] and new_interfaces: vec![] were inverted to populate new_interfaces (via (&v2).try_into().unwrap()) so the migrated read paths see the data.

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
Comment thread smartcontract/cli/src/poll_for_activation.rs Outdated
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.
@elitegreg elitegreg marked this pull request as ready for review May 5, 2026 20:39
@elitegreg elitegreg enabled auto-merge (squash) May 5, 2026 20:41
@elitegreg elitegreg merged commit 77c6961 into main May 5, 2026
33 checks passed
@elitegreg elitegreg deleted the gm/3659-read-from-new-interfaces branch May 5, 2026 21:01
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.

client/sentinel/cli: read interfaces from new_interfaces

2 participants