SIMD-0433: Loader V3: Set Program Data to ELF Length#433
Conversation
|
Hello buffalojoec! Welcome to the SIMD process. By opening this PR you are affirming that your SIMD has been thoroughly discussed and vetted in the SIMD discussion section. The SIMD PR section should only be used to submit a final technical specification for review. If your design / idea still needs discussion, please close this PR and create a new discussion here. This PR requires the following approvals before it can be merged:
Once all requirements are met, you can merge this PR by commenting |
12ca6b6 to
8aca70a
Compare
8aca70a to
b3578fc
Compare
Co-authored-by: Dean 利迪恩 <10921578+deanmlittle@users.noreply.github.com>
| This proposal results in a lower program footprint in Accounts DB, incentivizes | ||
| developers to upgrade to newer, more performant libraries and SDKs, and enables | ||
| the recovery of surplus lamports, including those accidentally sent to the | ||
| program data address. |
There was a problem hiding this comment.
Not debiting the Buffer account means the TX needs twice the funds to run, even if it only uses half in the end.
| As mentioned in the previous section, any additional rent exemption required | ||
| for growing an ELF region must be credited to the program data account before | ||
| `Upgrade` is invoked. | ||
|
|
There was a problem hiding this comment.
This means the buffer is not emptied and thus also does not need to be writable.
| The `Upgrade` instruction will be updated to automatically resize the program | ||
| data account to match the length of the ELF in the buffer being deployed. This | ||
| applies in both directions: the account may grow or shrink as needed. |
There was a problem hiding this comment.
you say the programdata account will now be the same length as the ELF, but wouldn't it also need to include some metadata? (i.e. the bpf loader program state)
There was a problem hiding this comment.
Correct. It would still contain:
- discriminator
- slot
- option
- upgrade authority
- program ELF
There was a problem hiding this comment.
Yeah, sorry, maybe I can make that statement clearer in the doc. I was implying metadata + ELF.
No description provided.