summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
AgeCommit message (Collapse)Author
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-01-31Merge remote-tracking branch 'public/ticket24849_032'Nick Mathewson
2018-01-26Improve log when unable to add sigs to pending consensusNick Mathewson
Closes ticket 24849.
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson
2017-12-04Merge branch 'bug23826-23828_squashed'Nick Mathewson
2017-11-22Fix a confusing comment about tie-breaking in compute_routerstatus_consensus()teor
Closes bug 24372.
2017-11-18Move an assertion to make scan-build happy again.Nick Mathewson
2017-11-08dirauth: Recalculate voting schedule at first voteDavid Goulet
Commit e67f4441eb2646368e3e7cb1bcee403667b786f0 introduced a safeguard against using an uninitialized voting schedule object. However, the dirvote_act() code was looking roughly at the same thing to know if it had to compute the timings before voting with this condition: if (!voting_schedule.voting_starts) { ... dirvote_recalculate_timing(options, now); } The sr_init() function is called very early and goes through the safeguard thus the voting schedule is always initilized before the first vote. That first vote is a crucial one because we need to have our voting schedule aligned to the "now" time we are about to use for voting. Then, the schedule is updated when we publish our consensus or/and when we set a new consensus. From that point on, we only want to update the voting schedule through that code flow. This "created_on_demand" is indicating that the timings have been recalculated on demand by another subsystem so if it is flagged, we know that we need to ignore its values before voting. Fixes #24186 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-08downgrade severity for get_voting_schedule()Nick Mathewson
2017-11-07Add a safe guard to avoid using a zeroed voting scheduleDavid Goulet
dirvote_get_next_valid_after_time() is the only public function that uses the voting schedule outside of the dirvote subsystem so if it is zeroed, recalculate its timing if we can that is if a consensus exists. Part of #24161 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-31Make tor recalculate voting schedule even if not a dirauthDavid Goulet
Because the HS subsystem needs the voting schedule to compute time period, we need all tor type to do that. Part of #23623 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-27sr: Don't use a dynamic voting scheduleDavid Goulet
The exposed get_voting_schedule() allocates and return a new object everytime it is called leading to an awful lot of memory allocation when getting the start time of the current round which is done for each node in the consensus. Closes #23623 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-27dirvote: Move code. No behavior changeDavid Goulet
Needed for next commit to address #23623. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-15Add a new consensus method that removes IPv6 address lines from microdescsteor
Implements #23828.
2017-10-15Add a consensus_method argument to routerstatus_format_entry()teor
And pass ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD when it's not applicable. Preparation for #23826.
2017-10-15Improve the comment on networkstatus_compute_consensus()teor
2017-09-12Fix warnings about passing uninitialized buffers into functionsNick Mathewson
Most of these buffers were never actually inspected, but it's still bad style.
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-07-13rephist: Remove unused crypto_pk statistics.Isis Lovecruft
These statistics were largely ununsed, and kept track of statistical information on things like how many time we had done TLS or how many signatures we had verified. This information is largely not useful, and would only be logged after receiving a SIGUSR1 signal (but only if the logging severity level was less than LOG_INFO). * FIXES #19871. * REMOVES note_crypto_pk_op(), dump_pk_op(), and pk_op_counts from src/or/rephist.c. * REMOVES every external call to these functions.
2017-07-07Avoid a scan_build warning in dirvote_get_intermediate_param_valueNick Mathewson
Fixes bug 21495.
2017-03-15Run the copyright update script.Nick Mathewson
2017-02-15Merge branch 'maint-0.2.9'Nick Mathewson
2017-02-14Prevent int underflow in dirvote.c compare_vote_rs_.Nick Mathewson
This should be "impossible" without making a SHA1 collision, but let's not keep the assumption that SHA1 collisions are super-hard. This prevents another case related to 21278. There should be no behavioral change unless -ftrapv is on.
2016-10-27Automated change to use smartlist_add_strdupovercaffeinated
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
2016-10-26Small refactoring: explain G,M,E,D,T initializationNick Mathewson
2016-10-26Add consensus weight calculation testsMatt Traudt
2016-10-26Fix default bw weights with new consensus methodMatt Traudt
See #14881
2016-10-24Merge remote-tracking branch 'pastly/ticket20273'Nick Mathewson
2016-10-24Module documentation (and an important caveat) for dirvote.cNick Mathewson
2016-10-06comment tweak. Fixes 20271. patch from pastly.Nick Mathewson
2016-10-03Change some dirvote.c comments to reflect realityMatt Traudt
2016-09-26Merge branch 'protover_v2_squashed'Nick Mathewson
2016-09-26Rename "proto " to "pr " in consensusesNick Mathewson
2016-09-26Rename compute_protover_vote to protover_compute_voteNick Mathewson
2016-09-26Vote on 'proto' lines and include them after 'v' lines.Nick Mathewson
(Despite the increased size of the consensus, this should have approximately zero effect on the compressed consensus size, since the "proto" line should be completely implied by the "v" line.)
2016-09-26Include protocol versions in votes.Nick Mathewson
2016-09-26Implement voting on the protocol-version optionsNick Mathewson
2016-09-26Include protocol version lines in votes.Nick Mathewson
2016-09-26Remove a little duplicated code before it becomes a lotNick Mathewson
2016-08-26prop272: When voting, include no non-Valid relays in consensusNick Mathewson
Implements ticket 20002, and part of proposal 272.
2016-08-19Rename free_voting_schedule to voting_schedule_free. Wrap line. Follow if ↵Nick Mathewson
convention.
2016-08-16Added a voting_schedule_free function to free voting schedules.Daniel Pinto
Existing Uses of the tor_free function on voting schedules were replaced with voting_schedule_free. Fixes #19562.
2016-07-28Fix a huge pile of -Wshadow warnings.Nick Mathewson
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-07-01Keep make check-spaces happyAndrea Shepard
2016-07-01Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed'Nick Mathewson
Trivial Conflicts: src/or/or.h src/or/routerparse.c
2016-07-01prop250: Use the new dirvote_get_intermediate_param_value for ↵David Goulet
AuthDirNumSRVAgreements Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01Refactor parameter computation and add a helper functionNick Mathewson
This patch makes us retain the intermediate list of K=V entries for the duration of computing our vote, and lets us use that list with a new function in order to look up parameters before the consensus is published. We can't actually use this function yet because of #19011: our existing code to do this doesn't actually work, and we'll need a new consensus method to start using it. Closes ticket #19012.