Authorities don't downweight the total_weighted_time of the current run
Now that moria1 is putting wfu / tk / mtbf stats into its vote (#40314 (closed)), I can debug #19162 better.
Here are the stats lines for Quintex55, every 6 hours over the past 11 epochs (3ish days), with vote files fetched from https://collector.torproject.org/recent/relay-descriptors/votes/:
/votes$ grep -A7 Quintex55 *|grep "stats "
2021-05-14-00-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-5A6F7CCE734AB587456A99B9F2DEFF30F792B465-stats wfu=1.00000 tk=10127955 mtbf=10114138
2021-05-14-06-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-6CFDA8C6B548AFE621DA82EFFCFA2B4B3086BAD3-stats wfu=1.00000 tk=10149555 mtbf=10136400
2021-05-14-12-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-92F0B2FF1B77A6087409C2A51F70558CDDBD70A6-stats wfu=1.00000 tk=10171155 mtbf=10157972
2021-05-14-18-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-C054364686435578B0113D28CE119EB2C370B212-stats wfu=1.00000 tk=10192755 mtbf=10180204
2021-05-15-00-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-825A9A8E6DECEA34B9A286FCC4A4486500727A3C-stats wfu=1.00000 tk=10214355 mtbf=10201777
2021-05-15-06-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-3588CC0BAB41252A6DD0A4DF983DE078BC80249E-stats wfu=1.00000 tk=10235955 mtbf=10223980
2021-05-15-12-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-A2F23CD0CA6C8E1258B4069C867EE0035893DB22-stats wfu=1.00000 tk=10257556 mtbf=10245556
2021-05-15-18-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-DDDAE64F46205072FABEB55CE5B30FB598C7582B-stats wfu=1.00000 tk=10279156 mtbf=10267731
2021-05-16-00-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-315C62D935ED1CF5D655E9BC04C620D16C07C260-stats wfu=1.00000 tk=10300755 mtbf=10289306
2021-05-16-06-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-60B5832291D64193D13DDFE66C4A6E48DED0FEC7-stats wfu=1.00000 tk=10322355 mtbf=10311455
2021-05-16-12-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-09FC559E090218533ADB4638C1258328CA8F47DD-stats wfu=1.00000 tk=10343956 mtbf=10333033
2021-05-16-18-00-00-vote-D586D18309DED4CD6D57C18FDB97EFA96D330566-72C045B2C1799D9524EE01345E379B13FCE3D024-stats wfu=1.00000 tk=10365556 mtbf=10355157
Check out the progression of that tk value: every 6 hours it is 3600*6 seconds bigger.
But, every 12 hours moria1 should be downweighting that tk value by a factor of 0.95! That happens in rep_hist_downrate_old_runs(), which I've confirmed moria1 runs every 12 hours (give or take the minor bug in #40394 (closed)).
The tk= value in the stats line in the vote comes from
rep_hist_get_weighted_time_known(rs->identity_digest, now)
(see routerstatus_format_entry())
and that function looks it up in the history map by id and then returns get_total_weighted_time(hist, when)
, and then get_total_weighted_time() looks at hist->total_weighted_time
.
And hist->total_weighted_time
is one of the things that gets downweighted for every item in the history map every 12 hours in rep_hist_downrate_old_runs().
So, what's going wrong? Is Quintex55 not in the history map? Is the digestmap_iter_* stuff broken?