From 8db5a6a4f2d5e29b5745857af90c1c379227ce42 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Sat, 30 Jul 2022 08:11:38 -0700 Subject: [PATCH] Copy changes made to a generated header file to its source --- sdk/bpf/c/inc/sol/inc/cpi.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sdk/bpf/c/inc/sol/inc/cpi.inc b/sdk/bpf/c/inc/sol/inc/cpi.inc index 6bd0e099a..ce615e90b 100644 --- a/sdk/bpf/c/inc/sol/inc/cpi.inc +++ b/sdk/bpf/c/inc/sol/inc/cpi.inc @@ -11,6 +11,28 @@ extern "C" { #endif +/** + * Maximum CPI instruction data size. 10 KiB was chosen to ensure that CPI + * instructions are not more limited than transaction instructions if the size + * of transactions is doubled in the future. + */ +static const uint64_t MAX_CPI_INSTRUCTION_DATA_LEN = 10240; + +/** + * Maximum CPI instruction accounts. 255 was chosen to ensure that instruction + * accounts are always within the maximum instruction account limit for BPF + * program instructions. + */ +static const uint8_t MAX_CPI_INSTRUCTION_ACCOUNTS = 255; + +/** + * Maximum number of account info structs that can be used in a single CPI + * invocation. A limit on account info structs is effectively the same as + * limiting the number of unique accounts. 64 was chosen to match the max + * number of locked accounts per transaction (MAX_TX_ACCOUNT_LOCKS). + */ +static const uint8_t MAX_CPI_ACCOUNT_INFOS = 64; + /** * Account Meta */