Skip to content

Bound sync loops in lightning-transaction-sync#4612

Open
TheBlueMatt wants to merge 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2026-05-esplora-sync-timeout
Open

Bound sync loops in lightning-transaction-sync#4612
TheBlueMatt wants to merge 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2026-05-esplora-sync-timeout

Conversation

@TheBlueMatt
Copy link
Copy Markdown
Collaborator

If we start syncing from an electrum or esplora server and find that the chain moved during our sync, we reset and start fresh. However, if that happens repeatedly, we probably shouldn't just spin forever. Here we give up after ten attempts and just hope we can sync properly later.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 12, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Comment thread lightning-transaction-sync/src/electrum.rs Outdated
Comment thread lightning-transaction-sync/src/esplora.rs
@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

ldk-claude-review-bot commented May 12, 2026

No new issues found. All previously identified problems have been resolved in the current version of the diff:

  1. The compile error (_ vs i in electrum.rs) is fixed.
  2. The fallthrough to the "Finished" log on give-up is fixed — both files now use return Err(TxSyncError::Failed).

The only remaining observation (dead upper bound of 100 when 10 is the effective limit) was already posted in a prior review pass.

@TheBlueMatt TheBlueMatt force-pushed the 2026-05-esplora-sync-timeout branch from 9db7e55 to 44c8162 Compare May 12, 2026 21:40
Comment thread lightning-transaction-sync/src/electrum.rs
@ldk-reviews-bot ldk-reviews-bot requested a review from tankyleo May 12, 2026 21:49
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.43%. Comparing base (44828f7) to head (1c7fcb7).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4612      +/-   ##
==========================================
+ Coverage   86.12%   86.43%   +0.30%     
==========================================
  Files         157      158       +1     
  Lines      108922   109293     +371     
  Branches   108922   109293     +371     
==========================================
+ Hits        93812    94463     +651     
+ Misses      12495    12284     -211     
+ Partials     2615     2546      -69     
Flag Coverage Δ
fuzzing-fake-hashes 5.08% <ø> (?)
fuzzing-real-hashes 22.78% <ø> (?)
tests 86.16% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment thread lightning-transaction-sync/src/electrum.rs Outdated
@TheBlueMatt TheBlueMatt force-pushed the 2026-05-esplora-sync-timeout branch from 44c8162 to bfee825 Compare May 15, 2026 20:19
@TheBlueMatt TheBlueMatt requested review from tankyleo and tnull May 15, 2026 20:19
If we start syncing from an electrum or esplora server and find
that the chain moved during our sync, we reset and start fresh.
However, if that happens repeatedly, we probably shouldn't just
spin forever. Here we give up after ten attempts and just hope we
can sync properly later.
@TheBlueMatt TheBlueMatt force-pushed the 2026-05-esplora-sync-timeout branch from bfee825 to 1c7fcb7 Compare May 15, 2026 20:24
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.

5 participants