Added vote limits to be 75% of total block limit

This commit is contained in:
Tao Zhu
2022-01-11 17:56:08 -06:00
committed by Tao Zhu
parent 5655ea0061
commit 3e131a5324
5 changed files with 142 additions and 60 deletions

View File

@@ -31,6 +31,7 @@ use {
cost_model::CostModel,
cost_tracker::CostTracker,
hardened_unpack::{open_genesis_config, MAX_GENESIS_ARCHIVE_UNPACKED_SIZE},
hashed_transaction::HashedTransaction,
snapshot_utils::{self, SnapshotVersion, DEFAULT_MAX_SNAPSHOTS_TO_RETAIN},
},
solana_sdk::{
@@ -755,7 +756,9 @@ fn compute_slot_cost(blockstore: &Blockstore, slot: Slot) -> Result<(), String>
for transaction in &entry.transactions {
programs += transaction.message().instructions.len();
let tx_cost = cost_model.calculate_cost(transaction, true);
let result = cost_tracker.try_add(transaction, &tx_cost);
let hashed_transaction = HashedTransaction::from(transaction);
let result =
cost_tracker.try_add(hashed_transaction.is_simple_vote_transaction(), &tx_cost);
if result.is_err() {
println!(
"Slot: {}, CostModel rejected transaction {:?}, reason {:?}",