BitcoinTalk

Warning : Check your system clock (help me)

BitcoinTalk
#1
From:
icaro
Subject:
Warning : Check your system clock (help me)
Date:
Warning :Check your system data and time , you may not be able to generate or receive the most recent blocks !

What does it mean ?    Huh   I'm just with 2 connections and 500 blocks.
BitcoinTalk
#2
From:
MoonShadow
Subject:
Re: Warning : Check your system ( Help me )
Date:
If your system clock is too far off, blocks that you create would be rejected, and your client will reject any blocks that it views have been created with a future date.
BitcoinTalk
#3
From:
satoshi
Subject:
Re: Warning : Check your system ( Help me )
Date:
Any suggestions for better text to put for this error message so the next person will be less likely to be confused?

It's trying to tell them their clock is wrong and they need to correct it.

It's relying on 3 time sources:
1) the system clock
2) the other nodes, if within an hour of the system clock
if those disagree, then
3) the user (asking the user to fix the system clock)

I've thought about NTP, but this is more secure.
BitcoinTalk
#4
From:
BioMike
Subject:
Re: Warning : Check your system ( Help me )
Date:
I've thought about NTP, but this is more secure.

IMHO there is no reason for a modern system to not run a NTP client/daemon.
BitcoinTalk
#5
From:
Insti
Subject:
Re: Warning : Check your system ( Help me )
Date:
I dont think the bitcoin client should start bloating itsself with additional NTP client functionality.
BitcoinTalk
#6
From:
Insti
Subject:
Re: Warning : Check your system ( Help me )
Date:
Any suggestions for better text to put for this error message so the next person will be less likely to be confused?

"Please check that your computers date and time are correct. If your clock is wrong Bitcoin will not work properly."



BitcoinTalk
#7
From:
Cdecker
Subject:
Re: Warning : Check your system ( Help me )
Date:
I'd go for a small server that returns a unix timestamp, the client fetches it, computes the clock drift (difference in time) and all the protocol related times are based on that drift. The clocks would still drift a little (they'd do it anyway on the system clock) and we would not get perfect synchronization (impossible in distributed systems), but it would solve our current problems.

The code is about 5 lines and some simple math (sums) when calculating the timestamps.
BitcoinTalk
#8
From:
BioMike
Subject:
Re: Warning : Check your system ( Help me )
Date:
I dont think the bitcoin client should start bloating itsself with additional NTP client functionality.


Hell no, NTP does a good job. Don't have other services changing the clock (also counts for bitcoin). Right tool for the right job!
BitcoinTalk
#9
From:
satoshi
Subject:
Re: Warning : Check your system ( Help me )
Date:
Any suggestions for better text to put for this error message so the next person will be less likely to be confused?
"Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
Thanks.
BitcoinTalk
#10
From:
ribuck
Subject:
Re: Warning : Check your system ( Help me )
Date:
Thanks.
Thank you Satoshi for sneaking that possessive apostrophe into "computer's date"!
BitcoinTalk
#11
From:
agaumoney
Subject:
Re: Warning : Check your system ( Help me )
Date:
I'd go for a small server that returns a unix timestamp, the client fetches it, computes the clock drift (difference in time) and all the protocol related times are based on that drift. The clocks would still drift a little (they'd do it anyway on the system clock) and we would not get perfect synchronization (impossible in distributed systems), but it would solve our current problems.

The code is about 5 lines and some simple math (sums) when calculating the timestamps.

Why a server when so many are already out there?

I'd agree that we don't want bitcoin client bloat, and definitely NO WAY the bitcoin client should be setting the system time.

But maybe it is worth it in the error case for the bitcoin client to put a message in the log and attempt to use a network time instead of system time.

As for the servers out there, the bitcoin client already has http, right?  Well, most http servers now provide the date in their headers.  For example, in python:
Code:
import os, re, urllib
info = urllib.urlopen('http://www.yahoo.com/').info()
regx = r'Date:\s+[A-Z][a-z]{2}, (\d{1,2}) ([A-Z][a-z]{2}) (\d{1,4}) (\d\d:\d\d:\d\d)'
d, M, Y, T = re.search(regx,str(info)).groups()
m = 1+"JanFebMarAprMayJunJulAugSepOctNovDec".index(M)/3
print '%04d.%02d.%02d-%s' % (int(Y), m, int(d), T)

(that output format happens to work with "date -us" if you did want to set some system time)

of course it would be better to check a couple of sites rather than relying on just yahoo to keep their http server time set properly.  Smiley
BitcoinTalk
#12
From:
Cdecker
Subject:
Re: Warning : Check your system ( Help me )
Date:
I think we all agree that setting the system time is a no go, but why can't we just use an offset internally and just circumvent the whole issue? We already have ways to synchronize (approximately) the clients, so why not make use of that?
BitcoinTalk
#13
From:
LZ
Subject:
Re: Warning : Check your system ( Help me )
Date:
Agreed. There is no need to set the system time.
We only need to use correct time in the program.
BitcoinTalk
#14
From:
satoshi
Subject:
Re: Warning : Check your system ( Help me )
Date:
I don't understand, are you under the impression that the program sets the system clock?  It doesn't.

We already have ways to synchronize (approximately) the clients, so why not make use of that?
We use an internal offset based on the median of other nodes' times, but for security reasons we don't let them offset us by more than an hour.  If they indicate we're off by more than an hour, then we resort to alerting the user to fix their clock.