Skip to main content

Module program_abi

Module program_abi 

Source
Expand description

Program + official ABI deploys in one Multicall transaction.

The Public Manager and the ABI Manager both read their new contents from uploader buffers. These builders put the program change and the official ABI change into a single Multicall instruction so both land or neither does. The authority is always the fee payer (account index 0), which the callee programs treat as authorized.

Structs§

ProgramAbiAccounts
Accounts touched by a program + official ABI deploy.
ProgramAbiDigests
SHA-256 of the new program image and of the new ABI content. Each manager instruction commits to its digest and installs only buffer bytes that hash to it, so the buffers cannot be swapped after the transaction (or a multisig request) is built.
ProgramAbiSizes
Sizes used to size the deploy’s state-unit budget.

Enums§

AbiStep
What happens to the program’s official ABI.
ProgramStep
What happens to the managed program.

Constants§

PROGRAM_ABI_COMPUTE_UNITS
Compute budget for a combined deploy (both managers copy buffers).
PROGRAM_ABI_MEMORY_UNITS
Memory budget for a combined deploy, matching the TypeScript SDK.

Functions§

build_multicall_instruction
Encode Multicall instruction data: a u16 call count, then for each call the u16 account index of the callee program, the u64 length of its instruction data, and the data itself (all little-endian).
build_program_abi_calls
Build the Multicall instruction calls for a program + official ABI deploy against idx, which maps each account to its transaction index. authority_idx is the index of the program authority (0 when the fee payer signs directly).
build_program_abi_transaction
Build a fee-payer-signed transaction that creates or upgrades a managed program and creates or upgrades its official ABI in one Multicall.
program_abi_account_access
Which accounts the deploy writes and which it only reads.
program_abi_state_units
State units the deploy needs: new pages for created accounts, and the page growth of upgraded accounts.