Clock Synchronisation #1450
Replies: 3 comments 4 replies
-
Philosophically, my gut reaction is that rolling our own NTP-over-websocket is not a great idea. While cloud/VPS PDS instances are more likely to be synchronized than, eg, an old laptop or mobile phone, the blast radius of a poorly-synchronized PDS (eg, raspberry pi in a hot closet?) could be larger. We have a bunch of timestamps flying around the system (with more to come), and my intuition is that we need to ensure everything works reasonably with a couple minutes of drift. Having a mechanism to detect clock drift could be helpful; maybe every response from the PDS could include a timestamp? Eg, |
Beta Was this translation helpful? Give feedback.
-
I get the issue of drift across PDSes in a heterogeneous, broad network. (And even BGSes and AppViews I guess, but probably to a lesser degree in practice.) I expect Mastodon has some experience reconciling that with timeline rendering, notification handling, etc. It'd be interesting to see what they've done. I'm curious though, what was the background behind having clients set timestamps like |
Beta Was this translation helpful? Give feedback.
-
Realized one odd quirk here just now. If posts and similar records didn't have |
Beta Was this translation helpful? Give feedback.
-
There are a lot of systems out there with inaccurate clock timestamps, either due to incremental drift over time (on the order of seconds or minutes), or by multiple hours, due to misconfigured timezones.
The net result of this is that many clients are inadvertently setting inaccurate
createdAt
timestamps in their records, among other headaches (e.g. bluesky-social/social-app#1064).A native client can use NTP or similar, but a web client doesn't have that luxury.
Vague idea towards a solution: some sort of "NTP over websocket" protocol, that a client could use to accurately sync with the clock of a PDS.
Beta Was this translation helpful? Give feedback.
All reactions