[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

(Desperate) Plea for multi-person code review



My past few posts to this list have been about developing new formulas
for load balancing Tor requests. I've since implemented these formulas
in my git branch mikeperry/consensus-bw-weights3. You can get it with:

 git clone git://git.torproject.org/git/tor.git tor.git
 cd tor.git
 git remote add mikeperry git://git.torproject.org/mikeperry/tor
 git fetch mikeperry
 git branch --track mp-consensus-bw-weights3 mikeperry/consensus-bw-weights3
 git checkout mp-consensus-bw-weights3

X11 users can see the change sets easily with 'gitk'.

The consensus weight calculation changes exist in
networkstatus_compute_bw_weights_v9() in dirvote.c, but what really
needs lots of eyeballs is smartlist_choose_by_bandwidth_weights() and
all the codepaths that lead to it in routerlist.c (and also those
elsewhere that don't, but should!). Basically anywhere we choose to
use a node somehow, we need to ensure we are properly weighting node
probability selection for it.

The reason why it is more important to review the client code than the
formulas right now is because every time we make an error client-side,
we need to wait almost an entire year after the fix before enough
clients upgrade and we begin to see the results of the fix on network
load. (Yes. It takes up to a year for everyone to upgrade.. We really
need an autoupdater.)

Weight calculation updates and bugfixes now will at least take place
as soon as 4 out of 7 directory authorities do a 'git pull', but
client errors with using weights can mean years of further bad Tor
performance.

Our track record with these codepaths hasn't exactly been great
either: So far we've made at least 3-4 critical errors in the
implementation of node selection, leading to uniform guard selection
in two separate instances, due to two different bugs! One of them is
ruining Tor performance as we speak, and things won't improve until
most of the clients upgrade to the not-yet-released 0.2.1.23.

I'm going to try to budget some time for statistical verification of
these codepaths later on, but that won't be foolproof either. If you
can read C code and have a few moments to spare, please do have a look
at my git branch and check it for logic, branching, arithmetic, and
transcription errors in at least the client node selection, if not
also the weight calculations themselves.


-- 
Mike Perry
Mad Computer Scientist
fscked.org evil labs

Attachment: pgpglCVpLIesU.pgp
Description: PGP signature