Skip to main content
Technical proposal SIMD-0684 Review

Loader V3: Allow Prefunded ProgramData

  1. Idea
  2. Draft
  3. Review
  4. Accept
  5. Implement
  6. 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.

Source-backed reading aid · source language: EN

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 unknown
Validators & operators Medium impact

Deployments no longer fail when the programdata account holds lamports.

Action requirement unknown
Users & stakers Impact unknown

No proposal-specific evidence was found for this group.

Action requirement unknown
Governance & 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 unknown

Exact source revision

Full proposal document

Source-language document. Technical identifiers and evidence remain unchanged. 2be4cb0c0fd1

Summary

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.

simd.watch community discussion · SIMD-0684

Powered by Giscus · Sign in with GitHub to comment

Community comments load when this section approaches the viewport.

Provenance

Evidence & technical details

Rollout or chain data, source revisions, freshness and integrity.
3

SIMD

Deployment Status

Document lifecycleReview
CategoryCore protocol

Feature Gate not yet created

Exact source revision

Sources & integrity

  • Proposal document pinned_commit_blob
    2be4cb0c0fd1025df8c037b19372f7346119b231
  • simd-document document · stale · Oct 30, 2026
    2be4cb0c0fd1025df8c037b19372f7346119b231

One or more sources are unavailable.

One or more sources are unavailable.