add note about discrepancy between accounts load and sanitize caps (#29669)

This commit is contained in:
Trent Nelson 2023-01-11 23:18:07 -07:00 committed by GitHub
parent 451fbfee2e
commit 730aa71834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -129,6 +129,8 @@ impl Message {
// the combined number of static and dynamic account keys must be <= 256
// since account indices are encoded as `u8`
// Note that this is different from the per-transaction account load cap
// as defined in `Bank::get_transaction_account_lock_limit`
let total_account_keys = num_static_account_keys.saturating_add(num_dynamic_account_keys);
if total_account_keys > 256 {
return Err(SanitizeError::IndexOutOfBounds);