fix: use milliseconds for Lamport timestamp initialization (#179)

Changed Lamport timestamp initialization from nanoseconds to
milliseconds. The current time in nanoseconds exceeds JavaScript's
Number.MAX_SAFE_INTEGER, making nanosecond precision unsuitable for
JavaScript implementations. Milliseconds provide sufficient precision
while remaining well within safe integer bounds for decades to come.
This commit is contained in:
fryorcraken
2025-09-15 20:23:58 +10:00
committed by GitHub
parent f051117d37
commit b1da70386e

View File

@@ -111,7 +111,7 @@ Its importance is expected to increase once a p2p retrieval mechanism is added t
Each participant MUST maintain:
* A Lamport timestamp for each channel of communication,
initialized to current epoch time in nanosecond resolution.
initialized to current epoch time in millisecond resolution.
* A bloom filter for received message IDs per channel.
The bloom filter SHOULD be rolled over and
recomputed once it reaches a predefined capacity of message IDs.