|
61 | 61 | vote_sender_types::ReplayVoteSender,
|
62 | 62 | },
|
63 | 63 | solana_sdk::{
|
64 |
| - clock::{BankId, Slot, MAX_PROCESSING_AGE, NUM_CONSECUTIVE_LEADER_SLOTS}, |
| 64 | + clock::{BankId, Slot, NUM_CONSECUTIVE_LEADER_SLOTS, SLOT_MS}, |
65 | 65 | feature_set,
|
66 | 66 | genesis_config::ClusterType,
|
67 | 67 | hash::Hash,
|
@@ -90,7 +90,8 @@ pub const MAX_UNCONFIRMED_SLOTS: usize = 5;
|
90 | 90 | pub const DUPLICATE_LIVENESS_THRESHOLD: f64 = 0.1;
|
91 | 91 | pub const DUPLICATE_THRESHOLD: f64 = 1.0 - SWITCH_FORK_THRESHOLD - DUPLICATE_LIVENESS_THRESHOLD;
|
92 | 92 | const MAX_VOTE_SIGNATURES: usize = 200;
|
93 |
| -const MAX_VOTE_REFRESH_INTERVAL_MILLIS: usize = 5000; |
| 93 | +const VOTE_EXPIRATION_NUM_SLOTS: usize = 8; |
| 94 | +const MAX_VOTE_REFRESH_INTERVAL_MILLIS: usize = SLOT_MS as usize * VOTE_EXPIRATION_NUM_SLOTS; |
94 | 95 | // Expect this number to be small enough to minimize thread pool overhead while large enough
|
95 | 96 | // to be able to replay all active forks at the same time in most cases.
|
96 | 97 | const MAX_CONCURRENT_FORKS_TO_REPLAY: usize = 4;
|
@@ -2150,9 +2151,9 @@ impl ReplayStage {
|
2150 | 2151 | }
|
2151 | 2152 | if my_latest_landed_vote >= last_voted_slot
|
2152 | 2153 | || heaviest_bank_on_same_fork
|
2153 |
| - .is_hash_valid_for_age(&tower.last_vote_tx_blockhash(), MAX_PROCESSING_AGE) |
| 2154 | + .is_hash_valid_for_age(&tower.last_vote_tx_blockhash(), VOTE_EXPIRATION_NUM_SLOTS) |
2154 | 2155 | || {
|
2155 |
| - // In order to avoid voting on multiple forks all past MAX_PROCESSING_AGE that don't |
| 2156 | + // In order to avoid voting on multiple forks all past VOTE_EXPIRATION_NUM_SLOTS that don't |
2156 | 2157 | // include the last voted blockhash
|
2157 | 2158 | last_vote_refresh_time
|
2158 | 2159 | .last_refresh_time
|
@@ -6663,7 +6664,7 @@ pub(crate) mod tests {
|
6663 | 6664 | // Create a bank where the last vote transaction will have expired
|
6664 | 6665 | let expired_bank = {
|
6665 | 6666 | let mut parent_bank = bank2.clone();
|
6666 |
| - for _ in 0..MAX_PROCESSING_AGE { |
| 6667 | + for _ in 0..VOTE_EXPIRATION_NUM_SLOTS { |
6667 | 6668 | parent_bank = Arc::new(Bank::new_from_parent(
|
6668 | 6669 | &parent_bank,
|
6669 | 6670 | &Pubkey::default(),
|
|
0 commit comments