Skip to content

Commit 72196ed

Browse files
committed
reclaim legacy tombstones
1 parent 2aca367 commit 72196ed

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

proposals/0432-loader-v3-reclaim-closed-program.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ Close { tombstone: bool }
5353
| 4-byte discriminator | 1-byte boolean |
5454
```
5555

56+
The accounts required by the instruction are unchanged:
57+
58+
- Account 0: Programdata account (writable)
59+
- Account 1: Recipient (writable)
60+
- Account 2: Authority (signer)
61+
- Account 3: Program account (writable)
62+
63+
### Base Workflow
64+
5665
For a value of `false`, the program will clear the program account's data,
5766
resize it to zero, and withdraw all lamports. This will render the account no
5867
longer rent-exempt and subject to garbage collection by the runtime at the end
@@ -87,9 +96,38 @@ permanent tombstone for the program.
8796
In both workflows, the programdata account (or any adjacent accounts under
8897
Loader v3) will be completely deallocated, defunded, and reassigned to System.
8998

99+
### Non-Frozen Active Program Closures
100+
101+
Programs that are not frozen exist in the following state:
102+
103+
- Program account: Owned by Loader v3, `Program { programdata }` state, funded
104+
- Programdata account: `ProgramData { upgrade_authority: Some(..), .. }`
105+
106+
For all non-frozen programs in the above state, the authority signer at account
107+
index 2 must be the program's upgrade authority, stored in the programdata
108+
account. This preserves the existing authority behavior.
109+
110+
If the above state and signer requirements are met, the base workflow proceeds.
111+
112+
### Legacy Tombstone Reclamation
113+
114+
Programs closed before this proposal remain in a legacy tombstone state:
115+
116+
- Program account: Owned by Loader v3, `Program { programdata }` state, funded
117+
- Programdata account: `Uninitialized` (all-zeroes)
118+
119+
These programs cannot be invoked. The Close instruction is extended to reclaim
120+
them. When the provided program and programdata accounts are in the legacy
121+
tombstone state described above, the authority signer at account index 2 must be
122+
the program keypair.
123+
124+
If the above state and signer requirements are met, the base workflow proceeds.
125+
126+
### Feature Activation
127+
90128
This change will be a feature-gated behavioral change to the existing Close
91129
instruction. After the feature is activated, the boolean value can be included
92-
to utilize the new functionality.
130+
to utilize the new functionality, and legacy tombstones can be reclaimed.
93131

94132
## Alternatives Considered
95133

0 commit comments

Comments
 (0)