Budget for a larger Solana program account
An account that stores 128 bytes today may need 256 after a schema change. The rent-exemption threshold depends on the new data length.
Price the final allocation
Send this JSON body by HTTP POST to the deployment cluster. Include discriminators, length prefixes and reserved bytes in the 256-byte figure if they are part of your layout.
{
"jsonrpc": "2.0",
"id": 1,
"method": "getMinimumBalanceForRentExemption",
"params": [
256,
{
"commitment": "confirmed"
}
]
}
Top up the difference
Read the existing lamport balance at the same commitment. If the threshold returned for the new size is 3,000,000 lamports and the account holds 2,400,000, the shortfall is 600,000. If the balance already covers the threshold, the required top-up is zero. Use the actual response in your migration.
Budget the transaction fee on the fee payer separately. Repeat the calculation for each account whose final length differs, especially when a migration adds a variable-length field.