Skip to content

Correct gossip forwarding criteria while doing background sync - #4107

Merged
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2025-09-fix-forward-while-sync-order
Sep 22, 2025
Merged

Correct gossip forwarding criteria while doing background sync#4107
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2025-09-fix-forward-while-sync-order

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

If we're doing gossip backfill to a peer, we first forward all our channel_announcements and channel_updates in SCID-order. While doing so, we don't forward any fresh channel_update messages for any channels which we haven't yet backfilled (as we'll eventually send the new update anyway, and it might get rejected without the corresponding channel_announcement).

Sadly, our comparison for this was the wrong way, so we actually only forwarded updates which were for channels we haven't yet backfilled, and dropped updates for channels we already had backfilled.

@TheBlueMattTheBlueMatt added this to the 0.1.6 milestone Sep 22, 2025
@ldk-reviews-bot

ldk-reviews-bot commented Sep 22, 2025

Copy link
Copy Markdown

👋 I see @tankyleo was un-assigned.
If you'd like another reviewer assignment, please click here.

If we're doing gossip backfill to a peer, we first forward all our
`channel_announcement`s and `channel_update`s in SCID-order. While
doing so, we don't forward any fresh `channel_update` messages for
any channels which we haven't yet backfilled (as we'll eventually
send the new update anyway, and it might get rejected without the
corresponding `channel_announcement`).
Sadly, our comparison for this was the wrong way, so we actually
*only* forwarded updates which were for channels we haven't yet
backfilled, and dropped updates for channels we already had
backfilled.
@TheBlueMatt
TheBlueMattforce-pushed the 2025-09-fix-forward-while-sync-order branch from c5e935a to edc7903CompareSeptember 22, 2025 18:34
@tnull
tnull removed the request for review from tankyleoSeptember 22, 2025 18:51
@codecov

codecovBot commented Sep 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.70%. Comparing base (0d59d73) to head (edc7903).
⚠️ Report is 13 commits behind head on main.

Files with missing linesPatch %Lines
lightning/src/ln/peer_handler.rs97.72%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #4107 +/- ##
==========================================
+ Coverage 88.69% 88.70% +0.01% 
==========================================
Files 176 176 Lines 132859 132885 +26 Branches 132859 132885 +26 ==========================================
+ Hits 117836 117875 +39 + Misses 12336 12318 -18 - Partials 2687 2692 +5 
FlagCoverage Δ
fuzzing21.55% <0.00%> (ø)
tests88.54% <97.91%> (+0.01%)⬆️

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.

@TheBlueMatt
TheBlueMatt merged commit 6f536ec into lightningdevkit:mainSep 22, 2025
25 checks passed
@TheBlueMattTheBlueMatt mentioned this pull request Oct 6, 2025
@TheBlueMatt

Copy link
Copy Markdown
CollaboratorAuthor

Backported in #4143.

@TheBlueMattTheBlueMatt modified the milestone: 0.1.6Oct 6, 2025
Sign up for freeto 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.

4 participants

@TheBlueMatt@ldk-reviews-bot@tnull@wpaulino