fix: cleanup (#35298)

This commit is contained in:
enjoyoor 2024-02-23 14:59:52 -05:00 committed by GitHub
parent fe571bbab3
commit c02f47a6fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View File

@ -100,7 +100,7 @@ impl Forwarder {
slot_metrics_tracker.increment_forwardable_batches_count(1);
let batched_forwardable_packets_count = forward_batch.len();
let (_forward_result, sucessful_forwarded_packets_count, leader_pubkey) = self
let (_forward_result, successful_forwarded_packets_count, leader_pubkey) = self
.forward_buffered_packets(
&forward_option,
forward_batch.get_forwardable_packets(),
@ -114,7 +114,7 @@ impl Forwarder {
);
}
let failed_forwarded_packets_count = batched_forwardable_packets_count
.saturating_sub(sucessful_forwarded_packets_count);
.saturating_sub(successful_forwarded_packets_count);
if failed_forwarded_packets_count > 0 {
slot_metrics_tracker.increment_failed_forwarded_packets_count(
@ -123,9 +123,9 @@ impl Forwarder {
slot_metrics_tracker.increment_packet_batch_forward_failure_count(1);
}
if sucessful_forwarded_packets_count > 0 {
if successful_forwarded_packets_count > 0 {
slot_metrics_tracker.increment_successful_forwarded_packets_count(
sucessful_forwarded_packets_count as u64,
successful_forwarded_packets_count as u64,
);
}
});

View File

@ -407,11 +407,11 @@ struct QosServiceMetricsStats {
/// overhead introduced by cost_model
compute_cost_time: AtomicU64,
/// total nummber of transactions in the reporting period to be computed for theit cost. It is
/// total number of transactions in the reporting period to be computed for their cost. It is
/// usually the number of sanitized transactions leader receives.
compute_cost_count: AtomicU64,
/// acumulated time in micro-sec spent in tracking each bank's cost. It is the second part of
/// accumulated time in micro-sec spent in tracking each bank's cost. It is the second part of
/// overhead introduced
cost_tracking_time: AtomicU64,
@ -424,7 +424,7 @@ struct QosServiceMetricsStats {
/// accumulated estimated write locks Compute Units to be packed into block
estimated_write_lock_cu: AtomicU64,
/// accumulated estimated instructino data Compute Units to be packed into block
/// accumulated estimated instruction data Compute Units to be packed into block
estimated_data_bytes_cu: AtomicU64,
/// accumulated estimated builtin programs Compute Units to be packed into block
@ -732,7 +732,7 @@ mod tests {
bank.read_cost_tracker().unwrap().block_cost()
);
// all transactions are committed with actual units more than estimated
let commited_status: Vec<CommitTransactionDetails> = qos_cost_results
let committed_status: Vec<CommitTransactionDetails> = qos_cost_results
.iter()
.map(|tx_cost| CommitTransactionDetails::Committed {
compute_units: tx_cost.as_ref().unwrap().bpf_execution_cost()
@ -742,7 +742,7 @@ mod tests {
let final_txs_cost = total_txs_cost + execute_units_adjustment * transaction_count;
// All transactions are committed, no costs should be removed
QosService::remove_costs(qos_cost_results.iter(), Some(&commited_status), &bank);
QosService::remove_costs(qos_cost_results.iter(), Some(&committed_status), &bank);
assert_eq!(
total_txs_cost,
bank.read_cost_tracker().unwrap().block_cost()
@ -752,7 +752,7 @@ mod tests {
bank.read_cost_tracker().unwrap().transaction_count()
);
QosService::update_costs(qos_cost_results.iter(), Some(&commited_status), &bank);
QosService::update_costs(qos_cost_results.iter(), Some(&committed_status), &bank);
assert_eq!(
final_txs_cost,
bank.read_cost_tracker().unwrap().block_cost()
@ -835,7 +835,7 @@ mod tests {
.collect();
let execute_units_adjustment = 10u64;
// assert only commited tx_costs are applied cost_tracker
// assert only committed tx_costs are applied cost_tracker
{
let qos_service = QosService::new(1);
let txs_costs = qos_service.compute_transaction_costs(
@ -854,7 +854,7 @@ mod tests {
bank.read_cost_tracker().unwrap().block_cost()
);
// Half of transactions are not committed, the rest with cost adjustment
let commited_status: Vec<CommitTransactionDetails> = qos_cost_results
let committed_status: Vec<CommitTransactionDetails> = qos_cost_results
.iter()
.enumerate()
.map(|(n, tx_cost)| {
@ -869,8 +869,8 @@ mod tests {
})
.collect();
QosService::remove_costs(qos_cost_results.iter(), Some(&commited_status), &bank);
QosService::update_costs(qos_cost_results.iter(), Some(&commited_status), &bank);
QosService::remove_costs(qos_cost_results.iter(), Some(&committed_status), &bank);
QosService::update_costs(qos_cost_results.iter(), Some(&committed_status), &bank);
// assert the final block cost
let mut expected_final_txs_count = 0u64;

View File

@ -199,7 +199,7 @@ fn consume_scan_should_process_packet(
// sanitized_transactions vector. Otherwise, a transaction could
// be blocked by a transaction that did not take batch locks. This
// will lead to some transactions never being processed, and a
// mismatch in the priorty-queue and hash map sizes.
// mismatch in the priority-queue and hash map sizes.
//
// Always take locks during batch creation.
// This prevents lower-priority transactions from taking locks