Skip to content

fix(sync): do not count voided blocks towards repeated blocks limit#1520

Merged
jansegre merged 1 commit intomasterfrom
fix/prevent-repeated-blocks-sync-lock
Dec 18, 2025
Merged

fix(sync): do not count voided blocks towards repeated blocks limit#1520
jansegre merged 1 commit intomasterfrom
fix/prevent-repeated-blocks-sync-lock

Conversation

@jansegre
Copy link
Member

Motivation

Sync could dead-lock in rare case.

Acceptance Criteria

  • Do not count voided blocks towards repeated blocks limit
  • Test that checks that a re-orgs that would otherwise reach that limit will now succeed

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 17, 2025 01:18
@jansegre jansegre self-assigned this Dec 17, 2025
@jansegre jansegre moved this from Todo to In Progress (Done) in Hathor Network Dec 17, 2025
glevco
glevco previously approved these changes Dec 17, 2025
@glevco glevco moved this from In Progress (Done) to In Review (Done) in Hathor Network Dec 17, 2025
@glevco glevco moved this from In Review (Done) to In Review (WIP) in Hathor Network Dec 17, 2025
msbrogli
msbrogli previously approved these changes Dec 17, 2025
return
assert self.tx_storage.indexes is not None
# XXX: check whether the block is part of the best chain
if self.tx_storage.indexes.height.get(blk.get_height()) == blk.hash:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another implementation would be to load the block and check whether it is voided or not. Not sure which one is best.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to check the voided_by metadata.

@jansegre jansegre dismissed stale reviews from msbrogli and glevco via b700c99 December 17, 2025 15:42
@jansegre jansegre force-pushed the fix/prevent-repeated-blocks-sync-lock branch 2 times, most recently from b700c99 to 461dac2 Compare December 18, 2025 04:07
@github-actions
Copy link

github-actions bot commented Dec 18, 2025

🐰 Bencher Report

Branchfix/prevent-repeated-blocks-sync-lock
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.69 m
(-2.41%)Baseline: 1.73 m
1.56 m
(92.22%)
2.08 m
(81.32%)
🐰 View full continuous benchmarking report in Bencher

@jansegre jansegre force-pushed the fix/prevent-repeated-blocks-sync-lock branch 2 times, most recently from 6c434e9 to fc9ca48 Compare December 18, 2025 16:24
@jansegre jansegre requested review from glevco and msbrogli December 18, 2025 16:39
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1520      +/-   ##
==========================================
- Coverage   86.25%   86.24%   -0.01%     
==========================================
  Files         437      437              
  Lines       33725    33726       +1     
  Branches     5265     5266       +1     
==========================================
- Hits        29089    29088       -1     
- Misses       3624     3625       +1     
- Partials     1012     1013       +1     

☔ 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.

@jansegre jansegre moved this from In Review (WIP) to In Review (Done) in Hathor Network Dec 18, 2025
@jansegre jansegre force-pushed the fix/prevent-repeated-blocks-sync-lock branch from fc9ca48 to 2497e29 Compare December 18, 2025 18:08
@jansegre jansegre merged commit e3bba0d into master Dec 18, 2025
3 of 7 checks passed
@jansegre jansegre deleted the fix/prevent-repeated-blocks-sync-lock branch December 18, 2025 18:08
@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 added a commit that referenced this pull request Dec 20, 2025
@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