Ensure blocks do not exceed the max accounts data size during Replay Stage (backport #23422) (#23589)

* Ensure blocks do not exceed the max accounts data size during Replay Stage (#23422)

(cherry picked from commit 3c6840050c)

# Conflicts:
#	runtime/src/bank.rs

* fix conflicts

Co-authored-by: Brooks Prumo <brooks@solana.com>
This commit is contained in:
mergify[bot]
2022-03-10 18:59:46 +00:00
committed by GitHub
parent 49952e05cf
commit e0f5fb887b
9 changed files with 60 additions and 26 deletions

View File

@ -220,7 +220,7 @@ impl RentDebits {
}
type BankStatusCache = StatusCache<Result<()>>;
#[frozen_abi(digest = "6XkxpmzmKZguLZMS1KmU7N2dAcv8MmNhyobJCwRLkTdi")]
#[frozen_abi(digest = "HdYCU65Jwfv9sF3C8k6ZmjUAaXSkJwazebuur21v8JtY")]
pub type BankSlotDelta = SlotDelta<Result<()>>;
// Eager rent collection repeats in cyclic manner.
@ -16438,11 +16438,13 @@ pub(crate) mod tests {
);
}
/// Test exceeding the accounts data budget by creating accounts in a loop
/// Test exceeding the max accounts data size by creating accounts in a loop
#[test]
fn test_accounts_data_budget_exceeded() {
use solana_program_runtime::accounts_data_meter::MAX_ACCOUNTS_DATA_LEN;
use solana_sdk::system_instruction::MAX_PERMITTED_DATA_LENGTH;
fn test_max_accounts_data_size_exceeded() {
use {
solana_program_runtime::accounts_data_meter::MAX_ACCOUNTS_DATA_LEN,
solana_sdk::system_instruction::MAX_PERMITTED_DATA_LENGTH,
};
solana_logger::setup();
let (genesis_config, mint_keypair) = create_genesis_config(1_000_000_000_000);
@ -16477,7 +16479,7 @@ pub(crate) mod tests {
result,
Err(TransactionError::InstructionError(
_,
solana_sdk::instruction::InstructionError::AccountsDataBudgetExceeded,
solana_sdk::instruction::InstructionError::MaxAccountsDataSizeExceeded,
))
));
}