Skip to content

Commit a4f4116

Browse files
committed
Further clarifications after implementing integration tests.
1 parent 80d9562 commit a4f4116

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

proposals/0167-loader-v4.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors:
55
- Alexander Meißner
66
category: Standard
77
type: Core
8-
status: Draft
8+
status: Review
99
created: 2024-08-15
1010
feature: TBD
1111
---
@@ -45,9 +45,13 @@ None.
4545

4646
## Detailed Design
4747

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`),
5155
throwing `InvalidIstructionData` if `DeployWithMaxDataLen` is called.
5256

5357
### Owned Program Accounts
@@ -86,19 +90,20 @@ otherwise throw `Immutable`
8690

8791
Invoking programs owned by loader-v4 checks in the following order that:
8892

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)
9798
- 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`.
99102

100103
### Program Management Instructions
101104

105+
All program management instructions must cost 2000 CUs.
106+
102107
#### Write
103108

104109
- Instruction accounts:
@@ -187,8 +192,10 @@ verification, otherwise throw `UnsupportedProgramId`
187192
otherwise throw `InvalidArgument`
188193
- Check that the executable file stored in the source program account
189194
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
192199
- Copy the entire source program account into the program account
193200
- Set the length of the source program account to zero
194201
- Transfer all funds of the source program account to the program

0 commit comments

Comments
 (0)