You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document the behavior and rules around program deletion, specifically how reference counting prevents deletion of actively used programs while potentially allowing cleanup of unused ones.
Here's what (I'm assuming are) the facts:
Each program maintains an on-chain reference count.
Reference count increments when accounts register/associate with the program.
Programs cannot be deleted while their reference count is > 0.
Question: how do programs with zero references get deleted? Is there some kind of garbage collection?
Example flow
Account-Alice deploys Program-Red.
Account-Bob registers as a user of Program-Red (ref count = 1).
Account-Alice cannot delete Program-Red while Account-Bob is registered.
Question: can accounts de-register from programs?
All nodes maintain the same chain-state, and as such once a program is used (i.e. it has references) then it's permanently saved to the chain state.
Steps to reproduce
N/a
Error messages and/or screenshots
N/a
Proposed solution (optional)
N/a
Final checks
I have checked to see if any existing issues cover this topic and linked any other relevant issues.
The text was updated successfully, but these errors were encountered:
Question: how do programs with zero references get deleted? Is there some kind of garbage collection?
You can call remove_program in the programs pallet with the account that deployed the program, this will also return the deposit associated with the program.
Question: can accounts de-register from programs?
Yes every account can change the programs associated with their keys see pallet Registery change_program_instance, removing a program here will reduce the ref count.
Document the behavior and rules around program deletion, specifically how reference counting prevents deletion of actively used programs while potentially allowing cleanup of unused ones.
Here's what (I'm assuming are) the facts:
Question: how do programs with zero references get deleted? Is there some kind of garbage collection?
Example flow
Question: can accounts de-register from programs?
All nodes maintain the same chain-state, and as such once a program is used (i.e. it has references) then it's permanently saved to the chain state.
Steps to reproduce
N/a
Error messages and/or screenshots
N/a
Proposed solution (optional)
N/a
Final checks
The text was updated successfully, but these errors were encountered: