sdk/go,controlplane,client,telemetry: propagate *Deprecated status renames#3722
Merged
Merged
Conversation
…o *Deprecated Onchain allocation (RFC-11) is the only path that produces new accounts; the activator-driven Pending/Rejected (and User-specific PendingBan/Updating) states are unreachable for new data and only persist on legacy accounts. Rename those variants to *Deprecated across UserStatus, DeviceStatus, LinkStatus, MulticastGroupStatus, LocationStatus, ExchangeStatus. Numeric discriminants are preserved, so Borsh decoding of legacy accounts is unchanged. Display surfaces append ' (deprecated)' for the renamed variants; FromStr continues to accept the old strings. Part of #3607. Closes #3617.
- Move #[default] from PendingDeprecated to Activated on UserStatus, DeviceStatus, LinkStatus, MulticastGroupStatus, LocationStatus, ExchangeStatus. Borsh deserialization of legacy accounts is unchanged; Default::default() now returns Activated, matching the new reality where onchain allocation produces Activated accounts directly. - Remove dead status checks in User::validate (dz_ip, tunnel_net) and MulticastGroup::validate (multicast_ip) that gated validation on the deprecated Pending/Rejected variants. - Drop the dead 'Pending → not eligible' arm in subscribe, the dead Pending/Updating allowance in subscribe role checks, and the legacy Pending link-create initial state (links now create as Activated for non-DZX, Requested for DZX). - Switch test fixtures and Default impls (User/Device/Link/MulticastGroup) to Activated. - Remove the now-redundant 'rejected ignores X' tests for Link and MulticastGroup, and the redundant 'Pending device not eligible' case in test_device_is_device_eligible_for_provisioning. - Update INSTRUCTION_GUIDELINES.md example to use Activated.
…us renames
Follow-on to the serviceability program rename (PR 5.1). Updates every
Rust consumer of UserStatus / DeviceStatus / LinkStatus /
MulticastGroupStatus / LocationStatus / ExchangeStatus to use the
*Deprecated variant names.
Affected crates:
- smartcontract/sdk/rs (commands: user/{activate,delete,requestban}, device/delete, link/activate)
- smartcontract/cli (test fixtures in user/list, device/list, exchange/get)
- client/doublezero (connect.rs — provisioning match arms)
- controlplane/doublezero-admin (migrate-counts predicates)
- smartcontract/programs/doublezero-geolocation/tests (geo_probe_test)
- smartcontract/programs/doublezero-telemetry/tests (test_helpers)
poll_for_activation.rs requires no change — recent commit 0d7e7f7 already
dropped activator-only pollers, so no *Deprecated transitions are watched
anywhere in CLI poll loops. CLI 'status' columns format via the
serviceability Display impl, which appends '(deprecated)' automatically.
Part of #3607. Closes #3618.
- Drop dead RejectedDeprecated/PendingBanDeprecated arms from client/doublezero connect.rs (the Activated path is the only one reachable for new accounts). Removes the now-unused user_rejected helper. - Reduce 'is_live' user filter in controlplane/doublezero-admin to '!= Banned' since the other deprecated states cannot be set. - Remove the dead 'wait for activator: Updating -> Activated' retry loops in DeleteUserCommand and RequestBanUserCommand — UpdatingDeprecated is unreachable, so the loops never have work to do. - Switch SDK and CLI test fixtures that started accounts in PendingDeprecated to Activated where the test semantics still hold; for filter-by-status tests, switch to Drained (Device) / OutOfCredits (User) so the filter still discriminates two distinct alive statuses. - geolocation test_create_geo_probe_exchange_not_activated: use ExchangeStatus::Suspended as the 'not activated' fixture. - telemetry test_helpers::create_device: drop the legacy 'demote back to Pending' step (CreateDevice atomically activates), and reduce set_device_ready_for_users to a single SetDeviceHealth call.
- client/doublezero/connect.rs: prefix unused user_pubkey bindings with _ to silence clippy's unused_variables (their only consumer was the removed user_rejected helper). - telemetry tests: restore the legacy 'device not activated' fixtures that broke when create_device stopped demoting devices to PendingDeprecated. Add demote_device_to_pending_deprecated() helper on ServiceabilityProgramHelper and use it in the two initialize_device_latency_samples_tests that exercise the DeviceNotActivated rejection path. Foundation members may set any status via UpdateDevice, so tests can construct legacy-state fixtures explicitly.
test_initialize_device_latency_samples_fail_origin_device_not_activated and test_initialize_device_latency_samples_fail_target_device_not_activated exercised the DeviceNotActivated rejection path against a device in PendingDeprecated state. With onchain allocation always-on, new devices can never reach a non-activated status, so these failure paths are unreachable for any account produced by the current program. Remove the tests and the demote_device_to_pending_deprecated helper that was only keeping them alive.
…+ python) Mirror PR 5.1's *Deprecated rename into the TypeScript and Python SDK state files and the shared enum_strings.json fixture used by their __str__/string-function tests. - Python IntEnum members renamed (PENDING_DEPRECATED, REJECTED_DEPRECATED, PENDING_BAN_DEPRECATED, UPDATING_DEPRECATED on UserStatus; PENDING_DEPRECATED/REJECTED_DEPRECATED on Device/Link/MulticastGroup; PENDING_DEPRECATED on Location/Exchange). Default field values updated. - TypeScript Record<number, string> maps updated. - enum_strings.json values updated to 'pending (deprecated)' etc., matching Rust Display. - Numeric discriminants unchanged; Borsh deserialization of legacy on-chain accounts is unaffected. Note: TypeScript test verification was skipped locally because bun is not installed in this sandbox. The change is mechanical (Record<number, string> value updates) and the shared enum_strings.json fixture drives both the TS and Python enum-string assertions. Part of #3607. Closes #3619.
2d42623 to
10919f5
Compare
…names Mirror PR 5.1's *Deprecated rename in the Go SDK and every Go consumer. - smartcontract/sdk/go/serviceability/state.go: rename constants on UserStatus (Pending/Rejected/PendingBan/Updating), DeviceStatus, LinkStatus, MulticastGroupStatus, LocationStatus, ExchangeStatus to *Deprecated. Numeric values preserved. String() emits 'pending (deprecated)' etc., matching the Rust Display change; MarshalJSON delegates to String() and gains the suffix automatically. Adds the previously-missing MulticastGroupStatus.String() while we're here. - controlplane/controller: option (b) from the planning Q&A — replace the in-memory LinkStatus sentinel at server.go:408 with a new controller-local linkStatusUnknown constant (=255, outside the onchain discriminant range, never written to chain). Comment in models.go documents the sentinel intent. - Test fixtures updated to match the new String() output (status=pending (deprecated) in influx line protocol; pending (deprecated) in JSON-marshaled struct; AccountNotFound metric label). - reconciler_test.go's exhaustive UserStatus iteration uses the renamed *Deprecated constants (preserves coverage per Phase 4 test-handling rule). Part of #3607. Closes #3620.
8ed5b00 to
2ecba6b
Compare
Base automatically changed from
gm/phase-5.3-ts-python-sdk-status-deprecated
to
main
May 20, 2026 13:59
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
*Deprecatedrename in the Go SDK and every Go consumer.make go-build/make go-testto green for all affected packages.LinkStatusPendingsentinel migration (option (b) from the planning Q&A): the controller now uses a locallinkStatusUnknown = 255constant for the in-memory "no link mapped" placeholder, never reusing onchain discriminants for sentinels.Highlights
smartcontract/sdk/go/serviceability/state.go— rename constants onUserStatus,DeviceStatus,LinkStatus,MulticastGroupStatus,LocationStatus,ExchangeStatus. Numeric values preserved (Borsh-compatible).String()emitspending (deprecated),rejected (deprecated), etc., matching the Rust Display change.MarshalJSON()delegates toString()and picks up the suffix automatically. Adds the previously-missingMulticastGroupStatus.String()since the iota-based const block had noString()method.controlplane/controller/internal/controller/{models,server}.go— controller sentinel migration.linkStatusUnknown = 255lives inmodels.gowith a one-line comment documenting that it is controller-local and never written to chain.server.go:408updated to use it.client/doublezerod/internal/manager/reconciler_test.go(exhaustive status iteration uses renamed*Deprecatedconstants — preserves coverage per the Phase 4 test-handling rule),controlplane/monitor/internal/serviceability/events_test.go,controlplane/telemetry/internal/telemetry/peers_test.go.String()output:smartcontract/sdk/go/serviceability/{influx_test,state_test}.goandcontrolplane/monitor/internal/device-telemetry/watcher_test.go(AccountNotFound metric label).Testing Verification
make go-buildclean.go test ./controlplane/... ./smartcontract/sdk/go/... ./client/doublezerod/internal/api ./client/doublezerod/internal/bgp ./client/doublezerod/internal/manager— all packages pass except the latency / multicast-reconciler tests that require root/CAP_NET_RAWfor raw socket operations (pre-existing failures onmain, unrelated to this change).**/*.gofor the old constant names (UserStatusPending\b,UserStatusRejected\b,UserStatusPendingBan\b,UserStatusUpdating\b,DeviceStatusPending\b,DeviceStatusRejected\b,LinkStatusPending\b,LinkStatusRejected\b,MulticastGroupStatusPending\b,MulticastGroupStatusRejected\b,LocationStatusPending\b,ExchangeStatusPending\b) returns zero matches.Part of #3607.
Closes #3620.