smartcontract/serviceability,sdk: deprecate user activate/reject/closeaccount/ban instructions#3735
Merged
Conversation
…eaccount/ban instructions Phase 7.1 of the activator-removal effort (tracker #3607). With the offchain activator gone and onchain allocation always-on, the four user-lifecycle instructions ActivateUser / RejectUser / CloseAccountUser / BanUser are unreachable from any live caller. Their dispatch handlers now return DoubleZeroError::Deprecated (custom code 67); the enum variants stay at borsh tag positions 37/38/43/45 so the wire format is unchanged. Processor files and SDK command wrappers are deleted. Gated on onchain min_compatible_version >= 0.12.0. Closes #3622
elitegreg
added a commit
that referenced
this pull request
May 21, 2026
…group/interface activator-only instructions (#3736) >⚠️ **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 (#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.
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.
Phase 7.1 of the activator-removal effort (tracker #3607).
Summary
ActivateUser(variant 37),RejectUser(38),CloseAccountUser(43), andBanUser(45). Their dispatch handlers now short-circuit toDoubleZeroError::Deprecated(custom code 67). The enum cases are kept (as unit variants) so borsh discriminator positions don't shift — old clients still get a deterministic deprecation error rather than an unknown-instruction decode failure.processors/user/{activate,reject,closeaccount,ban}.rs) and their argument structs.sdk/rs/src/commands/user/{activate,reject,closeaccount,ban}.rs); they had no remaining live callers.RequestBanUserCommand(operator-driven, atomic post-RFC-11) is unaffected.test_activate_user_*integration tests that exercised the activator-driven flow; the atomic-create-and-activate path is already covered bytest_create_user_atomic_*. Drop the obsoletetest_user_ban_requires_pendingbantest.tests/deprecated_user_instructions_test.rsasserting all four discriminators now returnProgramError::Custom(67).Risk
Hard removal. Any client running CLI < 0.12.0 against an upgraded program will no longer be able to send these four instructions. The
min_compatible_versionbump must happen first — this PR is the merge-after-gate-met half.Testing Verification
cargo test -p doublezero-serviceability --tests— 33 integration tests pass, including the 4 new deprecation assertions and the unchangedtest_user_delete_from_banned.cargo test -p doublezero-serviceability --libandcargo test -p doublezero_sdk --libpass (256 + 165 unit tests).make rust-lintclean.Custom(0x43) = Deprecated, verified end-to-end by the new test.Closes #3622. Tracker: #3607.