Ensure blocks do not exceed the max accounts data size during Replay Stage (#23422)
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user