oxen-core icon indicating copy to clipboard operation
oxen-core copied to clipboard

Improve Service Node Time Synchronicity

Open KeeJef opened this issue 2 years ago • 4 comments

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

  • Warn during installation of Service Node package that local time may be out of sync and that this may result in deregistration
  • Require retesting clock before Service Node can go from Decommissioned -> Registered (prevents bouncing back and forth between decommissioned and registered)

KeeJef avatar Feb 20 '23 02:02 KeeJef

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

javabudd avatar Oct 08 '24 23:10 javabudd

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

javabudd avatar Oct 15 '24 01:10 javabudd

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.

jagerman avatar Oct 15 '24 01:10 jagerman

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?).

javabudd avatar Oct 15 '24 01:10 javabudd