smartcontract/serviceability,sdk,cli: deprecate device/link/multicastgroup/interface activator-only instructions#3736
Merged
Merged
Conversation
…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.
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.
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.2 of the activator-removal effort (tracker #3607). Contributor-side companion to #3735 (Phase 7.1, user-lifecycle).
Summary
ActivateDevice(21),RejectDevice(22),CloseAccountDevice(27),ActivateLink(29),RejectLink(30),CloseAccountLink(35),ActivateMulticastGroup(47),RejectMulticastGroup(48),DeactivateMulticastGroup(53),ActivateDeviceInterface(72),RemoveDeviceInterface(75),UnlinkDeviceInterface(77), andRejectDeviceInterface(78). Dispatch arms now short-circuit toDoubleZeroError::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.processors/{device,link,multicastgroup}/{activate,reject,closeaccount}.rsandprocessors/device/interface/{activate,reject,remove,unlink}.rs) and their argument structs.sdk/rs/src/commands/{device,link,multicastgroup}/...anddevice/interface/...) and the orphanedDoubleZeroProgramtrait methods on the CLI side; verified no live caller remains acrosssmartcontract/cli/,client/,controlplane/,telemetry/, andapi/.MIN_COMPATIBLE_VERSIONfrom0.12.0to0.15.0insmartcontract/programs/doublezero-serviceability/src/min_version.rs. The activator-removal tracker (activator removal: tracker #3607) documented this gate as ≥ 0.14.1, but theclient/v0.14.1git tag was a patch release built from a commit whose workspace Cargoversion = "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.0is the first release whose embedded version actually satisfies the intended ≥ 0.14.1 gate, so setting the program gate to0.15.0is what we mean in practice. Same value used for theglobalMinVersionsfloor ine2e/compatibility_test.go.device_test.rs,device_update_location_test.rs, and theclose_devicehelper inresource_extension_test.rsto use the existing atomicDeleteDevicepath. Deleteunlink_device_interface_test.rsentirely (its subject is wholly the deprecatedUnlinkDeviceInterfaceflow). Drop the unusedactivate_linkhelper indoublezero-telemetry/tests/test_helpers.rs(its consumers already usecreate_and_activate_link, which is atomic viaCreateLink).tests/deprecated_contributor_instructions_test.rs— 13#[tokio::test]cases, one per removed variant, assertingProgramError::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_versionbump 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-lintclean.TestE2E_BackwardCompatibilityexercises CLI versions v0.15.0 throughcurrentagainst the upgraded program from this branch.Closes #3623. Tracker: #3607.