aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2023-08-25 16:54:54 +0000
committerDavid Goulet <dgoulet@torproject.org>2023-08-25 16:54:54 +0000
commit99a19a0da6c7cf3af14682c554b01ff2d695f314 (patch)
treed45878c57dda403368e2ce354352991170823941 /src/feature
parente13a4b3a69841c6595dc87bb07fc7ebec4e8363a (diff)
parent0cdd5a79002166e8eb88929dcbc6b87c00292be5 (diff)
downloadtor-99a19a0da6c7cf3af14682c554b01ff2d695f314.tar.gz
tor-99a19a0da6c7cf3af14682c554b01ff2d695f314.zip
Merge branch 'no_consensus_on_package_lines' into 'main'
Implement proposal 301-dont-vote-on-package-fingerprints.txt See merge request tpo/core/tor!743
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/dirauth/dirvote.c6
-rw-r--r--src/feature/dirauth/dirvote.h8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index 77148c8725..81d8cffd25 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -1631,7 +1631,11 @@ networkstatus_compute_consensus(smartlist_t *votes,
n_versioning_servers);
client_versions = compute_consensus_versions_list(combined_client_versions,
n_versioning_clients);
- packages = compute_consensus_package_lines(votes);
+
+ if (consensus_method < MIN_METHOD_TO_OMIT_PACKAGE_FINGERPRINTS)
+ packages = tor_strdup("");
+ else
+ packages = compute_consensus_package_lines(votes);
SMARTLIST_FOREACH(combined_server_versions, char *, cp, tor_free(cp));
SMARTLIST_FOREACH(combined_client_versions, char *, cp, tor_free(cp));
diff --git a/src/feature/dirauth/dirvote.h b/src/feature/dirauth/dirvote.h
index ae8d43a6f0..6d02ef3635 100644
--- a/src/feature/dirauth/dirvote.h
+++ b/src/feature/dirauth/dirvote.h
@@ -53,7 +53,7 @@
#define MIN_SUPPORTED_CONSENSUS_METHOD 28
/** The highest consensus method that we currently support. */
-#define MAX_SUPPORTED_CONSENSUS_METHOD 33
+#define MAX_SUPPORTED_CONSENSUS_METHOD 34
/**
* Lowest consensus method where microdescriptor lines are put in canonical
@@ -80,6 +80,12 @@
*/
#define MIN_METHOD_TO_SUPPRESS_MD_PUBLISHED 33
+/**
+ * Lowest (supported) consensus method for which we do not include
+ * any "package" lines.
+ **/
+#define MIN_METHOD_TO_OMIT_PACKAGE_FINGERPRINTS 34
+
/** Default bandwidth to clip unmeasured bandwidths to using method >=
* MIN_METHOD_TO_CLIP_UNMEASURED_BW. (This is not a consensus method; do not
* get confused with the above macros.) */