summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
AgeCommit message (Collapse)Author
2018-04-27mod: Move dirauth specific files to its own moduleDavid Goulet
This is a pretty big commit but it only moves these files to src/or/dirauth: dircollate.c dirvote.c shared_random.c shared_random_state.c dircollate.h dirvote.h shared_random.h shared_random_state.h Then many files are modified to change the include line for those header files that have moved into a new directory. Without using --disable-module-dirauth, everything builds fine. When using the flag to disable the module, tor doesn't build due to linking errors. This will be addressed in the next commit(s). No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27dirvote: Move voting_schedule_t to dirvote.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27dirvote: Trim down the public APIDavid Goulet
Many functions become static to the C file or exposed to the tests within the PRIVATE define of dirvote.h. This commit moves a function to the top. No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-22Require MIN_METHOD_FOR_RECOMMENDED_PROTOCOLSNick Mathewson
(Remove support for running without this method.)
2018-04-22Remove MIN_METHOD_FOR_{SHARED_RANDOM,EXCLUDING_INVALID_NODES}Nick Mathewson
Also remove client detection for pre-EXCLUDING_INVALID_NODES consensuses, and a test for that detection.
2018-04-22Remove MIN_METHOD_FOR_ED25519_ID_VOTINGNick Mathewson
This also lets us remove the old rsa-based routerstatus collator.
2018-04-22Remove MIN_METHOD_FOR_{PACKAGE_LINES,GUARDFRACTION,ED25519_ID_IN_MD}Nick Mathewson
Also remove a rest for pre-19 microdesc versions.
2018-04-22Remove MIN_METHOD_FOR_ID_HASH_IN_MD and a test for running without it.Nick Mathewson
2018-04-22Remove MIN_METHOD_{FOR_P6_LINES,FOR_NTOR_KEY,TO_CLIP_UNMEASURED_BW}Nick Mathewson
Also remove a unit test for pre-MIN_METHOD_FOR_NTOR_KEY consensuses.
2018-04-22Remove MIN_METHOD_FOR and MIN_METHOD_FOR_A_LINESNick Mathewson
Also, in networkstatus.c, remove client code for recognizing pre- MIN_METHOD_FOR_A_LINES consensuses, and corresponding unit tests in test_dir.c.
2018-04-22Disable consensus methods before 25.Nick Mathewson
Consensus method 25 is the oldest one supported by any stable version of 0.2.9, which is our current most-recent LTS. Thus, by proposal 290, they should be removed. This commit does not actually remove the code to implement these methods: it only makes it so authorities will no longer support them. I'll remove the backend code for them in later commits.
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