-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
Description
Just came across this bug: when converting a factom Timestamp to a Golang time.Time, the milliseconds are not converted correctly. Example:
fmt.Println(time.Now())
ts := primitives.NewTimestampNow()
fmt.Println(ts.GetTime())Output:
2020-06-29 14:56:43.556323 +0200 CEST m=+0.002009801
2020-06-29 14:56:43.000556 +0200 CEST
The milliseconds shifted from milliseconds to being microseconds. Fortunately, factomd is mostly using Timestamp internally and doesn't convert to time.Time except for a few cases:
- The Live API for admin block event ServerFault, DBlock headers, DBlock anchors, Entry Reveals, and Transactions
- The HoldingList for testing if messages are stale (no major ramifications as long as it's consistent)
- Processlist checking if messages are out of date (no major ramifications as long as it's consistent)
- Message filter (no major ramifications as long as it's consistent)
The fix is incredibly simple: 6b9fde5
However, this might need to wait for a hard fork to be updated. Some nodes accepting messages that are less than 1ms away from being timed out and other nodes rejecting them could be an attack vector.
Reactions are currently unavailable