feat(smartcontract): RFC 11 activation for User entity#2639
Merged
Conversation
elitegreg
reviewed
Jan 16, 2026
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/activate.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/user/closeaccount.rs
Outdated
Show resolved
Hide resolved
elitegreg
requested changes
Jan 17, 2026
70388fa to
986d5e9
Compare
cb25272 to
8c0b44c
Compare
Fix #2401 Fix #2404 Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations. Changes: - ActivateUser: optionally allocate tunnel_net, tunnel_id, dz_ip from ResourceExtension bitmaps (8-account layout) or use legacy args (5-account) - CloseAccountUser: optionally deallocate resources back to bitmaps (9-account layout) or use legacy behavior (6-account) - Extend authorization to allow foundation_allowlist members - DZ IP allocation follows UserType logic (IBRL uses client_ip, others allocate) - SDK commands gain use_onchain_allocation/use_onchain_deallocation flags - Comprehensive tests covering all allocation paths and edge cases
Address review cmt to explicitly pass resource count in instruction args rather than inferring from account array length. Changes: - Add `dz_prefix_count: u8` to UserActivateArgs and UserCloseAccountArgs - Processor uses value.dz_prefix_count to determine account layout - SDK fetches device via GetDeviceCommand to get dz_prefixes.len() - SDK passes count in instruction args and sends N DzPrefixBlock accounts - Processor loops over DzPrefixBlock accounts until allocation succeeds
cd640f5 to
db3ccc4
Compare
elitegreg
approved these changes
Jan 21, 2026
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
# Summary Fix #2401 Fix #2404 Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations. Changes: - ActivateUser: optionally allocate tunnel_net, tunnel_id, dz_ip from ResourceExtension bitmaps (8-account layout) or use legacy args (5-account) - CloseAccountUser: optionally deallocate resources back to bitmaps (9-account layout) or use legacy behavior (6-account) - Extend authorization to allow foundation_allowlist members - DZ IP allocation follows UserType logic (IBRL uses client_ip, others allocate) - SDK commands add use_onchain_allocation/use_onchain_deallocation flags
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
# Summary Fix #2401 Fix #2404 Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations. Changes: - ActivateUser: optionally allocate tunnel_net, tunnel_id, dz_ip from ResourceExtension bitmaps (8-account layout) or use legacy args (5-account) - CloseAccountUser: optionally deallocate resources back to bitmaps (9-account layout) or use legacy behavior (6-account) - Extend authorization to allow foundation_allowlist members - DZ IP allocation follows UserType logic (IBRL uses client_ip, others allocate) - SDK commands add use_onchain_allocation/use_onchain_deallocation flags
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
# Summary Fix #2401 Fix #2404 Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations. Changes: - ActivateUser: optionally allocate tunnel_net, tunnel_id, dz_ip from ResourceExtension bitmaps (8-account layout) or use legacy args (5-account) - CloseAccountUser: optionally deallocate resources back to bitmaps (9-account layout) or use legacy behavior (6-account) - Extend authorization to allow foundation_allowlist members - DZ IP allocation follows UserType logic (IBRL uses client_ip, others allocate) - SDK commands add use_onchain_allocation/use_onchain_deallocation flags
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
# Summary Fix #2401 Fix #2404 Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations. Changes: - ActivateUser: optionally allocate tunnel_net, tunnel_id, dz_ip from ResourceExtension bitmaps (8-account layout) or use legacy args (5-account) - CloseAccountUser: optionally deallocate resources back to bitmaps (9-account layout) or use legacy behavior (6-account) - Extend authorization to allow foundation_allowlist members - DZ IP allocation follows UserType logic (IBRL uses client_ip, others allocate) - SDK commands add use_onchain_allocation/use_onchain_deallocation flags
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
Fix #2401
Fix #2404
Implement on-chain resource allocation for User activation and deallocation via ResourceExtension bitmaps, making the activator stateless for User lifecycle operations.
Changes: