From 56cd728250f7d398e7a9536043e8f86148746fde Mon Sep 17 00:00:00 2001 From: Mathis Antony Date: Wed, 9 Oct 2024 12:16:15 -0600 Subject: [PATCH] increase timestamp tolerance to 4 seconds --- types/src/v0/impls/state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/src/v0/impls/state.rs b/types/src/v0/impls/state.rs index 5487dfe5e..533059ab0 100644 --- a/types/src/v0/impls/state.rs +++ b/types/src/v0/impls/state.rs @@ -334,7 +334,9 @@ pub fn validate_proposal( let system_time: u64 = OffsetDateTime::now_utc().unix_timestamp() as u64; // TODO 2 seconds of tolerance should be enough for reasonably // configured nodes, but we should make this configurable. - if proposal.timestamp().abs_diff(system_time) > 2 { + // Add another 2 seconds to account for the time it takes to + // propagate the message. + if proposal.timestamp().abs_diff(system_time) > 4 { return Err(ProposalValidationError::InvalidTimestampDrift { proposal_timestamp: proposal.timestamp(), local_timestamp: system_time,