Skip to content

Commit

Permalink
Backport #238 onto v1.14 (#264)
Browse files Browse the repository at this point in the history
* Preallocate Bundle Cost (#238)
  • Loading branch information
jedleggett authored Mar 21, 2023
1 parent 6725ab0 commit d19bd9e
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 35 deletions.
8 changes: 6 additions & 2 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,12 @@ impl BankingStage {

let transaction_costs = qos_service.compute_transaction_costs(txs.iter());

let (transactions_qos_results, num_included) =
qos_service.select_transactions_per_cost(txs.iter(), transaction_costs.iter(), bank);
let (transactions_qos_results, num_included) = qos_service.select_transactions_per_cost(
txs.iter(),
transaction_costs.iter(),
bank.slot(),
&mut bank.write_cost_tracker().unwrap(),
);

let cost_model_throttled_transactions_count = txs.len().saturating_sub(num_included);

Expand Down
5 changes: 4 additions & 1 deletion core/src/bundle_sanitizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ pub fn get_sanitized_bundle(
return Err(BundleSanitizerError::FailedCheckTransactions);
}

Ok(SanitizedBundle { transactions })
Ok(SanitizedBundle {
transactions,
uuid: packet_bundle.uuid,
})
}

// This function deserializes packets into transactions, computes the blake3 hash of transaction
Expand Down
Loading

0 comments on commit d19bd9e

Please sign in to comment.