[tor-bugs] #12538 [Tor]: Make all relays automatically be dir caches

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Nov 10 08:05:26 UTC 2015


#12538: Make all relays automatically be dir caches
-------------------------------------------------+-------------------------
 Reporter:  cypherpunks                          |          Owner:
     Type:  task                                 |         Status:
 Priority:  High                                 |  needs_review
Component:  Tor                                  |      Milestone:  Tor:
 Severity:  Normal                               |  0.2.8.x-final
 Keywords:  tor-guard, tor-relay, prop237,       |        Version:  Tor:
  026-triaged-1, sebastian-review,               |  unspecified
  027-triaged-1-out, 028-triage, 028-triaged,    |     Resolution:
  mike-can, pre028-patch                         |  Actual Points:
Parent ID:                                       |         Points:
  Sponsor:                                       |  medium/large
-------------------------------------------------+-------------------------

Comment (by sysrqb):

 Replying to [comment:68 nickm]:
 > `feature12538_rebased_7` in my public repository is rebased on master,
 with the NotDir/BelieveNotDir stuff removed, and the bugs mentioned above
 fixed.
 >
 > My only remaining issue is:
 > > * I worry about the definition of dir_server_mode(). Possibly, if we
 have advertised that we're a dirserver, we should actually be a dirserver?

 Alternatively,

 1) if we have the V2Dir flag then dir_server_mode() returns 1, else the
 function is unchanged.
 2) when options->DirCache is disabled, dir_server_mode() only uses
 options->DirCache after the next consensus is published. Serve the
 documents we currently have without caching new docs until then.
 3) split dir_server_mode() into dir_server_mode() and dir_cache_mode(),
 where dir_server_mode() looks at our is_v2_dir flag rather than
 options->DirCache shortcircuit; and dir_cache_mode() is:
 {{{ return options->DirCache && dir_server_mode(); }}}. Then
 directory_permits_begindir_requests() depends on dir_server_mode() and we
 continue serving clients until we notice we lost the V2Dir flag.

 I worry because each of these is slightly surprising for relay operators
 in different ways. Tweaking the man page's description of DirCache so it
 says the relay stops caching new directory documents and stops accepting
 client dir connections after it loses its V2Dir flag (if it earned it), is
 easy. Or, we differentiate between caching and serving, always serving if
 we have V2Dir but only cache if DirCache is set. This could be sad for
 client's though, depending on how often they see cache misses, but maybe
 this is a general improvement and not something to be overly concerned
 about.

 >
 > Also we should test this on chutney to verify that everything works
 correctly for servers without DirPort support.


 Replying to [comment:69 teor]:
 > It's important that these relays work in mixed dirport / no dirport
 networks, which probably means creating a new torrc template and a new
 network, then testing that network as part of make test-network-all in
 tor.
 When I ran previous branches in chutney with mixed versions and mixed
 dirport, I modified them manually. By this I mean I created 100 nodes,
 then disabled the dirport on a handful of them, then I started the test
 network. When all nodes were running, I stopped a few of the dirport-
 enabled instances and restarted them with a binary of a different tor
 version. It wasn't the most elegant, but it worked.

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


More information about the tor-bugs mailing list