From 542eff09762e4f8ba5fb9e8cb813edfe456475f4 Mon Sep 17 00:00:00 2001 From: hanako mumei <81144685+2501babe@users.noreply.github.com> Date: Tue, 27 Aug 2024 00:41:02 -0700 Subject: [PATCH] remove blockhash/lmaps per sig from core --- core/src/banking_stage/committer.rs | 7 +------ core/src/banking_stage/consumer.rs | 14 +------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/core/src/banking_stage/committer.rs b/core/src/banking_stage/committer.rs index 4c5bf8bbf5382b..ff27104251759e 100644 --- a/core/src/banking_stage/committer.rs +++ b/core/src/banking_stage/committer.rs @@ -12,7 +12,7 @@ use { transaction_batch::TransactionBatch, vote_sender_types::ReplayVoteSender, }, - solana_sdk::{hash::Hash, pubkey::Pubkey, saturating_add_assign}, + solana_sdk::{pubkey::Pubkey, saturating_add_assign}, solana_svm::{ transaction_commit_result::{TransactionCommitResult, TransactionCommitResultExtensions}, transaction_processing_result::{ @@ -65,13 +65,10 @@ impl Committer { self.transaction_status_sender.is_some() } - #[allow(clippy::too_many_arguments)] pub(super) fn commit_transactions( &self, batch: &TransactionBatch, processing_results: Vec, - last_blockhash: Hash, - lamports_per_signature: u64, starting_transaction_index: Option, bank: &Arc, pre_balance_info: &mut PreBalanceInfo, @@ -87,8 +84,6 @@ impl Committer { let (commit_results, commit_time_us) = measure_us!(bank.commit_transactions( batch.sanitized_transactions(), processing_results, - last_blockhash, - lamports_per_signature, processed_counts, &mut execute_and_commit_timings.execute_timings, )); diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index 39e3dc1fd95d5c..e1f1b67fdb41a5 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -665,17 +665,7 @@ impl Consumer { let (freeze_lock, freeze_lock_us) = measure_us!(bank.freeze_lock()); execute_and_commit_timings.freeze_lock_us = freeze_lock_us; - - // In order to avoid a race condition, leaders must get the last - // blockhash *before* recording transactions because recording - // transactions will only succeed if the block max tick height hasn't - // been reached yet. If they get the last blockhash *after* recording - // transactions, the block max tick height could have already been - // reached and the blockhash queue could have already been updated with - // a new blockhash. - let ((last_blockhash, lamports_per_signature), last_blockhash_us) = - measure_us!(bank.last_blockhash_and_lamports_per_signature()); - execute_and_commit_timings.last_blockhash_us = last_blockhash_us; + execute_and_commit_timings.last_blockhash_us = 0; let (record_transactions_summary, record_us) = measure_us!(self .transaction_recorder @@ -713,8 +703,6 @@ impl Consumer { self.committer.commit_transactions( batch, processing_results, - last_blockhash, - lamports_per_signature, starting_transaction_index, bank, &mut pre_balance_info,