Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Use same max_age regardless of leader/not-leader (bp #9423) #9487

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use same max_age regardless of leader/not-leader (#9423)
automerge

(cherry picked from commit c77ed82)
  • Loading branch information
ryoqun authored and mergify-bot committed Apr 14, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2598d87706a79e77df85e7c7bbe71d637f2a0387
4 changes: 2 additions & 2 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ use solana_runtime::{
transaction_batch::TransactionBatch,
};
use solana_sdk::{
clock::{Slot, MAX_RECENT_BLOCKHASHES},
clock::{Slot, MAX_PROCESSING_AGE},
genesis_config::GenesisConfig,
hash::Hash,
pubkey::Pubkey,
@@ -70,7 +70,7 @@ fn execute_batch(
balances,
) = batch.bank().load_execute_and_commit_transactions(
batch,
MAX_RECENT_BLOCKHASHES,
MAX_PROCESSING_AGE,
transaction_status_sender.is_some(),
);

11 changes: 7 additions & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
@@ -32,7 +32,10 @@ use solana_metrics::{
};
use solana_sdk::{
account::Account,
clock::{get_segment_from_slot, Epoch, Slot, UnixTimestamp, MAX_RECENT_BLOCKHASHES},
clock::{
get_segment_from_slot, Epoch, Slot, UnixTimestamp, MAX_PROCESSING_AGE,
MAX_RECENT_BLOCKHASHES,
},
epoch_schedule::EpochSchedule,
fee_calculator::{FeeCalculator, FeeRateGovernor},
genesis_config::GenesisConfig,
@@ -1671,7 +1674,7 @@ impl Bank {
#[must_use]
pub fn process_transactions(&self, txs: &[Transaction]) -> Vec<Result<()>> {
let batch = self.prepare_batch(txs, None);
self.load_execute_and_commit_transactions(&batch, MAX_RECENT_BLOCKHASHES, false)
self.load_execute_and_commit_transactions(&batch, MAX_PROCESSING_AGE, false)
.0
.fee_collection_results
}
@@ -3859,7 +3862,7 @@ mod tests {

let lock_result = bank.prepare_batch(&pay_alice, None);
let results_alice = bank
.load_execute_and_commit_transactions(&lock_result, MAX_RECENT_BLOCKHASHES, false)
.load_execute_and_commit_transactions(&lock_result, MAX_PROCESSING_AGE, false)
.0
.fee_collection_results;
assert_eq!(results_alice[0], Ok(()));
@@ -5640,7 +5643,7 @@ mod tests {

let lock_result = bank0.prepare_batch(&txs, None);
let (transaction_results, transaction_balances_set) =
bank0.load_execute_and_commit_transactions(&lock_result, MAX_RECENT_BLOCKHASHES, true);
bank0.load_execute_and_commit_transactions(&lock_result, MAX_PROCESSING_AGE, true);

assert_eq!(transaction_balances_set.pre_balances.len(), 3);
assert_eq!(transaction_balances_set.post_balances.len(), 3);