Skip to content

Commit

Permalink
use new validate_account_locks (#2553)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Aug 13, 2024
1 parent b09567c commit e181194
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion accounts-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate lazy_static;

pub mod account_info;
mod account_locks;
pub mod account_locks;
pub mod account_storage;
pub mod accounts;
mod accounts_cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use {
},
arrayvec::ArrayVec,
crossbeam_channel::RecvTimeoutError,
solana_accounts_db::account_locks::validate_account_locks,
solana_cost_model::cost_model::CostModel,
solana_measure::measure_us,
solana_runtime::{bank::Bank, bank_forks::BankForks},
Expand Down Expand Up @@ -526,8 +527,8 @@ impl SchedulerController {
})
.inspect(|_| saturating_add_assign!(post_sanitization_count, 1))
.filter(|(_packet, tx)| {
SanitizedTransaction::validate_account_locks(
tx.message(),
validate_account_locks(
tx.message().account_keys(),
transaction_account_lock_limit,
)
.is_ok()
Expand Down
5 changes: 3 additions & 2 deletions core/src/banking_stage/unprocessed_transaction_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use {
},
itertools::Itertools,
min_max_heap::MinMaxHeap,
solana_accounts_db::account_locks::validate_account_locks,
solana_measure::measure_us,
solana_runtime::bank::Bank,
solana_sdk::{
Expand Down Expand Up @@ -171,8 +172,8 @@ fn consume_scan_should_process_packet(
let message = sanitized_transaction.message();

// Check the number of locks and whether there are duplicates
if SanitizedTransaction::validate_account_locks(
message,
if validate_account_locks(
message.account_keys(),
bank.get_transaction_account_lock_limit(),
)
.is_err()
Expand Down
7 changes: 3 additions & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ use {
},
serde::Serialize,
solana_accounts_db::{
account_locks::validate_account_locks,
accounts::{AccountAddressFilter, Accounts, PubkeyAccountSlot},
accounts_db::{
AccountShrinkThreshold, AccountStorageEntry, AccountsDb, AccountsDbConfig,
Expand Down Expand Up @@ -3281,10 +3282,8 @@ impl Bank {
transaction: &'a SanitizedTransaction,
) -> TransactionBatch<'_, '_> {
let tx_account_lock_limit = self.get_transaction_account_lock_limit();
let lock_result = SanitizedTransaction::validate_account_locks(
transaction.message(),
tx_account_lock_limit,
);
let lock_result =
validate_account_locks(transaction.message().account_keys(), tx_account_lock_limit);
let mut batch = TransactionBatch::new(
vec![lock_result],
self,
Expand Down

0 comments on commit e181194

Please sign in to comment.