Skip to content

Commit

Permalink
Fix timestamp inconsistencie
Browse files Browse the repository at this point in the history
Due to latency, sometime a node can handle the start mining message and send the cross validation message to other node before the other node had handle the start mining message. And so we have a timestamp inconsistencie.
To solve it we add a difference of 3 sec which is the default timeout for the start mining message
  • Loading branch information
Neylix committed Jul 4, 2022
1 parent 4801820 commit dd0d0bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/archethic/mining/validation_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ defmodule Archethic.Mining.ValidationContext do
validation_time: validation_time
}) do
diff = DateTime.diff(timestamp, validation_time)
diff <= 0 and diff > -10
diff <= 3 and diff > -10
end

defp valid_stamp_signature(stamp = %ValidationStamp{}, %__MODULE__{
Expand Down

0 comments on commit dd0d0bc

Please sign in to comment.