Skip to content

Conversation

@wpaulino
Copy link
Contributor

No description provided.

@wpaulino wpaulino added this to the 0.2 milestone Nov 11, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Nov 11, 2025

👋 Thanks for assigning @jkczyz 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 11, 2025

Codecov Report

❌ Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.32%. Comparing base (e42e74e) to head (1e78628).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 44.44% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4219      +/-   ##
==========================================
- Coverage   89.33%   89.32%   -0.01%     
==========================================
  Files         180      180              
  Lines      138055   138166     +111     
  Branches   138055   138166     +111     
==========================================
+ Hits       123326   123420      +94     
- Misses      12122    12140      +18     
+ Partials     2607     2606       -1     
Flag Coverage Δ
fuzzing 35.82% <18.51%> (+2.24%) ⬆️
tests 88.70% <44.44%> (-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 on lines +13102 to +13090
match self.send_stfu(logger) {
Ok(stfu) => Ok(Some(stfu)),
Err(e) => {
log_debug!(logger, "{e}");
Ok(None)
},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have send_stfu return an Option instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's nice to have the error context come from the method itself IMO

Comment on lines 6202 to 6205
if !is_splice {
self.assert_no_commitment_advancement(holder_commitment_transaction_number, "initial commitment_signed");
self.channel_state = ChannelState::FundingNegotiated(FundingNegotiatedFlags::new());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This method might still be useful for DRYing up async signing. Alternatively, could keep it but move these lines to Channel::funding_tx_constructed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should just be a matter of setting a signer_pending_* var to true and maybe a log statement

TheBlueMatt
TheBlueMatt previously approved these changes Nov 11, 2025
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.

All LGTM, thanks! I know its annoying, but one thing worth doing would be to have a splice in the full_stack_target seeds. That will let us catch things that require only small modifications to existing messages (eg overfows in splicing fees/amount logic).

match self.send_stfu(logger) {
Ok(stfu) => Ok(Some(stfu)),
Err(e) => {
log_debug!(logger, "{e}");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would context be helpful?

Suggested change
log_debug!(logger, "{e}");
log_debug!(logger, "Quiescence pending, waiting to send stfu: {e}");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a Attempting to initiate quiescence log at the top of the method that should provide enough context

Copy link
Collaborator

Choose a reason for hiding this comment

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

There may well be other things going on in the node that cause the logs to appear separately, I don't think two logs in a row is a good excuse to avoid context that won't be distracting.

When we propose quiescence due to a user initiated action, such as a
splice, it's possible that the `stfu` message is not ready to be sent
out yet due to the state machine pending a change. This would result in
an error communicated back to the caller of
`ChannelManager::splice_channel`, but this is unnecessary and confusing,
the splice is still pending and will be carried out once quiescence is
eventually negotiated.
We incorrectly assumed that both commitments must be at the same height,
but this is certainly possible whenever updates are proposed in both
directions at the same time.
This method was originally intended to DRY the logic between
`FundedChannel` and `PendingChannelV2` when handling
`funding_tx_constructed`, though it's not very useful anymore.
Splicing should also have fuzz coverage, and it depends on the
quiescence protocol.
@wpaulino
Copy link
Contributor Author

I know its annoying, but one thing worth doing would be to have a splice in the full_stack_target seeds.

I'll have a follow-up for this, will need to familiarize myself with the setup here.

I just pushed coverage for splice-out as well.

.map(|chan| chan.outbound_capacity_msat)
.unwrap();
if outbound_capacity_msat >= 20_000_000 {
let contribution = SpliceContribution::SpliceOut {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice to DRY these up somewhat.

match self.send_stfu(logger) {
Ok(stfu) => Ok(Some(stfu)),
Err(e) => {
log_debug!(logger, "{e}");
Copy link
Collaborator

Choose a reason for hiding this comment

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

There may well be other things going on in the node that cause the logs to appear separately, I don't think two logs in a row is a good excuse to avoid context that won't be distracting.

@TheBlueMatt TheBlueMatt merged commit ec0b969 into lightningdevkit:main Nov 12, 2025
26 checks passed
@TheBlueMatt TheBlueMatt mentioned this pull request Nov 12, 2025
@TheBlueMatt
Copy link
Collaborator

Backported in #4221

@wpaulino wpaulino deleted the fuzz-splicing branch November 12, 2025 19:22
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.

4 participants