[tor-bugs] #6647 [Tor Client]: pathbias_get_scale_factor() is using the wrong default and also causes rounding errors (was: pathbias_get_scale_factor() is using the wrong default)

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu Aug 23 01:32:44 UTC 2012


#6647: pathbias_get_scale_factor() is using the wrong default and also causes
rounding errors
-----------------------------+----------------------------------------------
 Reporter:  mikeperry        |          Owner:  mikeperry         
     Type:  defect           |         Status:  needs_revision    
 Priority:  major            |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client       |        Version:                    
 Keywords:  MikePerry201208  |         Parent:                    
   Points:                   |   Actualpoints:  2                 
-----------------------------+----------------------------------------------

Comment(by mikeperry):

 Ok, I've thought about this for a while. I see two ways forward on this
 front:

 1. We can go back to the divisor, and only scale 'if ((first_hop %
 divisor) == 0 && (success_count % divisor) == 0)'. For this route, a
 default divisor of 2 makes the most sense, I think.

 2. We store a decimal value for the PathBias rate in the state file and
 actually do a moving average for real instead of screwing around in
 integer land.

 I think my stabby sense is telling me Nick would prefer the modulus route
 for 0.2.3.x for now, since it is the least amount of code change from the
 original implementation. I think we should also use a divisor of 2 instead
 of 4. That way, if both values of success_count and first_hop are even, we
 scale. Otherwise, we wait until they are both even.

 Again, I'm really sorry my fast-and-loose approach to software development
 has exposed you to so much noise on this front, Nick... I promise to do
 the floating point implementation and write a real proposal for the
 feature for 0.2.4.x.

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


More information about the tor-bugs mailing list