Remove MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS

This commit is contained in:
Nick Mathewson 2023-10-05 08:14:36 -04:00
parent a7993bbd72
commit a2ab949a13
2 changed files with 4 additions and 16 deletions

View File

@ -3945,14 +3945,10 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method)
}
if (family) {
if (consensus_method < MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS) {
smartlist_add_asprintf(chunks, "family %s\n", family);
} else {
const uint8_t *id = (const uint8_t *)ri->cache_info.identity_digest;
char *canonical_family = nodefamily_canonicalize(family, id, 0);
smartlist_add_asprintf(chunks, "family %s\n", canonical_family);
tor_free(canonical_family);
}
const uint8_t *id = (const uint8_t *)ri->cache_info.identity_digest;
char *canonical_family = nodefamily_canonicalize(family, id, 0);
smartlist_add_asprintf(chunks, "family %s\n", canonical_family);
tor_free(canonical_family);
}
if (summary && strcmp(summary, "reject 1-65535"))
@ -4050,8 +4046,6 @@ static const struct consensus_method_range_t {
int high;
} microdesc_consensus_methods[] = {
{MIN_SUPPORTED_CONSENSUS_METHOD,
MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS - 1},
{MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS,
MIN_METHOD_FOR_UNPADDED_NTOR_KEY - 1},
{MIN_METHOD_FOR_UNPADDED_NTOR_KEY,
MAX_SUPPORTED_CONSENSUS_METHOD},

View File

@ -55,12 +55,6 @@
/** The highest consensus method that we currently support. */
#define MAX_SUPPORTED_CONSENSUS_METHOD 34
/**
* Lowest consensus method where microdescriptor lines are put in canonical
* form for improved compressibility and ease of storage. See proposal 298.
**/
#define MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS 29
/** Lowest consensus method where an unpadded base64 onion-key-ntor is allowed
* See #7869 */
#define MIN_METHOD_FOR_UNPADDED_NTOR_KEY 30