From 553ec3d74742ca97393560c8221eb937068918d0 Mon Sep 17 00:00:00 2001 From: buffalu <85544055+buffalu@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:47:24 -0600 Subject: [PATCH] Backport #500 to v1.16 (#506) --- core/src/bundle_stage/bundle_consumer.rs | 6 ++++++ core/src/bundle_stage/committer.rs | 7 +++---- programs/sbf/Cargo.lock | 12 ++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/src/bundle_stage/bundle_consumer.rs b/core/src/bundle_stage/bundle_consumer.rs index 83f3619fd68f24..dc9fcc1e64304b 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 ae87c25aaf7c9c..a1bbc36e09be5d 100644 --- a/core/src/bundle_stage/committer.rs +++ b/core/src/bundle_stage/committer.rs @@ -15,7 +15,7 @@ use { prioritization_fee_cache::PrioritizationFeeCache, vote_sender_types::ReplayVoteSender, }, - solana_sdk::{saturating_add_assign, transaction::SanitizedTransaction}, + solana_sdk::{hash::Hash, saturating_add_assign, transaction::SanitizedTransaction}, solana_transaction_status::{ token_balances::{TransactionTokenBalances, TransactionTokenBalancesSet}, PreBalanceInfo, @@ -58,13 +58,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 diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 4f92ecc0296199..ffbaac3c2527c0 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -416,9 +416,9 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" [[package]] name = "ascii" @@ -694,9 +694,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec", @@ -1144,9 +1144,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "convert_case"