Skip to content

fix(indexes): iterating all mempool transactions could visit every block#1519

Merged
jansegre merged 1 commit intomasterfrom
fix/iter-mempool-runoff
Dec 18, 2025
Merged

fix(indexes): iterating all mempool transactions could visit every block#1519
jansegre merged 1 commit intomasterfrom
fix/iter-mempool-runoff

Conversation

@jansegre
Copy link
Member

@jansegre jansegre commented Dec 16, 2025

Motivation

Issue with 100% CPU use in specific cases.

Acceptance Criteria

  • Skip blocks' neighbors when iterating all transactions in mempool
  • Refactor generate_tx_parents so it avoids calling mempool_tips.iter_all altogether
  • Add test that checks for the correct visiting during iteration

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

@jansegre jansegre requested review from glevco and msbrogli December 16, 2025 23:32
@jansegre jansegre self-assigned this Dec 16, 2025
@jansegre jansegre moved this from Todo to In Progress (Done) in Hathor Network Dec 16, 2025
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

🐰 Bencher Report

Branchfix/iter-mempool-runoff
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.77%)Baseline: 1.73 m
1.55 m
(92.56%)
2.07 m
(81.03%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.26%. Comparing base (e73f2a5) to head (74f869a).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1519      +/-   ##
==========================================
+ Coverage   86.25%   86.26%   +0.01%     
==========================================
  Files         437      437              
  Lines       33725    33731       +6     
  Branches     5265     5268       +3     
==========================================
+ Hits        29089    29098       +9     
+ Misses       3624     3621       -3     
  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 previously approved these changes Dec 17, 2025
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Dec 17, 2025
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch 3 times, most recently from 8ff9423 to 5bc5cab Compare December 17, 2025 20:59
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch 3 times, most recently from 310a37c to 08e9e9b Compare December 18, 2025 16:39
@jansegre jansegre requested a review from glevco December 18, 2025 16:39
@jansegre jansegre force-pushed the fix/iter-mempool-runoff branch from 08e9e9b to 74f869a Compare December 18, 2025 17:18
@jansegre jansegre moved this from In Review (WIP) to In Review (Done) in Hathor Network Dec 18, 2025
@jansegre jansegre merged commit 6a124f4 into master Dec 18, 2025
6 of 8 checks passed
@jansegre jansegre deleted the fix/iter-mempool-runoff branch December 18, 2025 18:00
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Dec 18, 2025
@jansegre jansegre mentioned this pull request Dec 18, 2025
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Dec 18, 2025
@jansegre jansegre mentioned this pull request Dec 18, 2025
2 tasks
@jansegre jansegre mentioned this pull request Jan 14, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants