* sdk: Add `deserialize_into` to entrypoint #### Problem The main entrypoint for Solana programs allocates a vector on the heap and pushes AccountInfos to it. Allocation is expensive. #### Summary of changes Add a new version of `deserialize` called `deserialize_into`, which expects a slice of `MaybeUninit<AccountInfo>`. The entrypoint can allocate a maximum array of AccountInfos on the stack and then pass it in. This new version of the entrypoint saves roughly 30 CUs per unique account passed to the program. In an earlier version, I had the new function return the array itself, but this used slightly more CUs, and didn't work for an array with 64 elements. Let me know how it looks! * Call instruction processor in non-inlined function * Add test for max supported accounts in a transaction * Refactor extracting account infos and instruction data * Changes required from rebase * Add clippy allow * Add panic message if too many accounts provided * Add `entrypoint_no_alloc!` and revert behavior in entrypoint! * Use entrypoint_no_alloc! everywhere except noop * Comment why noop program works the way it does * Add limit in doc-string * CHANGELOG: Add entry for entrypoint |
||
---|---|---|
.. | ||
fixtures | ||
bpf.rs | ||
builtins.rs | ||
compute_units.rs | ||
core_bpf.rs | ||
cpi.rs | ||
fuzz.rs | ||
genesis_accounts.rs | ||
lamports.rs | ||
panic.rs | ||
realloc.rs | ||
return_data.rs | ||
setup.rs | ||
spl.rs | ||
sysvar.rs | ||
sysvar_last_restart_slot.rs | ||
warp.rs |