Skip to content

Conversation

@tnull
Copy link
Contributor

@tnull tnull commented Nov 3, 2025

Previously, we would also prune any pending GetInfo or expired Buy requests before we persist. This could have lead to races where we drop a pending request and even remove the peer when calling persist.

Here, we simply split the pruning logic for the pending_requests and expired JIT channel state, and only prune the latter before persisting. This generally makes sense, as pending_requests isn't currently persisted, so there is no need to prune before repersisting.

Both are however still pruned on peer disconnection.

Thanks @wvanlint for reporting.

Previously, we would also prune any pending `GetInfo` or expired `Buy`
requests before we `persist`. This could have lead to races where we
drop a pending request and even remove the peer when calling `persist`.

Here, we simply split the pruning logic for the `pending_requests` and
expired JIT channel state, and only prune the latter before persisting.
This generally makes sense, as `pending_requests` isn't currently
persisted, so there is no need to prune before repersisting.

Both are however still pruned on peer disconnection.
@tnull tnull added this to the 0.2 milestone Nov 3, 2025
@tnull tnull requested a review from TheBlueMatt November 3, 2025 09:18
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Nov 3, 2025

👋 Thanks for assigning @TheBlueMatt 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.

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.86%. Comparing base (7177cfc) to head (5f8c54a).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4201   +/-   ##
=======================================
  Coverage   88.86%   88.86%           
=======================================
  Files         180      180           
  Lines      137910   137913    +3     
  Branches   137910   137913    +3     
=======================================
+ Hits       122547   122560   +13     
+ Misses      12556    12540   -16     
- Partials     2807     2813    +6     
Flag Coverage Δ
fuzzing 21.43% <0.00%> (-0.01%) ⬇️
tests 88.71% <100.00%> (+<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.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Oops, right, thanks.

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

@TheBlueMatt TheBlueMatt merged commit 3f96d12 into lightningdevkit:main Nov 3, 2025
23 of 25 checks passed
@wvanlint
Copy link
Contributor

wvanlint commented Nov 3, 2025

All our integration tests succeed now with this change on top of 0.2.0-rc1, thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants