solana_program/syscalls/mod.rs
1//! Declarations of Solana program syscalls.
2//!
3//! This module is mostly empty when not compiling for BPF targets.
4
5#[cfg(target_os = "solana")]
6mod definitions;
7
8#[cfg(target_os = "solana")]
9pub use definitions::*;
10
11/// Maximum CPI instruction data size. 10 KiB was chosen to ensure that CPI
12/// instructions are not more limited than transaction instructions if the size
13/// of transactions is doubled in the future.
14pub const MAX_CPI_INSTRUCTION_DATA_LEN: u64 = 10 * 1024;
15
16/// Maximum CPI instruction accounts. 255 was chosen to ensure that instruction
17/// accounts are always within the maximum instruction account limit for SBF
18/// program instructions.
19pub const MAX_CPI_INSTRUCTION_ACCOUNTS: u8 = u8::MAX;
20
21/// Maximum number of account info structs that can be used in a single CPI
22/// invocation. A limit on account info structs is effectively the same as
23/// limiting the number of unique accounts. 128 was chosen to match the max
24/// number of locked accounts per transaction (MAX_TX_ACCOUNT_LOCKS).
25pub const MAX_CPI_ACCOUNT_INFOS: usize = 128;