Skip to content

refactor(traversal): make neighbors traversal explicitly required#1522

Merged
glevco merged 1 commit intomasterfrom
refactor/traversal-opt-in
Jan 8, 2026
Merged

refactor(traversal): make neighbors traversal explicitly required#1522
glevco merged 1 commit intomasterfrom
refactor/traversal-opt-in

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Dec 18, 2025

Depends on #1519

Motivation

Current behavior for traversals is that it traverses all DAG neighbors, unless they're explicitly skipped. This is open for mistakes that allow traversals through the entire graph when we forget to skip. This PR changes this behavior by requiring explicitly addition of neighbors, too.

Acceptance Criteria

  • Refactor traversals, requiring users to either explicitly add or skip neighbors, otherwise it'll error.
  • Refactor all usages to reflect this new behavior, generally this means:
    • Every bare continue/return was implicitly adding neighbors, so now they're added explicitly.
    • Every end-of-loop must call add_neighbors.
    • Both skip and add methods don't have any arguments.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Dec 18, 2025
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Dec 18, 2025
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch 2 times, most recently from 24dd1ff to 310a37c Compare December 18, 2025 16:10
@glevco glevco force-pushed the refactor/traversal-opt-in branch from 4da0ff7 to bc4eae1 Compare December 18, 2025 16:15
@glevco glevco changed the title refactor(traversal): make neighbors traversal opt-in refactor(traversal): make neighbors traversal explicitly required Dec 18, 2025
@glevco glevco force-pushed the refactor/traversal-opt-in branch from bc4eae1 to a4d7b2a Compare December 18, 2025 16:21
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch from 310a37c to 08e9e9b Compare December 18, 2025 16:39
@glevco glevco force-pushed the refactor/traversal-opt-in branch from a4d7b2a to 08c1585 Compare December 18, 2025 16:56
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch from 08e9e9b to 74f869a Compare December 18, 2025 17:18
Base automatically changed from fix/iter-mempool-runoff to master December 18, 2025 18:00
@glevco glevco force-pushed the refactor/traversal-opt-in branch from 08c1585 to f535fc5 Compare December 18, 2025 19:25
@github-actions
Copy link

github-actions bot commented Dec 18, 2025

🐰 Bencher Report

Branchrefactor/traversal-opt-in
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.68 m
(-2.87%)Baseline: 1.73 m
1.55 m
(92.66%)
2.07 m
(80.94%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 88.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.28%. Comparing base (cafc16b) to head (f34c2de).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
hathor/transaction/storage/traversal.py 80.76% 3 Missing and 2 partials ⚠️
hathor/p2p/sync_v2/streamers.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1522      +/-   ##
==========================================
+ Coverage   86.27%   86.28%   +0.01%     
==========================================
  Files         438      438              
  Lines       33736    33762      +26     
  Branches     5267     5269       +2     
==========================================
+ Hits        29107    29133      +26     
  Misses       3617     3617              
  Partials     1012     1012              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glevco glevco force-pushed the refactor/traversal-opt-in branch 2 times, most recently from 40fe453 to 5c97684 Compare January 6, 2026 19:57
msbrogli
msbrogli previously approved these changes Jan 6, 2026
@glevco glevco force-pushed the refactor/traversal-opt-in branch from 5c97684 to 514bc95 Compare January 6, 2026 23:06
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jan 6, 2026
@glevco glevco force-pushed the refactor/traversal-opt-in branch from 514bc95 to b11e22c Compare January 7, 2026 14:35
jansegre
jansegre previously approved these changes Jan 7, 2026
@glevco glevco force-pushed the refactor/traversal-opt-in branch from b11e22c to af6a43b Compare January 7, 2026 16:13
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Jan 7, 2026
@glevco glevco force-pushed the refactor/traversal-opt-in branch from af6a43b to f4e8b07 Compare January 7, 2026 20:51
@glevco glevco dismissed stale reviews from jansegre and msbrogli via f34c2de January 8, 2026 17:02
@glevco glevco force-pushed the refactor/traversal-opt-in branch from f4e8b07 to f34c2de Compare January 8, 2026 17:02
@github-project-automation github-project-automation bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Jan 8, 2026
@glevco glevco merged commit ab33438 into master Jan 8, 2026
12 checks passed
@glevco glevco deleted the refactor/traversal-opt-in branch January 8, 2026 18:19
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Jan 8, 2026
@jansegre jansegre mentioned this pull request Jan 14, 2026
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Jan 21, 2026
@jansegre jansegre mentioned this pull request Jan 21, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants