Ensure blocks do not exceed the max accounts data size during Replay Stage (#23422)
This commit is contained in:
@ -80,7 +80,7 @@ impl AccountsDataMeter {
|
||||
/// the remaining space, return an error and *do not* adjust accounts data space.
|
||||
pub fn adjust_delta(&mut self, amount: i64) -> Result<(), InstructionError> {
|
||||
if amount > self.remaining() as i64 {
|
||||
return Err(InstructionError::AccountsDataBudgetExceeded);
|
||||
return Err(InstructionError::MaxAccountsDataSizeExceeded);
|
||||
}
|
||||
self.adjust_delta_unchecked(amount);
|
||||
Ok(())
|
||||
|
@ -1745,7 +1745,7 @@ mod tests {
|
||||
assert!(result.is_err());
|
||||
assert!(matches!(
|
||||
result,
|
||||
Err(solana_sdk::instruction::InstructionError::AccountsDataBudgetExceeded)
|
||||
Err(solana_sdk::instruction::InstructionError::MaxAccountsDataSizeExceeded)
|
||||
));
|
||||
assert_eq!(invoke_context.accounts_data_meter.remaining(), 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user