Skip to content

SIMD-0433: Loader V3: Set Program Data to ELF Length#433

Open
buffalojoec wants to merge 5 commits into
mainfrom
loader-v3-upgrade-resizing
Open

SIMD-0433: Loader V3: Set Program Data to ELF Length#433
buffalojoec wants to merge 5 commits into
mainfrom
loader-v3-upgrade-resizing

Conversation

@buffalojoec
Copy link
Copy Markdown
Contributor

No description provided.

@simd-bot
Copy link
Copy Markdown

simd-bot Bot commented Dec 18, 2025

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 /merge.

@buffalojoec buffalojoec force-pushed the loader-v3-upgrade-resizing branch from 12ca6b6 to 8aca70a Compare December 18, 2025 14:15
@buffalojoec buffalojoec changed the title SIMD-XXXX: Loader V3: Set Program Data to ELF Length SIMD-0433: Loader V3: Set Program Data to ELF Length Dec 18, 2025
@buffalojoec buffalojoec force-pushed the loader-v3-upgrade-resizing branch from 8aca70a to b3578fc Compare December 18, 2025 14:19
Comment thread proposals/0433-loader-v3-set-program-data-to-elf-length.md Outdated
Co-authored-by: Dean 利迪恩 <10921578+deanmlittle@users.noreply.github.com>
deanmlittle
deanmlittle previously approved these changes Jan 2, 2026
Comment thread proposals/0433-loader-v3-set-program-data-to-elf-length.md Outdated
Copy link
Copy Markdown
Contributor

@mjain-jump mjain-jump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not debiting the Buffer account means the TX needs twice the funds to run, even if it only uses half in the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means the buffer is not emptied and thus also does not need to be writable.

varo0000000

This comment was marked as spam.

@buffalojoec buffalojoec requested a review from Lichtso April 10, 2026 02:18
Comment on lines +53 to +55
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. It would still contain:

  • discriminator
  • slot
  • option
  • upgrade authority
  • program ELF

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry, maybe I can make that statement clearer in the doc. I was implying metadata + ELF.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants