BankingStage Refactor: Separate Consumer Module (#30238)

This commit is contained in:
Andrew Fitzgerald 2023-02-15 08:52:13 -08:00 committed by GitHub
parent a36e1b211d
commit beb3cd5ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2111 additions and 2058 deletions

View File

@ -10,7 +10,9 @@ use {
rayon::prelude::*, rayon::prelude::*,
solana_client::connection_cache::ConnectionCache, solana_client::connection_cache::ConnectionCache,
solana_core::{ solana_core::{
banking_stage::{committer::Committer, BankingStage, BankingStageStats}, banking_stage::{
committer::Committer, consumer::Consumer, BankingStage, BankingStageStats,
},
banking_trace::{BankingPacketBatch, BankingTracer}, banking_trace::{BankingPacketBatch, BankingTracer},
leader_slot_banking_stage_metrics::LeaderSlotMetricsTracker, leader_slot_banking_stage_metrics::LeaderSlotMetricsTracker,
qos_service::QosService, qos_service::QosService,
@ -95,7 +97,7 @@ fn bench_consume_buffered(bencher: &mut Bencher) {
// This tests the performance of buffering packets. // This tests the performance of buffering packets.
// If the packet buffers are copied, performance will be poor. // If the packet buffers are copied, performance will be poor.
bencher.iter(move || { bencher.iter(move || {
BankingStage::consume_buffered_packets( Consumer::consume_buffered_packets(
&bank_start, &bank_start,
&mut transaction_buffer, &mut transaction_buffer,
None::<Box<dyn Fn()>>, None::<Box<dyn Fn()>>,

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
use { use {
super::PreBalanceInfo,
crate::leader_slot_banking_stage_timing_metrics::LeaderExecuteAndCommitTimings, crate::leader_slot_banking_stage_timing_metrics::LeaderExecuteAndCommitTimings,
solana_ledger::{ solana_ledger::{
blockstore_processor::TransactionStatusSender, token_balances::collect_token_balances, blockstore_processor::TransactionStatusSender, token_balances::collect_token_balances,
@ -15,9 +14,11 @@ use {
transaction_batch::TransactionBatch, transaction_batch::TransactionBatch,
vote_sender_types::ReplayVoteSender, vote_sender_types::ReplayVoteSender,
}, },
solana_sdk::saturating_add_assign, solana_sdk::{pubkey::Pubkey, saturating_add_assign},
solana_transaction_status::token_balances::TransactionTokenBalancesSet, solana_transaction_status::{
std::sync::Arc, token_balances::TransactionTokenBalancesSet, TransactionTokenBalance,
},
std::{collections::HashMap, sync::Arc},
}; };
#[derive(Clone, Debug, PartialEq, Eq)] #[derive(Clone, Debug, PartialEq, Eq)]
@ -26,6 +27,13 @@ pub enum CommitTransactionDetails {
NotCommitted, NotCommitted,
} }
#[derive(Default)]
pub(super) struct PreBalanceInfo {
pub native: Vec<Vec<u64>>,
pub token: Vec<Vec<TransactionTokenBalance>>,
pub mint_decimals: HashMap<Pubkey, u8>,
}
pub struct Committer { pub struct Committer {
transaction_status_sender: Option<TransactionStatusSender>, transaction_status_sender: Option<TransactionStatusSender>,
replay_vote_sender: ReplayVoteSender, replay_vote_sender: ReplayVoteSender,

File diff suppressed because it is too large Load Diff