[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #24186 [Core Tor/Tor]: vote: Voting schedule is not updated before voting
#24186: vote: Voting schedule is not updated before voting
------------------------------+--------------------------------
Reporter: dgoulet | Owner: (none)
Type: defect | Status: new
Priority: Very High | Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Keywords: tor-dirauth
Actual Points: | Parent ID:
Points: | Reviewer:
Sponsor: |
------------------------------+--------------------------------
Commit e67f4441eb2646368e3e7cb1bcee403667b786f0 introduced a safeguard in
`dirvote_get_next_valid_after_time()` in order to recalculate the voting
schedule if it is called before it was initialized.
Turns out that it is actually called very early for a directory authority
with `sr_init()` thus the voting schedule is first initialized through
that safeguard.
That made the following check in `dirvote_act()` not work so the voting
schedule is never recalculated using the `now` that we are about to use to
vote with:
{{{
if (!voting_schedule.voting_starts) {
...
dirvote_recalculate_timing(options, now);
}
}}}
This lead to warnings such as (snipping some lines):
{{{
Nov 08 11:58:19.169 [info] Choosing expected valid-after time as
2017-11-08 16:58:20: consensus_set=0, interval=5
[...]
Nov 08 11:58:20.173 [notice] Time to vote.
[...]
Nov 08 11:58:20.175 [notice] Choosing valid-after time in vote as
2017-11-08 16:58:25: consensus_set=0, last_interval=5
Nov 08 11:58:20.181 [warn] Rejecting vote from 127.0.0.1 with valid-after
time of 2017-11-08 16:58:25; we were expecting 2017-11-08 16:58:20
Nov 08 11:58:20.181 [warn] Couldn't store my own vote! (I told myself,
'Bad valid-after time'.)
}}}
Voting schedule object was set at "11:58:19" which made a valid_after time
to "11:58:20" but we voted at "11:58:20" without updating that schedule so
we ended up computing a valid_after = "11:58:25" in the vote but not in
the voting schedule.
I *think* the fix here is to always recalculate our voting schedule when
we are about to vote to use the "now" value maybe?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24186>
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