Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions magicblock-processor/src/executor/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,37 +376,6 @@ impl super::TransactionExecutor {
return;
}
}
// SVM ignores rent exemption enforcement for accounts, which have
// 0 lamports, so it's possible to call realloc on account with zero
// balance bypassing the runtime checks. In order to prevent this
// edge case we perform explicit post execution check here.
for (i, (pubkey, acc)) in txn.accounts.iter().enumerate() {
if !acc.is_dirty() {
continue;
}
let Some(rent) = self.environment.rent_collector else {
continue;
};
if acc.lamports() == 0 && acc.data().is_empty() {
continue;
}
let rent_exemption_balance =
rent.get_rent().minimum_balance(acc.data().len());
if acc.lamports() >= rent_exemption_balance {
continue;
}
let error = Err(TransactionError::InsufficientFundsForRent {
account_index: i as u8,
});
executed.execution_details.status = error;
let logs = executed
.execution_details
.log_messages
.get_or_insert_default();
let msg = format!("Account {pubkey} has violated rent exemption");
logs.push(msg);
return;
}
}
}

Expand Down
Loading