commit 957818d4fe6e44232cd01501cef212e623d2c973 Author: Damian Johnson atagar@torproject.org Date: Fri Nov 21 09:45:05 2014 -0800
Using stem to check for bandwidth authorities
Rather than using a hardcoded list in our config fetching this from Stem. That way other people will be able to take advantage of an up-to-date-ish listing of who is and isn't a bandwidth authority. --- consensus_health_checker.py | 7 +++---- data/consensus_health.cfg | 8 -------- 2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/consensus_health_checker.py b/consensus_health_checker.py index b4be10b..5890c95 100755 --- a/consensus_health_checker.py +++ b/consensus_health_checker.py @@ -34,7 +34,6 @@ EMAIL_SUBJECT = 'Consensus issues' CONFIG = stem.util.conf.config_dict('consensus_health', { 'msg': {}, 'suppression': {}, - 'bandwidth_authorities': [], 'known_params': [], 'contact_address': {}, 'contact_via_bcc': [], @@ -539,9 +538,9 @@ def voting_bandwidth_scanners(latest_consensus, consensuses, votes): contains_measured_bandwidth = True break
- if authority in CONFIG['bandwidth_authorities'] and not contains_measured_bandwidth: + if authority.is_bandwidth_authority and not contains_measured_bandwidth: missing_authorities.append(authority) - if authority not in CONFIG['bandwidth_authorities'] and contains_measured_bandwidth: + if not authority.is_bandwidth_authority and contains_measured_bandwidth: extra_authorities.append(authority)
issues = [] @@ -563,7 +562,7 @@ def unmeasured_relays(latest_consensus, consensuses, votes): consensus_fingerprints = set([desc.fingerprint for desc in latest_consensus.routers.values()])
for authority, vote in votes.items(): - if authority in CONFIG['bandwidth_authorities']: + if authority.is_bandwidth_authority: measured, unmeasured = 0, 0
for desc in vote.routers.values(): diff --git a/data/consensus_health.cfg b/data/consensus_health.cfg index c417287..7e30fd0 100644 --- a/data/consensus_health.cfg +++ b/data/consensus_health.cfg @@ -26,14 +26,6 @@ suppression MISSING_AUTHORITIES => 24 # 1 day suppression TOR_OUT_OF_DATE => 24 # 1 day suppression AUTHORITY_UNAVAILABLE => 24 # 1 day
-# directory authorities that run bandwidth scanners - -bandwidth_authorities moria1 -bandwidth_authorities gabelmoo -bandwidth_authorities maatuska -bandwidth_authorities tor26 -bandwidth_authorities longclaw - # recognized tor consensus parameters
known_params bwweightscale
tor-commits@lists.torproject.org