Skip to content

activator: move multicast group cleanup from CLI to activator#3117

Draft
snormore wants to merge 2 commits intomainfrom
snor/activator-multicast-group-cleanup
Draft

activator: move multicast group cleanup from CLI to activator#3117
snormore wants to merge 2 commits intomainfrom
snor/activator-multicast-group-cleanup

Conversation

@snormore
Copy link
Contributor

@snormore snormore commented Feb 26, 2026

Summary of Changes

  • Move multicast group unsubscribe responsibility from the SDK DeleteUserCommand to the activator's Deleting/PendingBan handlers, eliminating transitory onchain states that caused unnecessary daemon reconciler re-provisioning
  • Allow onchain DeleteUser to proceed with non-empty publisher/subscriber lists (activator handles cleanup server-side before CloseAccount/Ban)
  • Permit SubscribeMulticastGroup for users in Deleting status so the activator can unsubscribe them

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 4 +65 / -57 +8
Tests 2 +16 / -346 -330

Net deletion of ~320 lines, removing client-side retry/polling complexity in favor of server-side cleanup.

Key files (click to expand)

Deployment Order

These changes are backward-compatible if deployed in order:

  1. Onchain program — deployed first so activator can unsubscribe Deleting users
  2. Activator — picks up group cleanup responsibility
  3. SDK/CLI — removes client-side unsubscribe loop

Testing Verification

  • cargo test -p doublezero-serviceability — all 6 onchain program tests pass
  • cargo test -p doublezero_sdk — all SDK tests pass including new test_delete_user_sends_delete_transaction_directly and updated test_delete_tenant_with_cascade
  • make rust-lint — no clippy warnings
  • Verified new test confirms DeleteUserCommand sends the delete transaction directly without any preceding unsubscribe transactions, even when user has non-empty publisher/subscriber lists

Move multicast group unsubscribe responsibility from the SDK
DeleteUserCommand to the activator's Deleting/PendingBan handlers.
Previously, the CLI would unsubscribe from each group one-by-one before
sending DeleteUser, creating intermediate Updating states that caused
unnecessary daemon reconciler re-provisioning.

Now the onchain program allows DeleteUser with non-empty groups, the
activator handles cleanup server-side before CloseAccount/Ban, and the
SDK sends the DeleteUser transaction directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant