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:
parent
854c62e208
commit
326a4282bb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue