Tor relay spec flags - #142
Draft
1aeo wants to merge 2 commits into
Draft
Conversation
Per Tor dir-spec Section 3.4.2, Guard flag requires: - Fast flag (prerequisite) - Stable flag (prerequisite) - V2Dir flag (prerequisite) - WFU >= 98% - TK >= 8 days - Bandwidth >= 2 MB/s OR in top 25% The code was only checking WFU, TK, and bandwidth requirements, but NOT the prerequisite flags. This caused the "Eligible Flags" display to show "Guard: 9/9" when the relay met WFU/TK/BW thresholds, but the Guard flag wasn't actually assigned because the relay was missing Fast, Stable, or V2Dir flags. Changes: - collector_fetcher.py: _analyze_flag_eligibility() now checks for Fast, Stable, and V2Dir flags before marking a relay as Guard eligible - consensus_evaluation.py: _format_flag_summary() now includes prereqs_met check when recalculating Guard eligibility - Added comprehensive tests for Guard prerequisite checking Fixes: relay not showing Guard flag despite meeting vote requirements
Analysis of all flags defined in Tor dir-spec (spec.torproject.org): - Valid, Running, Stable, Fast, Guard, Exit, Authority, V2Dir, HSDir - BadExit, MiddleOnly, StaleDesc, Sybil, NoEdConsensus - Detailed requirements for each flag from Section 3.4.2 5 proposals for adding flags to eligibility table: 1. Exit flag - exit policy analysis (ports 80+443) 2. Running flag - IPv4/IPv6 reachability breakdown 3. Valid flag - version check and blacklist status 4. V2Dir flag - directory capability requirements 5. MiddleOnly flag - new security restriction (Tor 0.4.7+) Each proposal includes: - Implementation code following existing patterns - Table row preview matching current format - Priority/effort/value assessment
Contributor
|
Cursor Agent can help with this pull request. Just |
1aeo
force-pushed
the
cursor/relay-guard-flag-issue-9f3c
branch
3 times, most recently
from
January 14, 2026 06:24
504eefb to
56dbb6f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document Tor relay flag specifications and proposals for UI integration.
This PR provides a comprehensive analysis of Tor relay flags from the official spec and outlines 5 detailed proposals for enhancing the relay details page with more flag eligibility information, including code snippets and table previews.