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

Commit

Permalink
Use same max_age regardless of leader/not-leader (#9423)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
ryoqun authored Apr 14, 2020
1 parent 2d0224b commit c77ed82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
);

Expand Down
11 changes: 7 additions & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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(()));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c77ed82

Please sign in to comment.