[tor-bugs] #11327 [Tor]: Dir auths should choose Fast and Guard flags by consensus weight if they don't measure

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Oct 16 07:31:35 UTC 2015


#11327: Dir auths should choose Fast and Guard flags by consensus weight if they
don't measure
-------------------------------------------------+-------------------------
 Reporter:  arma                                 |          Owner:
     Type:  defect                               |         Status:
 Priority:  High                                 |  needs_revision
Component:  Tor                                  |      Milestone:  Tor:
 Severity:  Normal                               |  0.2.8.x-final
 Keywords:  tor-auth, 026-triaged-1,             |        Version:  Tor:
  027-triaged-1-in                               |  0.2.7
Parent ID:                                       |     Resolution:
  Sponsor:  SponsorU                             |  Actual Points:
                                                 |         Points:
                                                 |  small/medium
-------------------------------------------------+-------------------------
Changes (by arma):

 * status:  needs_review => needs_revision
 * severity:   => Normal


Comment:

 I just pushed some more commits that refactor that function and comment it
 better. They're in my 'ticket11327' branch.

 (I think they are on top of tvdw's latest branch, but somebody should
 check it to be sure.)

 And now that I've refactored it, a question becomes clearer:
 {{{
        if (node->rs && node->rs->bandwidth_kb) {
 +        /* Case 3: Not running a bwauth, and we know a weight from the
 +         * consensus. Use that one (so e.g. we won't vote Fast on a relay
 +         * that the consensus has given very low weight to). */
          bw_kb = node->rs->bandwidth_kb;
        }
 }}}

 Is the 'if' part the right way to check that we have a consensus? It seems
 like "we have a consensus but it lists this relay's weight as 0" will be
 mistaken as "no we don't have a consensus". Nick did the ri, rs, etc
 refactorings long ago, so he is the perfect person to answer/improve this
 part.

 And then once we're set there, I could imagine another refactoring where
 we take out the bw_kb variable and just do a 'return' for each case.

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


More information about the tor-bugs mailing list