[tor-commits] [tor/master] Display the fingerprint when downloading consensuses from fallbacks

nickm at torproject.org nickm at torproject.org
Tue Dec 20 23:38:54 UTC 2016


commit 9629a25d1019cffffc39f3982161b610eab5691f
Author: teor <teor2345 at gmail.com>
Date:   Wed Dec 7 16:02:17 2016 +1100

    Display the fingerprint when downloading consensuses from fallbacks
---
 changes/fallbacks-201612            |  6 ++++++
 scripts/maint/updateFallbackDirs.py | 13 ++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/changes/fallbacks-201612 b/changes/fallbacks-201612
index 0306ad1..e0e412c 100644
--- a/changes/fallbacks-201612
+++ b/changes/fallbacks-201612
@@ -16,6 +16,12 @@
     - Exclude relays affected by 20499 from the fallback list. Exclude known
       affected versions, and any relay that delivers a stale consensus.
       Closes ticket 20539.
+    - Require fallbacks to have flags for 90% of the time (weighted decaying
+      average), rather than 95%. This allows at least 73% of clients to
+      bootstrap in the first 5 seconds without contacting an authority.
+      Part of ticket 18828.
+    - Display the fingerprint when downloading consensuses from fallbacks.
+      Closes ticket 20908.
   o Minor bugfix (fallback directories):
     - Stop failing when OUTPUT_COMMENTS is True in updateFallbackDirs.py.
       Closes ticket 20877; bugfix on commit 9998343 in tor-0.2.8.3-alpha.
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index 40b0056..df5f049 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -1127,14 +1127,15 @@ class Candidate(object):
   # log how long it takes to download a consensus from dirip:dirport
   # returns True if the download failed, False if it succeeded within max_time
   @staticmethod
-  def fallback_consensus_download_speed(dirip, dirport, nickname, max_time):
+  def fallback_consensus_download_speed(dirip, dirport, nickname, fingerprint,
+                                        max_time):
     download_failed = False
     start = datetime.datetime.utcnow()
     # some directory mirrors respond to requests in ways that hang python
     # sockets, which is why we log this line here
-    logging.info('Initiating %sconsensus download from %s (%s:%d).',
+    logging.info('Initiating %sconsensus download from %s (%s:%d) %s.',
                  'microdesc ' if DOWNLOAD_MICRODESC_CONSENSUS else '',
-                 nickname, dirip, dirport)
+                 nickname, dirip, dirport, fingerprint)
     # there appears to be about 1 second of overhead when comparing stem's
     # internal trace time and the elapsed time calculated here
     TIMEOUT_SLOP = 1.0
@@ -1171,9 +1172,9 @@ class Candidate(object):
     else:
       status = 'ok'
       level = logging.DEBUG
-    logging.log(level, 'Consensus download: %0.1fs %s from %s (%s:%d), ' +
+    logging.log(level, 'Consensus download: %0.1fs %s from %s (%s:%d) %s, ' +
                  'max download time %0.1fs.', elapsed, status, nickname,
-                 dirip, dirport, max_time)
+                 dirip, dirport, fingerprint, max_time)
     return download_failed
 
   # does this fallback download the consensus fast enough?
@@ -1185,12 +1186,14 @@ class Candidate(object):
       ipv4_failed = Candidate.fallback_consensus_download_speed(self.dirip,
                                                 self.dirport,
                                                 self._data['nickname'],
+                                                self._fpr,
                                                 CONSENSUS_DOWNLOAD_SPEED_MAX)
     if self.has_ipv6() and PERFORM_IPV6_DIRPORT_CHECKS:
       # Clients assume the IPv6 DirPort is the same as the IPv4 DirPort
       ipv6_failed = Candidate.fallback_consensus_download_speed(self.ipv6addr,
                                                 self.dirport,
                                                 self._data['nickname'],
+                                                self._fpr,
                                                 CONSENSUS_DOWNLOAD_SPEED_MAX)
     return ((not ipv4_failed) and (not ipv6_failed))
 





More information about the tor-commits mailing list