magicblock_magic_program_api/lib.rs
1pub mod args;
2pub mod instruction;
3
4pub use solana_program::{declare_id, pubkey, pubkey::Pubkey};
5
6declare_id!("Magic11111111111111111111111111111111111111");
7
8pub const MAGIC_CONTEXT_PUBKEY: Pubkey =
9 pubkey!("MagicContext1111111111111111111111111111111");
10
11/// We believe 5MB should be enough to store all scheduled commits within a
12/// slot. Once we store more data in the magic context we need to reconsicer
13/// this size.
14/// NOTE: the default max accumulated account size per transaction is 64MB.
15/// See: MAX_LOADED_ACCOUNTS_DATA_SIZE_BYTES inside program-runtime/src/compute_budget_processor.rs
16pub const MAGIC_CONTEXT_SIZE: usize = 1024 * 1024 * 5; // 5 MB
17
18pub const TASK_CONTEXT_PUBKEY: Pubkey =
19 pubkey!("TaskContext11111111111111111111111111111111");
20
21/// Requests are ix data, so they cannot exceed ~1kB.
22/// With 1000 schedules per slot, that's 1MB per slot.
23/// The task scheduler ticking once every 4 slots, that's 4MB.
24/// This can be drastically reduced once we have a channel to the transaction executor.
25/// https://github.com/magicblock-labs/magicblock-validator/issues/523
26pub const TASK_CONTEXT_SIZE: usize = 1024 * 1024 * 4; // 4 MB