[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #18177 [DocTor]: Check Fallback Directory IPv4 and IPv6 addresses using DocTor



#18177: Check Fallback Directory IPv4 and IPv6 addresses using DocTor
-------------------------+-----------------------------
 Reporter:  teor         |          Owner:  atagar
     Type:  enhancement  |         Status:  closed
 Priority:  Medium       |      Milestone:
Component:  DocTor       |        Version:
 Severity:  Normal       |     Resolution:  implemented
 Keywords:               |  Actual Points:
Parent ID:               |         Points:
  Sponsor:               |
-------------------------+-----------------------------
Changes (by atagar):

 * status:  new => closed
 * resolution:   => implemented


Comment:

 Thanks teor! Done, but with a lot of
 [https://gitweb.torproject.org/stem.git/commit/?id=332ef6e6fe89d9f0d48e9b95acff7de9f3ec647f
 expansion over what you asked]. Stem now has a FallbackDirectory class
 with two methods for getting this information...

 *
 [https://stem.torproject.org/api/descriptor/remote.html#stem.descriptor.remote.FallbackDirectory.from_remote
 FallbackDirectory.from_remote()] reads the latest fallback_dirs.inc from
 gitweb, providing the latest fallback directories in tor's master branch.

 *
 [https://stem.torproject.org/api/descriptor/remote.html#stem.descriptor.remote.FallbackDirectory.from_cache
 FallbackDirectory.from_cache()] provides the latest fallback directories
 Stem has cached. This is only as up-to-date as your Stem release but is
 quicker and avoids relying on gitweb.

 Advantages are...

 * Stem's descriptor.remote module now puts less load on the directory
 authorities since it uses fallback directories as well.

 * Much, much easier to add further scripts that take advantage of the
 fallback directories.

 * Running Stem's integ tests with the ONLINE target includes a test that
 exercises all the fallback directories, notifying us if any are down.

 Here's an example script to check the performance of the fallback
 directories...

 {{{
 import time
 from stem.descriptor.remote import DescriptorDownloader, FallbackDirectory

 downloader = DescriptorDownloader()

 for fallback_directory in FallbackDirectory.from_cache().values():
   start = time.time()
   downloader.get_consensus(endpoints = [(fallback_directory.address,
 fallback_directory.dir_port)]).run()
   print('Downloading the consensus took %0.2f from %s' % (time.time() -
 start, fallback_directory.nickname))
 }}}

 {{{
 % python example.py
 Downloading the consensus took 5.07 from Doedel22
 Downloading the consensus took 3.59 from tornoderdednl
 Downloading the consensus took 4.16 from Logforme
 Downloading the consensus took 6.76 from Doedel21
 Downloading the consensus took 5.21 from kitten4
 Downloading the consensus took 3.25 from kili
 Downloading the consensus took 4.23 from wagner
 Downloading the consensus took 3.30 from BabylonNetwork03
 Downloading the consensus took 3.50 from kitten2
 Downloading the consensus took 3.31 from coby
 Downloading the consensus took 5.61 from GrmmlLitavis
 Downloading the consensus took 5.05 from Doedel24
 Downloading the consensus took 3.60 from BabylonNetwork02
 Downloading the consensus took 3.61 from Unnamed
 Downloading the consensus took 2.71 from Binnacle
 Downloading the consensus took 30.80 from eriador
 Downloading the consensus took 6.91 from Doedel26
 Downloading the consensus took 3.30 from fluxe4
 Downloading the consensus took 3.16 from PedicaboMundi
 Downloading the consensus took 3.33 from kitten1
 Downloading the consensus took 3.39 from fluxe3
 }}}

 Feel free to reopen if you need anything else.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18177#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs