cost model to ignore vote transactions (#20510)

This commit is contained in:
Tao Zhu 2021-10-07 12:49:07 -05:00 committed by GitHub
parent 1c36af158f
commit 0ebd8c53ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 7 deletions

View File

@ -1175,13 +1175,20 @@ impl BankingStage {
verified_transactions_with_packet_indexes
.into_iter()
.filter_map(|(tx, tx_index)| {
let result = cost_tracker_readonly.would_transaction_fit(
&tx,
demote_program_write_locks,
cost_tracker_stats,
);
if result.is_err() {
debug!("transaction {:?} would exceed limit: {:?}", tx, result);
// excluding vote TX from cost_model, for now
let is_vote = &msgs.packets[tx_index].meta.is_simple_vote_tx;
if !is_vote
&& cost_tracker_readonly
.would_transaction_fit(
&tx,
demote_program_write_locks,
cost_tracker_stats,
)
.is_err()
{
// put transaction into retry queue if it wouldn't fit
// into current bank
debug!("transaction {:?} would exceed limit", tx);
retryable_transaction_packet_indexes.push(tx_index);
return None;
}