Skip to content

feat(smartcontract): RFC 11 activation for User entity#2639

Merged
elitegreg merged 6 commits intomainfrom
rg/rfc11-close-activate-user-account
Jan 21, 2026
Merged

feat(smartcontract): RFC 11 activation for User entity#2639
elitegreg merged 6 commits intomainfrom
rg/rfc11-close-activate-user-account

Conversation

@vihu
Copy link
Contributor

@vihu vihu commented Jan 15, 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

@vihu vihu requested a review from elitegreg January 15, 2026 18:17
@vihu vihu force-pushed the rg/rfc11-close-activate-user-account branch from 70388fa to 986d5e9 Compare January 20, 2026 15:01
@vihu vihu marked this pull request as ready for review January 20, 2026 17:58
@vihu vihu force-pushed the rg/rfc11-close-activate-user-account branch from cb25272 to 8c0b44c Compare January 20, 2026 18:40
vihu added 5 commits January 21, 2026 01:18
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
@vihu vihu force-pushed the rg/rfc11-close-activate-user-account branch from cd640f5 to db3ccc4 Compare January 20, 2026 21:19
@elitegreg elitegreg merged commit 4d602ee into main Jan 21, 2026
21 checks passed
@elitegreg elitegreg deleted the rg/rfc11-close-activate-user-account branch January 21, 2026 04:41
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
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.

Phase 1: Modify CloseAccountUser to require ResourceExtension Phase 1: Modify ActivateUser to read from ResourceExtension bitmaps

2 participants