Skip to content

Fix candidate tier-1 transit detection to stop at failing candidates#12

Merged
digizeph merged 1 commit intomainfrom
dev/fix-candidate-tier1-transit
Mar 26, 2026
Merged

Fix candidate tier-1 transit detection to stop at failing candidates#12
digizeph merged 1 commit intomainfrom
dev/fix-candidate-tier1-transit

Conversation

@digizeph
Copy link
Copy Markdown
Member

@digizeph digizeph commented Mar 26, 2026

Summary

  • When a candidate tier-1 (HE/6939, Zayo/6461) is encountered and its next hop is not a true tier-1, the search now stops entirely instead of continuing down the path
  • Removes TIER1/TIER1_V4/TIER1_V6 combined constants and the separate global as2rel pass; global results are now derived by combining v4 and v6 maps

Bug

For a path like 13335 → 6939 → 3741 → 3491 (origin → collector), the old algorithm would skip 6939 (failing candidate) and continue to find 3491 (true tier-1), then mark 13335→6939, 6939→3741, 3741→3491 as customer→provider relationships. This incorrectly classified 13335 as a customer of 6939.

The fix returns None immediately when a candidate is found without a true tier-1 next hop, preventing any relationships from being recorded for that path.

Test plan

  • test_find_transit_point_candidate_blocks_further_search — directly covers the bug scenario
  • test_he_not_candidate_in_v4 — confirms 6939 is not a candidate in IPv4 paths
  • test_candidate_blocks_when_next_is_candidate_not_true — candidate adjacent to another candidate (not true tier-1) stops search
  • All 11 existing tests pass

When a candidate tier-1 (HE/6939, Zayo/6461) is encountered and its next
hop is not a true tier-1, stop the search entirely instead of continuing
down the path. Previously, the algorithm would skip the failing candidate
and find a true tier-1 further along, incorrectly marking all intermediate
ASes (including the origin) as customers.

Also removes the TIER1/TIER1_V4/TIER1_V6 combined constants and the
separate global as2rel pass. Global results are now derived by combining
v4 and v6 maps, ensuring consistent behavior across all outputs.
@digizeph digizeph merged commit 2f8a440 into main Mar 26, 2026
1 check passed
@digizeph digizeph deleted the dev/fix-candidate-tier1-transit branch March 26, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant