Skip to content

Commit

Permalink
Add Blockhash Metrics to Bundle Committer (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalu authored Dec 11, 2023
1 parent f3a8346 commit e3f294f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: mozilla-actions/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/downstream-project-anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
version: ["v0.29.0"]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- shell: bash
run: |
Expand Down
6 changes: 6 additions & 0 deletions core/src/bundle_stage/bundle_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,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,
Expand Down Expand Up @@ -725,6 +729,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,
Expand Down
7 changes: 3 additions & 4 deletions core/src/bundle_stage/committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<usize>,
bank: &Arc<Bank>,
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
Expand Down

0 comments on commit e3f294f

Please sign in to comment.