Skip to content

sdk/go,controlplane,client,telemetry: propagate *Deprecated status renames#3722

Merged
elitegreg merged 8 commits into
mainfrom
gm/phase-5.4-go-sdk-consumers-status-deprecated
May 20, 2026
Merged

sdk/go,controlplane,client,telemetry: propagate *Deprecated status renames#3722
elitegreg merged 8 commits into
mainfrom
gm/phase-5.4-go-sdk-consumers-status-deprecated

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

Summary

  • Final PR of the Phase 5 chain. Mirrors PR 5.1's *Deprecated rename in the Go SDK and every Go consumer.
  • Restores make go-build / make go-test to green for all affected packages.
  • Implements the controller LinkStatusPending sentinel migration (option (b) from the planning Q&A): the controller now uses a local linkStatusUnknown = 255 constant for the in-memory "no link mapped" placeholder, never reusing onchain discriminants for sentinels.

Highlights

  • smartcontract/sdk/go/serviceability/state.go — rename constants on UserStatus, DeviceStatus, LinkStatus, MulticastGroupStatus, LocationStatus, ExchangeStatus. Numeric values preserved (Borsh-compatible). String() emits pending (deprecated), rejected (deprecated), etc., matching the Rust Display change. MarshalJSON() delegates to String() and picks up the suffix automatically. Adds the previously-missing MulticastGroupStatus.String() since the iota-based const block had no String() method.
  • controlplane/controller/internal/controller/{models,server}.go — controller sentinel migration. linkStatusUnknown = 255 lives in models.go with a one-line comment documenting that it is controller-local and never written to chain. server.go:408 updated to use it.
  • Go consumer fixes: client/doublezerod/internal/manager/reconciler_test.go (exhaustive status iteration uses renamed *Deprecated constants — preserves coverage per the Phase 4 test-handling rule), controlplane/monitor/internal/serviceability/events_test.go, controlplane/telemetry/internal/telemetry/peers_test.go.
  • Test fixture updates for new String() output: smartcontract/sdk/go/serviceability/{influx_test,state_test}.go and controlplane/monitor/internal/device-telemetry/watcher_test.go (AccountNotFound metric label).

Testing Verification

  • make go-build clean.
  • 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_RAW for raw socket operations (pre-existing failures on main, unrelated to this change).
  • Grep across **/*.go for 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.

elitegreg added 7 commits May 19, 2026 20:42
…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.
@elitegreg elitegreg force-pushed the gm/phase-5.3-ts-python-sdk-status-deprecated branch from 2d42623 to 10919f5 Compare May 19, 2026 23:44
…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.
@elitegreg elitegreg force-pushed the gm/phase-5.4-go-sdk-consumers-status-deprecated branch from 8ed5b00 to 2ecba6b Compare May 19, 2026 23:44
@elitegreg elitegreg marked this pull request as ready for review May 19, 2026 23:50
@elitegreg elitegreg requested review from juan-malbeclabs and vihu May 19, 2026 23:50
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

Base automatically changed from gm/phase-5.3-ts-python-sdk-status-deprecated to main May 20, 2026 13:59
@elitegreg elitegreg merged commit ec75a5c into main May 20, 2026
33 of 34 checks passed
@elitegreg elitegreg deleted the gm/phase-5.4-go-sdk-consumers-status-deprecated branch May 20, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

activator removal phase 5.4: Go SDK + Go consumers — propagate status variant renames

2 participants