From 0ebd8c53ee1538b1b5c69e0ec107e966ac0a2c17 Mon Sep 17 00:00:00 2001 From: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:49:07 -0500 Subject: [PATCH] cost model to ignore vote transactions (#20510) --- core/src/banking_stage.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index b564ab291..dd583461b 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -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; }