diff --git a/programs/bpf/tests/programs.rs b/programs/bpf/tests/programs.rs index 86b33bf8c02275..76a1193828ae07 100644 --- a/programs/bpf/tests/programs.rs +++ b/programs/bpf/tests/programs.rs @@ -1288,7 +1288,7 @@ fn test_program_bpf_invoke_sanity() { format!("Program log: invoke {program_lang} program"), "Program log: Test max account infos exceeded".into(), "skip".into(), // don't compare compute consumption logs - "Program failed to complete: Invoked an instruction with too many account info's (257 > 256)".into(), + "Program failed to complete: Invoked an instruction with too many account info's (129 > 128)".into(), format!("Program {invoke_program_id} failed: Program failed to complete"), ]), ); diff --git a/sdk/bpf/c/inc/sol/cpi.h b/sdk/bpf/c/inc/sol/cpi.h index a650f49c2514f4..b3748cff2240f9 100644 --- a/sdk/bpf/c/inc/sol/cpi.h +++ b/sdk/bpf/c/inc/sol/cpi.h @@ -28,10 +28,10 @@ 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. 256 was chosen to match the max + * limiting the number of unique accounts. 128 was chosen to match the max * number of locked accounts per transaction (MAX_TX_ACCOUNT_LOCKS). */ -static const uint16_t MAX_CPI_ACCOUNT_INFOS = 256; +static const uint16_t MAX_CPI_ACCOUNT_INFOS = 128; /** * Account Meta diff --git a/sdk/bpf/c/inc/sol/inc/cpi.inc b/sdk/bpf/c/inc/sol/inc/cpi.inc index e89e98e0cb2bd7..41ce4fb01a691b 100644 --- a/sdk/bpf/c/inc/sol/inc/cpi.inc +++ b/sdk/bpf/c/inc/sol/inc/cpi.inc @@ -28,10 +28,10 @@ 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. 256 was chosen to match the max + * limiting the number of unique accounts. 128 was chosen to match the max * number of locked accounts per transaction (MAX_TX_ACCOUNT_LOCKS). */ -static const uint16_t MAX_CPI_ACCOUNT_INFOS = 256; +static const uint16_t MAX_CPI_ACCOUNT_INFOS = 128; /** * Account Meta diff --git a/sdk/program/src/syscalls/mod.rs b/sdk/program/src/syscalls/mod.rs index b7359f858f09a7..d66c9361e95792 100644 --- a/sdk/program/src/syscalls/mod.rs +++ b/sdk/program/src/syscalls/mod.rs @@ -16,6 +16,6 @@ pub const MAX_CPI_INSTRUCTION_ACCOUNTS: u8 = u8::MAX; /// 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. 256 was chosen to match the max +/// limiting the number of unique accounts. 128 was chosen to match the max /// number of locked accounts per transaction (MAX_TX_ACCOUNT_LOCKS). -pub const MAX_CPI_ACCOUNT_INFOS: usize = 256; +pub const MAX_CPI_ACCOUNT_INFOS: usize = 128; diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 6148a89026ce4e..42a38c888d05fe 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -651,7 +651,7 @@ lazy_static! { (cap_accounts_data_allocations_per_transaction::id(), "cap accounts data allocations per transaction #27375"), (epoch_accounts_hash::id(), "enable epoch accounts hash calculation #27539"), (remove_deprecated_request_unit_ix::id(), "remove support for RequestUnitsDeprecated instruction #27500"), - (increase_tx_account_lock_limit::id(), "increase tx account lock limit to 256 #27241"), + (increase_tx_account_lock_limit::id(), "increase tx account lock limit to 128 #27241"), /*************** ADD NEW FEATURES HERE ***************/ ] .iter() diff --git a/sdk/src/transaction/sanitized.rs b/sdk/src/transaction/sanitized.rs index 7d1b34a4ab41e6..7c5a9df4d662c7 100644 --- a/sdk/src/transaction/sanitized.rs +++ b/sdk/src/transaction/sanitized.rs @@ -21,9 +21,9 @@ use { }; /// Maximum number of accounts that a transaction may lock. -/// 64 was chosen because it is roughly twice the previous -/// number of account keys that could fit in a legacy tx. -pub const MAX_TX_ACCOUNT_LOCKS: usize = 64; +/// 128 was chosen because it is the minimum number of accounts +/// needed for the Neon EVM implementation. +pub const MAX_TX_ACCOUNT_LOCKS: usize = 128; /// Sanitized transaction and the hash of its message #[derive(Debug, Clone)]