use cost model to limit new account creation (#21369)
* use cost model to limit new account creation * handle every system instruction * remove & * simplify match * simplify match * add datapoint for account data size * add postgres error handling * handle accounts:unlock_accounts
This commit is contained in:
committed by
GitHub
parent
025a5a3b9c
commit
90f41fd9b7
@ -949,8 +949,8 @@ impl BankingStage {
|
||||
bank.prepare_sanitized_batch_with_results(txs, transactions_qos_results.into_iter());
|
||||
lock_time.stop();
|
||||
|
||||
// retryable_txs includes AccountInUse, WouldExceedMaxBlockCostLimit and
|
||||
// WouldExceedMaxAccountCostLimit
|
||||
// retryable_txs includes AccountInUse, WouldExceedMaxBlockCostLimit
|
||||
// WouldExceedMaxAccountCostLimit, and WouldExceedMaxAccountDataCostLimit
|
||||
let (result, mut retryable_txs) = Self::process_and_record_transactions_locked(
|
||||
bank,
|
||||
poh,
|
||||
|
@ -133,6 +133,10 @@ impl QosService {
|
||||
self.metrics.retried_txs_per_account_limit_count.fetch_add(1, Ordering::Relaxed);
|
||||
Err(TransactionError::WouldExceedMaxAccountCostLimit)
|
||||
}
|
||||
CostTrackerError::WouldExceedAccountDataMaxLimit => {
|
||||
self.metrics.retried_txs_per_account_data_limit_count.fetch_add(1, Ordering::Relaxed);
|
||||
Err(TransactionError::WouldExceedMaxAccountDataCostLimit)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -165,6 +169,7 @@ struct QosServiceMetrics {
|
||||
selected_txs_count: AtomicU64,
|
||||
retried_txs_per_block_limit_count: AtomicU64,
|
||||
retried_txs_per_account_limit_count: AtomicU64,
|
||||
retried_txs_per_account_data_limit_count: AtomicU64,
|
||||
}
|
||||
|
||||
impl QosServiceMetrics {
|
||||
@ -204,6 +209,12 @@ impl QosServiceMetrics {
|
||||
.swap(0, Ordering::Relaxed) as i64,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"retried_txs_per_account_data_limit_count",
|
||||
self.retried_txs_per_account_data_limit_count
|
||||
.swap(0, Ordering::Relaxed) as i64,
|
||||
i64
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user