onchain allocation: DeleteUser deallocate+closeaccount atomically#3113
Draft
onchain allocation: DeleteUser deallocate+closeaccount atomically#3113
Conversation
Add dz_prefix_count and multicast_publisher_count fields to UserDeleteArgs for atomic delete+deallocate+close in a single transaction. When dz_prefix_count > 0, the instruction deallocates tunnel_net, tunnel_id, and dz_ip from ResourceExtension accounts, decrements device counters, and closes the user account. Legacy path (dz_prefix_count=0) unchanged. Gated behind the OnChainAllocation feature flag.
…teUser Read the OnChainAllocation feature flag from GlobalState to automatically skip multicast unsubscribe + retry logic and instead include device, UserTunnelBlock, MulticastPublisherBlock, TunnelIds, DzPrefixBlock, optional tenant, and owner accounts for atomic delete+deallocate+close.
elitegreg
commented
Feb 26, 2026
|
|
||
| if matches!(user.status, UserStatus::Deleting | UserStatus::Updating) { | ||
| return Err(DoubleZeroError::InvalidStatus.into()); | ||
| // Status check differs between legacy and atomic paths |
Contributor
Author
There was a problem hiding this comment.
This block is not right. Need to think about it.
elitegreg
commented
Feb 26, 2026
| client_ip: user.client_ip, | ||
| publisher: false, | ||
| subscriber: false, | ||
| // With onchain deallocation, the program handles everything atomically — |
Contributor
Author
There was a problem hiding this comment.
Multicast unsubscribe still needs to happen.
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.
Closes #2403
Summary of Changes
Testing Verification