Skip to content

smartcontract/serviceability,sdk,cli: deprecate device/link/multicastgroup/interface activator-only instructions#3736

Merged
elitegreg merged 4 commits into
mainfrom
gm/issue3623
May 21, 2026
Merged

smartcontract/serviceability,sdk,cli: deprecate device/link/multicastgroup/interface activator-only instructions#3736
elitegreg merged 4 commits into
mainfrom
gm/issue3623

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

@elitegreg elitegreg commented May 20, 2026

⚠️ DO NOT MERGE until onchain ProgramConfig.min_compatible_version has been bumped to ≥ 0.15.0. ⚠️

Phase 7.2 of the activator-removal effort (tracker #3607). Contributor-side companion to #3735 (Phase 7.1, user-lifecycle).

Summary

  • Deprecate the 13 contributor-side program instructions whose only client was the now-deleted activator: ActivateDevice (21), RejectDevice (22), CloseAccountDevice (27), ActivateLink (29), RejectLink (30), CloseAccountLink (35), ActivateMulticastGroup (47), RejectMulticastGroup (48), DeactivateMulticastGroup (53), ActivateDeviceInterface (72), RemoveDeviceInterface (75), UnlinkDeviceInterface (77), and RejectDeviceInterface (78). Dispatch arms now short-circuit to DoubleZeroError::Deprecated (custom code 67); the borsh variant tags are kept as unit variants so the wire format is unchanged — old clients still hit a deterministic deprecation error rather than an unknown-instruction decode failure.
  • Delete the corresponding program processor files (processors/{device,link,multicastgroup}/{activate,reject,closeaccount}.rs and processors/device/interface/{activate,reject,remove,unlink}.rs) and their argument structs.
  • Delete the corresponding Rust SDK command wrappers (sdk/rs/src/commands/{device,link,multicastgroup}/... and device/interface/...) and the orphaned DoubleZeroProgram trait methods on the CLI side; verified no live caller remains across smartcontract/cli/, client/, controlplane/, telemetry/, and api/.
  • Bump MIN_COMPATIBLE_VERSION from 0.12.0 to 0.15.0 in smartcontract/programs/doublezero-serviceability/src/min_version.rs. The activator-removal tracker (activator removal: tracker #3607) documented this gate as ≥ 0.14.1, but the client/v0.14.1 git tag was a patch release built from a commit whose workspace Cargo version = "0.14.0" — so the v0.14.1 CLI binary self-reports as 0.14.0 in its startup version check (embedded_version < program.min_compat_version → bail). v0.15.0 is the first release whose embedded version actually satisfies the intended ≥ 0.14.1 gate, so setting the program gate to 0.15.0 is what we mean in practice. Same value used for the globalMinVersions floor in e2e/compatibility_test.go.
  • Prune integration tests that exercised the deprecated flows; rewrite the multi-step device delete + close-account sequence in device_test.rs, device_update_location_test.rs, and the close_device helper in resource_extension_test.rs to use the existing atomic DeleteDevice path. Delete unlink_device_interface_test.rs entirely (its subject is wholly the deprecated UnlinkDeviceInterface flow). Drop the unused activate_link helper in doublezero-telemetry/tests/test_helpers.rs (its consumers already use create_and_activate_link, which is atomic via CreateLink).
  • Add tests/deprecated_contributor_instructions_test.rs — 13 #[tokio::test] cases, one per removed variant, asserting ProgramError::Custom(67) = Deprecated.

CloseResource (variant 85) is preserved: audit confirms it is foundation-allowlist-driven, not activator-driven.

Risk

Hard removal. Any client running CLI < 0.15.0 against an upgraded program will no longer be able to send these 13 instructions. The min_compatible_version bump must happen first — this PR is the merge-after-gate-met half.

This PR is significantly larger than the 500-line guideline (47 files, +267 / -4892 in the main change). The phase is one indivisible gate flip per the tracker (#3607), and Phase 7.1 (#3735, +130 / -2580) set the precedent.

Testing Verification

  • cargo test -p doublezero-serviceability --test deprecated_contributor_instructions_test — 13 / 13 deprecation assertions pass.
  • cargo test -p doublezero-serviceability --tests — all integration tests pass (full suite, including the rewritten atomic-close tests).
  • cargo test -p doublezero-serviceability --lib — 257 unit tests pass.
  • cargo test -p doublezero_sdk --lib — 153 unit tests pass.
  • make rust-lint clean.
  • E2E TestE2E_BackwardCompatibility exercises CLI versions v0.15.0 through current against the upgraded program from this branch.

Closes #3623. Tracker: #3607.

…group/interface activator-only instructions

Phase 7.2 of the activator-removal effort (tracker #3607). The 13
contributor-side program instructions whose only caller was the now-deleted
activator now short-circuit to DoubleZeroError::Deprecated (custom code 67).
Borsh variant discriminants are preserved as unit variants so the wire format
is unchanged. Bumps MIN_COMPATIBLE_VERSION to 0.14.1. Gated on onchain
ProgramConfig.min_compatible_version >= 0.14.1.

Closes #3623.
@elitegreg elitegreg marked this pull request as ready for review May 20, 2026 18:37
@elitegreg elitegreg enabled auto-merge (squash) May 20, 2026 18:38
@elitegreg elitegreg requested review from juan-malbeclabs and vihu May 20, 2026 18:38
Copy link
Copy Markdown
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

elitegreg added 2 commits May 20, 2026 21:38
The client/v0.14.1 git tag was built from a commit whose workspace Cargo
version was still 0.14.0, so the v0.14.1 CLI binary self-reports as 0.14.0
in the startup version check. Once the program's min_compatible_version
is at 0.14.1, that check rejects the v0.14.1 binary before any RPC call.
Floor the test at v0.15.0 (first release whose embedded version actually
clears the 0.14.1 gate).
The client/v0.14.1 git tag was a patch release whose workspace Cargo
version was still 0.14.0, so the v0.14.1 CLI binary self-reports as
0.14.0 in its startup version check. v0.15.0 is the first release whose
embedded version actually satisfies the intended >= 0.14.1 gate, so set
the program gate (and the e2e compat test floor) there.
@elitegreg elitegreg merged commit 4bafe77 into main May 21, 2026
38 of 39 checks passed
@elitegreg elitegreg deleted the gm/issue3623 branch May 21, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants