Skip to content

Conversation

tnull
Copy link
Contributor

@tnull tnull commented Jul 24, 2025

Just a quick follow-up to #3891, addressing the outstanding comments there.

We limit the tail latency of our batch forwarding delay.
@tnull tnull requested a review from TheBlueMatt July 24, 2025 10:02
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jul 24, 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.

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.93%. Comparing base (ff279d6) to head (5b583a9).
⚠️ Report is 57 commits behind head on main.

Files with missing lines Patch % Lines
lightning-background-processor/src/lib.rs 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3955      +/-   ##
==========================================
+ Coverage   88.91%   88.93%   +0.01%     
==========================================
  Files         173      174       +1     
  Lines      123393   123874     +481     
  Branches   123393   123874     +481     
==========================================
+ Hits       109717   110162     +445     
- Misses      11216    11253      +37     
+ Partials     2460     2459       -1     
Flag Coverage Δ
fuzzing 22.18% <ø> (-0.14%) ⬇️
tests 88.75% <88.46%> (+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.

#3891 (comment) really seems trivial to address.

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

@tnull tnull force-pushed the 2025-07-batch-fwd-followup branch 4 times, most recently from def4a4d to e6eb5a2 Compare July 28, 2025 07:29
@tnull tnull requested a review from TheBlueMatt July 28, 2025 11:02
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.

Feel free to squash and we can land this IMO


// On startup, we wait a bit before attempting the initial forward, which gives the user some time
// to re-connect peers.
const INIT_FWD_DELAY: Duration = Duration::from_secs(2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were you intending to do something fancier here where we look at peer connection counts compared to channel counts? Certainly don't have to, its not a new thing, but we'd discussed it so wasn't sure if you wanted to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Were you intending to do something fancier here where we look at peer connection counts compared to channel counts? Certainly don't have to, its not a new thing, but we'd discussed it so wasn't sure if you wanted to.

Hmm, I didn't intend to for now, see #3891 (comment)

I think the only reliable thing we could add is to shortcut (i.e., avoid the 2 second delay) if we already have all peers connected. But apart from that, I'm not sure we could lean on much more?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yea, I agree that's probably all we can realistically do. Seems like a nice optimization tho, especially for mobiles with one or two channel(s)/LSP(s).

tnull added 5 commits July 28, 2025 18:54
We previously introduced an additional `loop_exit_check` in background
processor. Since all reviewers seemed to be skeptical about its
usefulness, we drop it again here.
.. as requested on the original PR, we combine the two `sleeper` futures
into a single one.
In addition to randomizing the millisecond cound, we randomize at the
microsecond resolution by drawing from a uniform distribution over the
interval [0; 1000).
On startup, we wait a bit before attempting the initial forward, which
gives the user some time to re-connect peers.
@tnull tnull force-pushed the 2025-07-batch-fwd-followup branch from e6eb5a2 to 5b583a9 Compare July 28, 2025 16:54
@tnull
Copy link
Contributor Author

tnull commented Jul 28, 2025

Feel free to squash and we can land this IMO

Squashed the fixup

@tnull tnull requested a review from TheBlueMatt July 28, 2025 17:09
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.

Trivial, despite the large diff size in constants, landing.

@TheBlueMatt TheBlueMatt merged commit 55d8666 into lightningdevkit:main Jul 29, 2025
31 of 43 checks passed
@tnull tnull moved this to Done in Weekly Goals Jul 30, 2025
@tnull tnull self-assigned this Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants