[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #29707 [Core Tor/sbws]: sbws does not scale consensus bandwidths to bytes before using them
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs