Here's the code I've found so far that deals with syncing time. It uses pool.ntp.org:123
as the time syncing source.
From Go Ethereum - p2p/discover/ntp.go, lines 48-65:
func checkClockDrift() {
drift, err := sntpDrift(ntpChecks)
if err != nil {
return
}
if drift < -driftThreshold || drift > driftThreshold {
warning := fmt.Sprintf("System clock seems off by %v, which can prevent network connectivity", drift)
howtofix := fmt.Sprintf("Please enable network time synchronisation in system settings")
separator := strings.Repeat("-", len(warning))
glog.V(logger.Warn).Info(separator)
glog.V(logger.Warn).Info(warning)
glog.V(logger.Warn).Info(howtofix)
glog.V(logger.Warn).Info(separator)
} else {
glog.V(logger.Debug).Infof("Sanity NTP check reported %v drift, all ok", drift)
}
}
From Go Ethereum - p2p/discover/ntp.go, lines 73-127:
func sntpDrift(measurements int) (time.Duration, error) {
// Resolve the address of the NTP server
addr, err := net.ResolveUDPAddr("udp", ntpPool+":123")
if err != nil {
return 0, err
}
// Construct the time request (empty package with only 2 fields set):
// Bits 3-5: Protocol version, 3
// Bits 6-8: Mode of operation, client, 3
request := make([]byte, 48)
request[0] = 3<<3 | 3
// Execute each of the measurements
drifts := []time.Duration{}
...
// Calculate average drif (drop two extremities to avoid outliers)
sort.Sort(durationSlice(drifts))
drift := time.Duration(0)
for i := 1; i < len(drifts)-1; i++ {
drift += drifts[i]
}
return drift / time.Duration(measurements), nil
}
Go Ethereum - p2p/discover/ntp.go, lines 33-36:
const (
ntpPool = "pool.ntp.org" // ntpPool is the NTP server to query for the current time
ntpChecks = 3 // Number of measurements to do against the NTP server
)
And driftThreshold = 10 seconds from p2p/discover/udp.go, line 57
If the hardcoded pool.ntp.org does undergo a long and sustained DDoS or DNS cache poisoning, Ethereum nodes will eventually fail to sync. But it will take a long time for the mining computers to drift by more than 10 seconds. And the Ethereum developers would have a a new fix out by that time.