splice: Add details to log message
What changed, and why it matters
This change only improves an error message shown when a splicing (channel funding update) negotiation fails because the remote peer did not send enough signatures. It adds a count of how many remote inputs need signatures and how many signature bundles were actually received. There is no code behavior change that fixes or introduces a vulnerability; it is purely a diagnostic/logging improvement.
No security action required. Treat as a normal logging/diagnostics improvement during review or deployment.
Security signals we found
No security fix or behavior change present in diff
Change is limited to error-message string formatting and a counting loop
Existing failure path (peer_failed_warn) is preserved; only diagnostics added
Evidence from the diff
The commit modifies resume_splice_negotiation() in channeld/channeld.c. It introduces a new local counter, remote_inputs_needing_sigs, computed by iterating over PSBT inputs and skipping inputs owned by the local role and the splice funding input. When the witness bundle index j reaches tal_count(inws) before all required remote inputs are satisfied, the existing peer_failed_warn() call is updated to include remote_inputs_needing_sigs and tal_count(inws) in the message. No signature validation, authorization, or state-machine logic is altered.
Changed components
channeld/channeld.cresume_splice_negotiation()splicing error reportingInspect captured patch +31 / −2
diff --git a/channeld/channeld.c b/channeld/channeld.c
index 21bfcd2..f00b2b1 100644
--- a/channeld/channeld.c
+++ b/channeld/channeld.c
@@ -3512,6 +3512,7 @@ static void resume_splice_negotiation(struct peer *peer,
const u8 *msg_received;
struct witness **inws;
struct bitcoin_signature *their_sig;
+ size_t remote_inputs_needing_sigs;
if (peer->splicing) {
inws = peer->splicing->inws;
@@ -3755,6 +3756,28 @@ static void resume_splice_negotiation(struct peer *peer,
" received",
tal_count(inws) - current_psbt->num_inputs);
+ remote_inputs_needing_sigs = 0;
+ for (size_t i = 0; i < current_psbt->num_inputs; i++) {
+ struct wally_psbt_input *in =
+ ¤t_psbt->inputs[i];
+ u64 in_serial;
+
+ if (!psbt_get_serial_id(&in->unknowns, &in_serial)) {
+ status_broken("PSBT input %zu missing serial_id"
+ " %s", i,
+ fmt_wally_psbt(tmpctx,
+ current_psbt));
+ return;
+ }
+ if (in_serial % 2 == our_role)
+ continue;
+
+ if (i == splice_funding_index)
+ continue;
+
+ remote_inputs_needing_sigs++;
+ }
+
/* We put the PSBT + sigs all together */
for (size_t j = 0, i = 0; i < current_psbt->num_inputs; i++) {
struct wally_psbt_input *in =
@@ -3774,12 +3797,18 @@ static void resume_splice_negotiation(struct peer *peer,
if (i == splice_funding_index)
continue;
- if (j == tal_count(inws))
+ if (j == tal_count(inws)) {
peer_failed_warn(peer->pps,
&peer->channel_id,
"Mismatch witness stack count."
" Most likely you are missing"
- " signatures.");
+ " signatures. We have %zu"
+ " remote inputs needing sigs"
+ " and you sent %zu witness"
+ " bundles.",
+ remote_inputs_needing_sigs,
+ tal_count(inws));
+ }
psbt_finalize_input(current_psbt, in,
inws[j++]);
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.