activator: move multicast group cleanup from CLI to activator#3117
Draft
activator: move multicast group cleanup from CLI to activator#3117
Conversation
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.
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 of Changes
DeleteUserCommandto the activator'sDeleting/PendingBanhandlers, eliminating transitory onchain states that caused unnecessary daemon reconciler re-provisioningDeleteUserto proceed with non-empty publisher/subscriber lists (activator handles cleanup server-side beforeCloseAccount/Ban)SubscribeMulticastGroupfor users inDeletingstatus so the activator can unsubscribe themDiff Breakdown
Net deletion of ~320 lines, removing client-side retry/polling complexity in favor of server-side cleanup.
Key files (click to expand)
activator/src/process/user.rs— addunsubscribe_all_multicast_groups()helper, call it in both stateful and statelessDeleting/PendingBanhandlers beforeCloseAccount/Bansmartcontract/sdk/rs/src/commands/user/delete.rs— remove client-side unsubscribe loop, retry/polling logic, and associated imports; simplify testssmartcontract/programs/doublezero-serviceability/src/processors/multicastgroup/subscribe.rs— addDeletingto allowed user statuses for subscribe/unsubscribesmartcontract/programs/doublezero-serviceability/src/processors/user/delete.rs— removeReferenceCountNotZerocheck blocking delete with non-empty groupssmartcontract/sdk/rs/src/commands/multicastgroup/subscribe.rs— allow SDK subscribe command forDeletinguserssmartcontract/sdk/rs/src/commands/tenant/delete.rs— update cascade delete test to match simplifiedDeleteUserCommandDeployment Order
These changes are backward-compatible if deployed in order:
DeletingusersTesting Verification
cargo test -p doublezero-serviceability— all 6 onchain program tests passcargo test -p doublezero_sdk— all SDK tests pass including newtest_delete_user_sends_delete_transaction_directlyand updatedtest_delete_tenant_with_cascademake rust-lint— no clippy warningsDeleteUserCommandsends the delete transaction directly without any preceding unsubscribe transactions, even when user has non-empty publisher/subscriber lists