solana_system_interface/
lib.rs

1//! The System program interface.
2
3#![no_std]
4#![cfg_attr(feature = "frozen-abi", feature(min_specialization))]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6
7#[cfg(feature = "alloc")]
8extern crate alloc;
9#[cfg(feature = "std")]
10extern crate std;
11
12pub mod error;
13pub mod instruction;
14
15#[cfg(test)]
16static_assertions::const_assert!(MAX_PERMITTED_DATA_LENGTH <= u32::MAX as u64);
17/// Maximum permitted size of account data (10 MiB).
18///
19// SBF program entrypoint assumes that the max account data length
20// will fit inside a u32. If this constant no longer fits in a u32,
21// the entrypoint deserialization code in the SDK must be updated.
22pub const MAX_PERMITTED_DATA_LENGTH: u64 = 10 * 1024 * 1024;
23
24#[cfg(test)]
25static_assertions::const_assert_eq!(MAX_PERMITTED_DATA_LENGTH, 10_485_760);
26/// Maximum permitted size of new allocations per transaction, in bytes.
27///
28/// The value was chosen such that at least one max sized account could be created,
29/// plus some additional resize allocations.
30pub const MAX_PERMITTED_ACCOUNTS_DATA_ALLOCATIONS_PER_TRANSACTION: i64 =
31    MAX_PERMITTED_DATA_LENGTH as i64 * 2;
32
33pub mod program {
34    solana_address::declare_id!("11111111111111111111111111111111");
35}