commit cf116bb9d3ef6f4cf75d6f94b9a3bb99ef304598 Author: Damian Johnson atagar@torproject.org Date: Wed Nov 12 09:01:32 2014 -0800
Drop config option for ignoring authorities
We just had this due to turtles. Now that Stem no longer includes it among the authorities it enumerates there's no need for this. Dropping support for the config option since I hope we won't need this again! --- consensus_health_checker.py | 22 ++++++++-------------- data/consensus_health.cfg | 4 ---- 2 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/consensus_health_checker.py b/consensus_health_checker.py index 0719fd6..13497bf 100755 --- a/consensus_health_checker.py +++ b/consensus_health_checker.py @@ -33,7 +33,6 @@ EMAIL_SUBJECT = 'Consensus issues' CONFIG = stem.util.conf.config_dict('consensus_health', { 'msg': {}, 'suppression': {}, - 'ignored_authorities': [], 'bandwidth_authorities': [], 'known_params': [], }) @@ -182,11 +181,6 @@ def rate_limit_notice(issue): config.save()
-@lru_cache() -def directory_authorities(): - return dict((k, v) for (k, v) in DIRECTORY_AUTHORITIES.items() if k not in CONFIG['ignored_authorities']) - - def main(): start_time = time.time()
@@ -492,7 +486,7 @@ def has_all_signatures(latest_consensus, consensuses, votes):
missing_authority = missing_signature
- for authority in directory_authorities().values(): + for authority in DIRECTORY_AUTHORITIES.values(): if authority.v3ident == missing_signature: missing_authority = authority.nickname break @@ -570,9 +564,9 @@ def has_authority_flag(latest_consensus, consensuses, votes): if Flag.AUTHORITY in desc.flags: seen_authorities.add(desc.nickname)
- known_authorities = set(directory_authorities().keys()) + known_authorities = set(DIRECTORY_AUTHORITIES.keys()) missing_authorities = known_authorities.difference(seen_authorities) - extra_authorities = seen_authorities.difference(known_authorities) - set(CONFIG['ignored_authorities']) + extra_authorities = seen_authorities.difference(known_authorities)
issues = []
@@ -590,8 +584,8 @@ def has_expected_fingerprints(latest_consensus, consensuses, votes):
issues = [] for desc in latest_consensus.routers.values(): - if desc.nickname in directory_authorities() and Flag.NAMED in desc.flags: - expected_fingerprint = directory_authorities()[desc.nickname].fingerprint + if desc.nickname in DIRECTORY_AUTHORITIES and Flag.NAMED in desc.flags: + expected_fingerprint = DIRECTORY_AUTHORITIES[desc.nickname].fingerprint
if desc.fingerprint != expected_fingerprint: issues.append(Issue(Runlevel.ERROR, 'FINGERPRINT_MISMATCH', authority = desc.nickname, expected = desc.fingerprint, actual = expected_fingerprint)) @@ -605,7 +599,7 @@ def is_recommended_versions(latest_consensus, consensuses, votes): outdated_authorities = {} min_version = min(latest_consensus.server_versions)
- for authority in directory_authorities().values(): + for authority in DIRECTORY_AUTHORITIES.values(): desc = latest_consensus.routers.get(authority.fingerprint)
if desc and desc.version and desc.version < min_version: @@ -694,7 +688,7 @@ def get_votes(): def _get_documents(label, resource): queries, documents, issues = {}, {}, []
- for authority in directory_authorities().values(): + for authority in DIRECTORY_AUTHORITIES.values(): if authority.v3ident is None: continue # not a voting authority
@@ -711,7 +705,7 @@ def _get_documents(label, resource): if label == 'vote': # try to download the vote via the other authorities
- v3ident = directory_authorities()[authority].v3ident + v3ident = DIRECTORY_AUTHORITIES[authority].v3ident
query = downloader.query( '/tor/status-vote/current/%s' % v3ident, diff --git a/data/consensus_health.cfg b/data/consensus_health.cfg index 3320129..c417287 100644 --- a/data/consensus_health.cfg +++ b/data/consensus_health.cfg @@ -26,10 +26,6 @@ suppression MISSING_AUTHORITIES => 24 # 1 day suppression TOR_OUT_OF_DATE => 24 # 1 day suppression AUTHORITY_UNAVAILABLE => 24 # 1 day
-# directory authorities for which to not provide notifications - -ignored_authorities turtles - # directory authorities that run bandwidth scanners
bandwidth_authorities moria1
tor-commits@lists.torproject.org