Commit f1d40c6c authored by Damian Johnson's avatar Damian Johnson
Browse files

Differentiate between 'no badexit flag' and 'not in consensus'

Authorities usually flag bad actors by either BadExit or Rejection. As such
when we're out of sync it might be because different authorities chose
different methods. Updating our notice to better differentiate this...

  https://trac.torproject.org/projects/tor/ticket/17441#comment:3
parent 44b3a702
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -662,9 +662,26 @@ def bad_exits_in_sync(latest_consensus, consensuses, votes):

  for fingerprint in disagreed_bad_exits:
    with_flag = set([authority for authority, flagged in bad_exits.items() if fingerprint in flagged])
    without_flag = voting_authorities.difference(with_flag)
    without_flag = []
    not_in_consensus = []

    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, with_flag = ', '.join(with_flag), without_flag = ', '.join(without_flag), to = bad_exits.keys()))
    for authority in voting_authorities.difference(with_flag):
      vote = votes[authority]

      if fingerprint in vote.routers:
        without_flag.append(authority)
      else:
        not_in_consensus.append(authority)

    attr = ['with flag: %s' % ', '.join(with_flag)]

    if without_flag:
      attr.append('without flag: %s' % ', '.join(without_flag))

    if not_in_consensus:
      attr.append('not in consensus: %s' % ', '.join(not_in_consensus))

    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, counts = ', '.join(attr), to = bad_exits.keys()))

  return issues

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ msg MISSING_AUTHORITIES => The following authorities are missing from the consen
msg EXTRA_AUTHORITIES => The following authorities were not expected in the consensus: {authorities}
msg FINGERPRINT_MISMATCH => {authority} had a different fingerprint than we expected (expected: {expected}, actual: {actual})
msg TOR_OUT_OF_DATE =>  The following authorities are an out of date version of tor: {authorities}
msg BADEXIT_OUT_OF_SYNC => Authorities disagree about the BadExit flag for {fingerprint} (with flag: {with_flag}, without flag: {without_flag})
msg BADEXIT_OUT_OF_SYNC => Authorities disagree about the BadExit flag for {fingerprint} ({counts})
msg BANDWIDTH_AUTHORITIES_OUT_OF_SYNC => Bandwidth authorities have a substantially different number of measured entries: {authorities}
msg AUTHORITY_UNAVAILABLE => Unable to retrieve the {fetch_type} from {authority} ({url}): {error}