[tor-bugs] #22358 [Core Tor/Tor]: should dir auths count it as a downtime if descriptor uptime resets?

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 24 05:06:00 UTC 2017


#22358: should dir auths count it as a downtime if descriptor uptime resets?
------------------------------+-----------------
     Reporter:  arma          |      Owner:
         Type:  enhancement   |     Status:  new
     Priority:  Medium        |  Milestone:
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+-----------------
 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?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22358>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list