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

This commit is contained in:
Brooks Prumo
2022-03-10 10:24:31 -06:00
committed by GitHub
parent 58c0db9704
commit 3c6840050c
9 changed files with 56 additions and 24 deletions

View File

@@ -45,7 +45,7 @@ use {
instruction::{AccountMeta, InstructionError},
loader_instruction::LoaderInstruction,
loader_upgradeable_instruction::UpgradeableLoaderInstruction,
program_error::ACCOUNTS_DATA_BUDGET_EXCEEDED,
program_error::MAX_ACCOUNTS_DATA_SIZE_EXCEEDED,
program_utils::limited_deserialize,
pubkey::Pubkey,
saturating_add_assign,
@@ -1332,13 +1332,13 @@ impl Executor for BpfExecutor {
}
match result {
Ok(status) if status != SUCCESS => {
let error: InstructionError = if status == ACCOUNTS_DATA_BUDGET_EXCEEDED
let error: InstructionError = if status == MAX_ACCOUNTS_DATA_SIZE_EXCEEDED
&& !invoke_context
.feature_set
.is_active(&cap_accounts_data_len::id())
{
// Until the cap_accounts_data_len feature is enabled, map the
// ACCOUNTS_DATA_BUDGET_EXCEEDED error to InvalidError
// MAX_ACCOUNTS_DATA_SIZE_EXCEEDED error to InvalidError
InstructionError::InvalidError
} else {
status.into()