pub fn migrate_append(
account: &AccountView,
payer: &AccountView,
program_id: &Address,
old_layout_id: &[u8; 8],
new_version: u8,
new_layout_id: &[u8; 8],
new_disc: u8,
new_size: usize,
) -> ProgramResultExpand description
Migrate an account in-place by appending new fields.
This is the cheapest migration: no data movement, just realloc + header update.
§Preconditions
- Account must be owned by
program_id - Account must be writable
- Account layout_id must match
old_layout_id new_size > old_size(append-only growth)
§What it does
- Validates ownership, writable, and old layout_id
- Reallocs account data to
new_size - Updates header: new version, new layout_id
- Zeroes the newly appended region
New fields are left zero-initialized. The caller should fill them after.