Loader V3: Allow Prefunded ProgramData
- Idea
- Draft
- Review
- Accept
- Implement
- Active
Decision brief
Why this proposal matters
This SIMD proposes changing the DeployWithMaxDataLen instruction in Loader V3 to create the programdata account with the System program's CreateAccountAllowPrefund instruction (SIMD-0312) instead of CreateAccount, so that pre-funded programdata accounts are accepted.
Proposal at a glance
What changes
- DeployWithMaxDataLen MUST invoke CreateAccountAllowPrefund instead of CreateAccount to create the programdata account.
- When top_up_lamports is zero, the payer is omitted from the CPI and is not required to sign DeployWithMaxDataLen. The payer MUST still be writable, since it receives the buffer's lamports.
- This SIMD proposes changing the DeployWithMaxDataLen instruction in Loader V3 to create the programdata account with the System program's CreateAccountAllowPrefund instruction (SIMD-0312) instead of CreateAccount, so that pre-funded programdata accounts are accepted.
Stakeholder map
Who is affected
Builders & client teams Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownValidators & operators Medium impact
Deployments no longer fail when the programdata account holds lamports.
Action requirement unknownUsers & stakers Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownGovernance & ecosystem Medium impact
This proposal changes the behavior of DeployWithMaxDataLen and requires a feature gate for consensus safety. The instruction's interface is unchanged.
Action requirement unknownExact source revision
Full proposal document
6cc17538e266Summary
This SIMD proposes changing the DeployWithMaxDataLen instruction in Loader
V3 to create the programdata account with the System program's
CreateAccountAllowPrefund instruction (SIMD-0312) instead of
CreateAccount, so that pre-funded programdata accounts are accepted.
Motivation
DeployWithMaxDataLen currently creates the programdata account by invoking
the System program's CreateAccount instruction via CPI. CreateAccount fails
with AccountAlreadyInUse if the target account holds any lamports.
This can create an annoying scenario if funds are sent to the programdata
account ahead of time, requiring a new program keypair to be generated. Using
CreateAccountAllowPrefund avoids this scenario without incurring any further
CPI cost to the Loader program.
Dependencies
This proposal depends on the following previously accepted proposals:
SIMD-0312: CreateAccountAllowPrefund
Its feature,
6sPDzwyARRExKH52LECxcGoqziH8G7SZofwuxi8Ja331, is active on all clusters (mainnet-beta, testnet, and devnet).
New Terminology
N/A
Detailed Design
DeployWithMaxDataLen MUST invoke CreateAccountAllowPrefund instead of
CreateAccount to create the programdata account.
CreateAccountAllowPrefund takes the same instruction data as CreateAccount
(lamports, space, owner). space and owner are unchanged. Instead of
the full rent-exempt minimum, lamports is only the top-up needed to make the
programdata account rent-exempt:
required_lamports = minimum_balance(programdata_len)
top_up_lamports = required_lamports.saturating_sub(programdata_lamports)
Where programdata_len is the programdata metadata size plus max_data_len,
and programdata_lamports is the programdata account's balance before the
CPI. Any lamports in excess of required_lamports remain in the programdata
account. As today, the buffer's lamports are drained to the payer before the
CPI.
When top_up_lamports is zero, the payer is omitted from the CPI and is not
required to sign DeployWithMaxDataLen. The payer MUST still be writable,
since it receives the buffer's lamports.
Note that CreateAccountAllowPrefund takes its accounts in reverse order:
0. [ws] ProgramData account
1. [ws] Payer, if top_up_lamports > 0
Alternatives Considered
The loader could invoke Allocate and Assign without transferring any
lamports. This would require every caller to pre-fund the programdata account
before deployment, which breaks existing deployment workflows and is not
worth the developer experience cost.
Impact
Deployments no longer fail when the programdata account holds lamports.
Security Considerations
The target is always the derived programdata address, so the wallet-locking concern noted in SIMD-0312 does not apply.
An unsigned payer only ever receives lamports (the drained buffer balance), and the upgrade authority, which must sign, still authorizes the deployment.
Backwards Compatibility
This proposal changes the behavior of DeployWithMaxDataLen and requires a
feature gate for consensus safety. The instruction's interface is unchanged.
Evidence graph
Related proposals and rollout
One or more sources are unavailable.
Upstream review record
Upstream discussion & review
One or more sources are unavailable.
Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity. 3
Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity.SIMD
Deployment Status
Feature Gate not yet created
Exact source revision
Sources & integrity
- Proposal document pinned_commit_blob
6cc17538e26601e65beca89bbfa761e755720956 - simd-document document · stale · Oct 29, 2026
6cc17538e26601e65beca89bbfa761e755720956
One or more sources are unavailable.
One or more sources are unavailable.
simd.watch community discussion · SIMD-0684
Powered by Giscus · Sign in with GitHub to comment
Community comments load when this section approaches the viewport.