should dir auths count it as a downtime if descriptor uptime resets?
Tonight teor and I were hunting for the part of the code where the directory authority resets its perspective of your uptime if you publish a new descriptor that has a lower uptime than expected based on the last descriptor -- which would indicate that you restarted your relay.
I found the part where we count it as a downtime if your address or port changes:
} else if (addr_changed || port_changed) {
/* If we're reachable, but the address changed, treat this as some
* downtime. */
and I found the part where we find a new descriptor novel if the uptime is surprising:
/* Did uptime fail to increase by approximately the amount we would think,
* give or take some slop? */
r1pub = r1->cache_info.published_on;
r2pub = r2->cache_info.published_on;
time_difference = labs(r2->uptime - (r1->uptime + (r2pub - r1pub)));
if (time_difference > ROUTER_ALLOW_UPTIME_DRIFT &&
time_difference > r1->uptime * .05 &&
time_difference > r2->uptime * .05)
return 0;
But I didn't find the part where put them together, i.e. we act on the router telling us that it restarted.
I could have sworn we implemented this long ago. Did we do it, then take it out? Did we think about it doing it but then not do it?
Should we do it now?