-
Notifications
You must be signed in to change notification settings - Fork 5
RFC11: on chain activation #2302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6af0ac8 to
1e2eab9
Compare
elitegreg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the biggest issue is with recycling resources. That needs to be done as part of this implementation. That flows through to the migrations which need to be reworked. There's a bunch to talk about with migrations that we can all go through as a group.
1e2eab9 to
500aba5
Compare
I moved "Resource recycling" from Non-Goals to Goal 4: "Full resource recycling — Reclaim IPs and IDs on deletion (users connect/disconnect frequently)". It's now mandatory. |
500aba5 to
7a1e0c0
Compare
elitegreg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is close. Probably want to make some changes as we implement. I think in the migration phase, there's a stage where we run the activator still, but the existing activation instructions are updated to do resource allocation on exchange and ignores the passed in arguments. This supports the case where a user connects with an old client and needs async activation, but we want the activator and the new create-and-activate instructions to be in sync.
|
@vihu, why update existing accounts to add resource allocation? I would think we would just add new accounts with PDAs based on what they are associated with, e.g. create a dz prefix account with a pda based on the device key |
Also @juan-malbeclabs do you have an opinion |
|
I agree with extending these functionalities into a second account associated with the first one to reduce the changes to the information that’s already on-chain. You can create a resource extension account associated with the Device’s Pubkey and Pubkey::default() for the global state. Then we can add commands to allocate and release resources from these accounts, which could be used by the foundation manually or by the program internally. |
7a1e0c0 to
96a933d
Compare
Nice, I took another pass. Please take another look! |
|
I don't think adding the slot fields to User, Link, etc are necessary. It's redundant information. The code I already have written can deallocate based on IP without knowing the slot. Also, IMHO, this is close enough to go on with some implementation. Then we can update this. I think there is some amount of discovery that's necessarily going to happen and we don't want to over engineer upfront. |
96a933d to
9c6a92a
Compare
| ### Client Flow | ||
|
|
||
| ```rust | ||
| // TX 1: Allocate resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If TX 1 succeeds but TX 2 does not, does TX 1 get rolled back?
Summary
Add RFC11: on chain activation
Fixes: #2209