Skip to content

Commit

Permalink
increase timestamp tolerance to 4 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
sveitser committed Oct 9, 2024
1 parent 05800f0 commit 56cd728
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion types/src/v0/impls/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 56cd728

Please sign in to comment.