Skip to content

Conversation

TheBlueMatt
Copy link
Collaborator

It appears we just forgot to add these when we added the sync
wrapper.

It appears we just forgot to add these when we added the sync
wrapper.
`OutputSweeper`, like any `Confirm`/`Listen` client, needs to have
the chain synced back up on startup. Thus, like `ChannelMonitor`
and `ChannelManager`, we force users to `read` it via a method that
gives them the latest chain tip so that they can sync.
@TheBlueMatt TheBlueMatt added this to the 0.2 milestone Sep 27, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 27, 2025

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

Copy link

codecov bot commented Sep 27, 2025

Codecov Report

❌ Patch coverage is 22.58065% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.61%. Comparing base (19a9dbd) to head (61aba25).

Files with missing lines Patch % Lines
lightning/src/util/sweep.rs 22.58% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4131      +/-   ##
==========================================
- Coverage   88.63%   88.61%   -0.02%     
==========================================
  Files         180      180              
  Lines      134878   134869       -9     
  Branches   134878   134869       -9     
==========================================
- Hits       119543   119520      -23     
- Misses      12567    12581      +14     
  Partials     2768     2768              
Flag Coverage Δ
fuzzing 21.76% <0.00%> (+<0.01%) ⬆️
tests 88.46% <22.58%> (-0.02%) ⬇️

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.

@tnull tnull requested review from tnull and removed request for valentinewallace September 28, 2025 07:50
}

impl<B: Deref, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
ReadableArgs<(B, E, Option<F>, O, D, K, L)> for OutputSweeper<B, D, E, F, K, L, O>
Copy link
Contributor

@tnull tnull Sep 28, 2025

Choose a reason for hiding this comment

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

Huh, no, why are we removing this? How do we read an OutputSweeper only then?

For Confirm we don't need to handle the best block as we're not walking the chain anyways.

Copy link
Contributor

@tnull tnull Sep 28, 2025

Choose a reason for hiding this comment

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

Also note that for example in LDK Node we can't currently deal with the best block at time of initialization anyways, so we'll just call OutputSweeper::current_best_block when we're ready to start syncing. IMO, this API change doesn't 'force' anybody, it makes it just weirder/harder to use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Huh, no, why are we removing this? How do we read an OutputSweeper only then?

Its not that much effort to read a pair and then just take the second element.

Also note that for example in LDK Node we can't currently deal with the best block at time of initialization anyways, so we'll just call OutputSweeper::current_best_block when we're ready to start syncing. IMO, this API change doesn't 'force' anybody, it makes it just weirder/harder to use.

Define "ready to start syncing"? Like other LDK structs, ISTM OutputSweeper syncing should happen prior to normal operation. I'm a bit confused why this API is fine for ChannelMonitor/ChannelManager and not fine for OutputSweeper - they have largely the same restrictions/init process.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

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.

3 participants