[tor-bugs] #29707 [Core Tor/sbws]: sbws does not scale consensus bandwidths to bytes before using them

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Mar 9 04:36:57 UTC 2019


#29707: sbws does not scale consensus bandwidths to bytes before using them
-------------------------------+--------------------
     Reporter:  teor           |      Owner:  (none)
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/sbws  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 In this line, desc_bw is in bytes, but consensus_bandwidth is in
 kilobytes:
 {{{
 min_bandwidth = min(desc_bw, l.consensus_bandwidth)
 }}}
 https://github.com/torproject/sbws/blob/master/sbws/lib/v3bwfile.py#L977

 Here's how we could avoid bugs like this in future:
 * We should add some unit tests that only work when this bug is fixed
 * We should work out how to check that our test bandwidth scanners are
 producing numbers that are the right size

 Here are some things we might want to do. But they might not be worth the
 time:
 * all the variables should be labelled with units?
 * all the bandwidths in this file should be in the same units?
 * sbws should work in bytes, until it formats the file?

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


More information about the tor-bugs mailing list