[tor-bugs] #28442 [Core Tor/sbws]: sbws does not round bandwidths to 3 significant figures (was: sbws does not round bandwidths to 2 significant figures)

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Nov 14 12:03:54 UTC 2018


#28442: sbws does not round bandwidths to 3 significant figures
---------------------------+-------------------------------------
 Reporter:  teor           |          Owner:  teor
     Type:  defect         |         Status:  needs_review
 Priority:  Medium         |      Milestone:  sbws 1.0 (MVP must)
Component:  Core Tor/sbws  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+-------------------------------------
Changes (by teor):

 * status:  assigned => needs_review


Old description:

> sbws currently rounds bandwidths to the nearest 1000. (Bandwidths under
> 500 are rounded to 1.)
>
> This creates large errors in relay bandwidths:
> * max(round(499, -3), 1) = 1
> * max(round(500, -3), 1) = 1000
> * max(round(1499, -3), 1) = 1000
>
> But torflow rounds bandwidths to 3 significant figures:
> https://gitweb.torproject.org/torflow.git/tree/NetworkScanners/BwAuthority/aggregate.py#n62
>
> And proposal 276 says to round to 2 significant figures, with some extra
> rounding of the final non-zero digit:
> https://gitweb.torproject.org/torspec.git/tree/proposals/276-lower-bw-
> granularity.txt#n36
>
> This is a bug on #27337.

New description:

 sbws currently rounds bandwidths to the nearest 1000. (Bandwidths under
 500 are rounded to 1.)

 This creates large errors in relay bandwidths:
 * max(round(499, -3), 1) = 1
 * max(round(500, -3), 1) = 1000
 * max(round(1499, -3), 1) = 1000

 But torflow rounds bandwidths to 3 significant figures:
 https://gitweb.torproject.org/torflow.git/tree/NetworkScanners/BwAuthority/aggregate.py#n62

 ~~And proposal 276 says to round to 2 significant figures, with some extra
 rounding of the final non-zero digit:
 https://gitweb.torproject.org/torspec.git/tree/proposals/276-lower-bw-
 granularity.txt#n36~~

 This is a bug on #27337.

--

Comment:

 See https://github.com/torproject/sbws/pull/286

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


More information about the tor-bugs mailing list