Opened 3 years ago

Last modified 3 years ago

#22358 new enhancement

should dir auths count it as a downtime if descriptor uptime resets?

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 032-unreached
Cc: 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?

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by teor

Milestone: Tor: 0.3.2.x-final

comment:2 Changed 3 years ago by nickm

Keywords: 032-unreached added
Milestone: Tor: 0.3.2.x-finalTor: unspecified

Move some 0.3.2 items (fewer than I had expected for now) into Unspecified.

Note: See TracTickets for help on using tickets.