Compute max blockhash age accounting for slot duration (#6421)

* Compute max blockhash age accounting for slot duration

* Update comment for the constant
This commit is contained in:
Pankaj Garg 2019-10-17 15:21:05 -07:00 committed by GitHub
parent 854c62e208
commit 326a4282bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -28,8 +28,9 @@ pub const NUM_CONSECUTIVE_LEADER_SLOTS: u64 = 4;
/// not be processed by the network.
pub const MAX_HASH_AGE_IN_SECONDS: usize = 120;
// This must be <= MAX_HASH_AGE_IN_SECONDS, otherwise there's risk for DuplicateSignature errors
pub const MAX_RECENT_BLOCKHASHES: usize = MAX_HASH_AGE_IN_SECONDS;
// Number of maximum recent blockhashes (one blockhash per slot)
pub const MAX_RECENT_BLOCKHASHES: usize =
MAX_HASH_AGE_IN_SECONDS * DEFAULT_TICKS_PER_SECOND as usize / DEFAULT_TICKS_PER_SLOT as usize;
// The maximum age of a blockhash that will be accepted by the leader
pub const MAX_PROCESSING_AGE: usize = MAX_RECENT_BLOCKHASHES / 2;