Skip to main content

magicblock_magic_program_api/
lib.rs

1pub mod args;
2pub mod compat;
3pub mod instruction;
4pub mod pda;
5pub mod response;
6
7pub use compat::{declare_id, pubkey, Pubkey};
8
9declare_id!("Magic11111111111111111111111111111111111111");
10
11pub const CRANK_PROGRAM_ID: Pubkey =
12    pubkey!("Crank11111111111111111111111111111111111111");
13
14pub const CALLBACK_PROGRAM_ID: Pubkey =
15    pubkey!("CaLLback11111111111111111111111111111111111");
16
17pub const MAGIC_CONTEXT_PUBKEY: Pubkey =
18    pubkey!("MagicContext1111111111111111111111111111111");
19
20/// Vault account that collects rent for ephemeral accounts.
21pub const EPHEMERAL_VAULT_PUBKEY: Pubkey =
22    pubkey!("MagicVau1t999999999999999999999999999999999");
23
24/// We believe 5MB should be enough to store all scheduled commits within a
25/// slot. Once we store more data in the magic context we need to reconsicer
26/// this size.
27/// NOTE: the default max accumulated account size per transaction is 64MB.
28/// See: MAX_LOADED_ACCOUNTS_DATA_SIZE_BYTES inside program-runtime/src/compute_budget_processor.rs
29pub const MAGIC_CONTEXT_SIZE: usize = 1024 * 1024 * 5; // 5 MB
30
31/// Rent rate for ephemeral accounts: 32 lamports per byte.
32/// This is ~109x cheaper than Solana's base rent (3,480 lamports/byte).
33pub const EPHEMERAL_RENT_PER_BYTE: u64 = 32;