oxen-io / oxen-core

Oxen core repository, containing oxend and oxen cli wallets
https://oxen.io
Other
313 stars 120 forks source link

Improve Service Node Time Synchronicity #1633

Open KeeJef opened 1 year ago

KeeJef commented 1 year ago

Recently we've had some Service Nodes register with incorrectly synced clocks, this is an issue because it can cause users messages to fail to send if the Service Node thinks the users timestamp is out of bounds (because its own clock is out of bounds). These Service Nodes will be kicked from the network by other Service Nodes during testing, but they will bounce between decommissioned and registered until all uptime credits are used, exacerbating the time Session users can be affected.

Some options to reduce the prevalence of this issue

javabudd commented 1 week ago

tackling this on https://github.com/javabudd/oxen-core/tree/oxen-1633

javabudd commented 2 days ago

@KeeJef @jagerman Do you recommend we use NTP for this type of thing? If not, what is the preferred alternative?

jagerman commented 2 days ago

These days I use the built-in systemd-timesync service; it's a lighter weight alternative than a full ntpd service for just keeping the clock synced.

But this depends quite a bit on the hardware and distribution in use: some (maybe most?) VPSes rely on time synchronization on the host system.

javabudd commented 1 day ago

Yea that's why I was thinking something like this would require us to reach out to a centralized time server to make sure we're always in sync. If we warn on package install it may be easier to get the appropriate dependencies installed, but if we want to do this in the code itself it might make sense to make requests to an ntp server(pool.ntp.org?).