Skip to content

Commit

Permalink
better spot to cache epoch stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Oct 18, 2024
1 parent 1205a8a commit a0534d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 10 additions & 0 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ impl BankingStage {
committer.clone(),
transaction_recorder.clone(),
log_messages_bytes_limit,
bank_forks.clone(),
unprocessed_transaction_storage,
)
})
Expand Down Expand Up @@ -516,6 +517,7 @@ impl BankingStage {
committer.clone(),
transaction_recorder.clone(),
log_messages_bytes_limit,
bank_forks.clone(),
UnprocessedTransactionStorage::new_vote_storage(
latest_unprocessed_votes.clone(),
vote_source,
Expand Down Expand Up @@ -590,6 +592,7 @@ impl BankingStage {
committer: Committer,
transaction_recorder: TransactionRecorder,
log_messages_bytes_limit: Option<usize>,
bank_forks: Arc<RwLock<BankForks>>,
unprocessed_transaction_storage: UnprocessedTransactionStorage,
) -> JoinHandle<()> {
let mut packet_receiver = PacketReceiver::new(id, packet_receiver);
Expand All @@ -607,6 +610,7 @@ impl BankingStage {
&mut packet_receiver,
&decision_maker,
&consumer,
&bank_forks,
id,
unprocessed_transaction_storage,
)
Expand Down Expand Up @@ -669,6 +673,7 @@ impl BankingStage {
packet_receiver: &mut PacketReceiver,
decision_maker: &DecisionMaker,
consumer: &Consumer,
bank_forks: &RwLock<BankForks>,
id: u32,
mut unprocessed_transaction_storage: UnprocessedTransactionStorage,
) {
Expand Down Expand Up @@ -696,6 +701,11 @@ impl BankingStage {

tracer_packet_stats.report(1000);

if !unprocessed_transaction_storage.should_not_process() {
unprocessed_transaction_storage
.cache_epoch_boundary_info(&bank_forks.read().unwrap().working_bank());
}

match packet_receiver.receive_and_buffer_packets(
&mut unprocessed_transaction_storage,
&mut banking_stage_stats,
Expand Down
3 changes: 0 additions & 3 deletions core/src/banking_stage/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ impl Consumer {
banking_stage_stats: &BankingStageStats,
slot_metrics_tracker: &mut LeaderSlotMetricsTracker,
) {
// Cache epoch info if necessary.
unprocessed_transaction_storage.cache_epoch_boundary_info(&bank_start.working_bank);

let mut rebuffered_packet_count = 0;
let mut consumed_buffered_packets_count = 0;
let mut proc_start = Measure::start("consume_buffered_process");
Expand Down

0 comments on commit a0534d0

Please sign in to comment.