|
45 | 45 |
|
46 | 46 | ## Detailed Design
|
47 | 47 |
|
48 |
| -`LoaderV411111111111111111111111111111111111` program management and execution |
49 |
| -must be enabled with the associated feature gate, which simultaneously disables |
50 |
| -new deployments on loader-v3 (`BPFLoaderUpgradeab1e11111111111111111111111`), |
| 48 | +The associated feature gate must: |
| 49 | + |
| 50 | +- add loader-v4 to the write lock demotion exceptions |
| 51 | +- enable loader-v4 `LoaderV411111111111111111111111111111111111` program |
| 52 | +management and execution |
| 53 | +- simultaneously disable new deployments on loader-v3 |
| 54 | +(`BPFLoaderUpgradeab1e11111111111111111111111`), |
51 | 55 | throwing `InvalidIstructionData` if `DeployWithMaxDataLen` is called.
|
52 | 56 |
|
53 | 57 | ### Owned Program Accounts
|
@@ -86,19 +90,20 @@ otherwise throw `Immutable`
|
86 | 90 |
|
87 | 91 | Invoking programs owned by loader-v4 checks in the following order that:
|
88 | 92 |
|
89 |
| -- the owner of the program account is loader-v4, |
90 |
| -otherwise throw `UnsupportedProgramId` |
91 |
| -- the program account is at least as long enough for the header, |
92 |
| -otherwise throw `AccountDataTooSmall` |
93 |
| -- the status stored in the program account is not retracted, |
94 |
| -otherwise throw `UnsupportedProgramId` |
95 |
| -- the program account was not deployed within the current slot |
96 |
| -(delay visibility), otherwise throw `UnsupportedProgramId` |
| 93 | +- the owner of the program account is loader-v4 |
| 94 | +- the program account is at least as long enough for the header |
| 95 | +- the status stored in the program account is not retracted |
| 96 | +- the program account was not deployed within the current slot (delay |
| 97 | +visibility) |
97 | 98 | - the executable file stored in the program account passes executable
|
98 |
| -verification, otherwise throw `UnsupportedProgramId` |
| 99 | +verification |
| 100 | + |
| 101 | +failing any of the above checks must throw `UnsupportedProgramId`. |
99 | 102 |
|
100 | 103 | ### Program Management Instructions
|
101 | 104 |
|
| 105 | +All program management instructions must cost 2000 CUs. |
| 106 | + |
102 | 107 | #### Write
|
103 | 108 |
|
104 | 109 | - Instruction accounts:
|
@@ -187,8 +192,10 @@ verification, otherwise throw `UnsupportedProgramId`
|
187 | 192 | otherwise throw `InvalidArgument`
|
188 | 193 | - Check that the executable file stored in the source program account
|
189 | 194 | passes executable verification
|
190 |
| - - The feature set that the executable file is verified against is not |
191 |
| -necessarily the current one, but the one of the epoch of the next slot |
| 195 | + - The feature set that the executable file is verified against is not |
| 196 | + necessarily the current one, but the one of the epoch of the next slot |
| 197 | + - Also, during deployment certain deprecated syscalls are disabled, |
| 198 | + this stays the same as in the older loaders |
192 | 199 | - Copy the entire source program account into the program account
|
193 | 200 | - Set the length of the source program account to zero
|
194 | 201 | - Transfer all funds of the source program account to the program
|
|
0 commit comments