From 282309ba6755873403893029d3257524713162b7 Mon Sep 17 00:00:00 2001 From: buffalu <85544055+buffalu@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:09:13 -0600 Subject: [PATCH] Backport #500 to v1.17 (#507) --- core/src/bundle_stage/bundle_consumer.rs | 6 ++++++ core/src/bundle_stage/committer.rs | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/bundle_stage/bundle_consumer.rs b/core/src/bundle_stage/bundle_consumer.rs index bbabc77d9c..beaf98bd55 100644 --- a/core/src/bundle_stage/bundle_consumer.rs +++ b/core/src/bundle_stage/bundle_consumer.rs @@ -687,6 +687,10 @@ impl BundleConsumer { let (freeze_lock, freeze_lock_us) = measure_us!(bank_start.working_bank.freeze_lock()); execute_and_commit_timings.freeze_lock_us = freeze_lock_us; + let (last_blockhash, lamports_per_signature) = bank_start + .working_bank + .last_blockhash_and_lamports_per_signature(); + let ( RecordTransactionsSummary { result: record_transactions_result, @@ -724,6 +728,8 @@ impl BundleConsumer { // note: execute_and_commit_timings.commit_us handled inside this function let (commit_us, commit_bundle_details) = committer.commit_bundle( &mut bundle_execution_results, + last_blockhash, + lamports_per_signature, starting_transaction_index, &bank_start.working_bank, &mut execute_and_commit_timings, diff --git a/core/src/bundle_stage/committer.rs b/core/src/bundle_stage/committer.rs index ec0577be4e..5bdf0c0b5a 100644 --- a/core/src/bundle_stage/committer.rs +++ b/core/src/bundle_stage/committer.rs @@ -12,7 +12,7 @@ use { bank_utils, prioritization_fee_cache::PrioritizationFeeCache, }, - solana_sdk::{saturating_add_assign, transaction::SanitizedTransaction}, + solana_sdk::{hash::Hash, saturating_add_assign, transaction::SanitizedTransaction}, solana_transaction_status::{ token_balances::{TransactionTokenBalances, TransactionTokenBalancesSet}, PreBalanceInfo, @@ -56,13 +56,12 @@ impl Committer { pub(crate) fn commit_bundle<'a>( &self, bundle_execution_output: &'a mut LoadAndExecuteBundleOutput<'a>, + last_blockhash: Hash, + lamports_per_signature: u64, mut starting_transaction_index: Option, bank: &Arc, execute_and_commit_timings: &mut LeaderExecuteAndCommitTimings, ) -> (u64, CommitBundleDetails) { - let (last_blockhash, lamports_per_signature) = - bank.last_blockhash_and_lamports_per_signature(); - let transaction_output = bundle_execution_output.bundle_transaction_results_mut(); let (commit_transaction_details, commit_times): (Vec<_>, Vec<_>) = transaction_output