BOLTs: update for splicing: commit_sig retranmission.
What changed, and why it matters
This commit updates Core Lightning's implementation of the Lightning protocol 'splicing' feature to match a newer version of the BOLT specifications. It changes how nodes re-send commitment signatures after reconnecting during a splice operation. The code includes an explicit 'FIXME' note indicating the new 'retransmit_flags' field is not yet fully handled, meaning the update is partial and still under review.
Treat as a work-in-progress protocol conformance update rather than a finished security fix. Review the FIXME in dualopend.c to ensure retransmit_flags is properly examined before this code reaches production, as incomplete handling could lead to incorrect commitment signature retransmission during splicing reconnections.
Security signals we found
Protocol state machine change during reconnection
Partial implementation flagged with FIXME for unhandled retransmit_flags
Splicing-related commit signature retransmission logic modified
BOLT specification version bump
Evidence from the diff
The commit bumps the referenced BOLT version and adjusts channel re-establishment logic in channeld and dualopend to align with updated splicing protocol rules. Key changes include: updating the BOLT reference from 34455ffe28b3 to b9a1206eb2d7; changing the commitment number check during peer_reconnect from ‘1 greater than last sent’ to ‘equal to next expected’; and modifying dualopend’s reconnect dance to use a new next_funding TLV and retransmit_flags field. The wire format patch adds retransmit_flags to next_funding and introduces a new my_current_funding_locked TLV. A FIXME comment in dualopend.c explicitly notes that retransmit_flags examination is not yet implemented.
Changed components
channeld/channeld.c peer_reconnect commitment number validationopeningd/dualopend.c do_reconnect_dance splicing reconnection logicwire/extracted_peer_11_splice.patch TLV definitionsMakefile BOLT version referenceInspect captured patch +15 / −20
diff --git a/Makefile b/Makefile
index 8e12c6ae..a511542d 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
-DEFAULT_BOLTVERSION := 34455ffe28b308dd7ac7552234d565890af8605b
+DEFAULT_BOLTVERSION := b9a1206eb2d7fe7c535e3399c212f289e88b2898
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)
diff --git a/channeld/channeld.c b/channeld/channeld.c
index 6fa71580..11d8fdee 100644
--- a/channeld/channeld.c
+++ b/channeld/channeld.c
@@ -6087,9 +6087,9 @@ static void peer_reconnect(struct peer *peer,
/* BOLT #2:
*
* - otherwise:
- * - if `next_commitment_number` is not 1 greater than the
- * commitment number of the last `commitment_signed` message the
- * receiving node has sent:
+ * - if `next_commitment_number` is not equal to the commitment
+ * number of the next `commitment_signed` that the receiving
+ * node would send:
* - SHOULD send an `error` and fail the channel.
*/
} else if (next_commitment_number != peer->next_index[REMOTE])
diff --git a/openingd/dualopend.c b/openingd/dualopend.c
index bf70a318..e7da540d 100644
--- a/openingd/dualopend.c
+++ b/openingd/dualopend.c
@@ -3970,13 +3970,10 @@ static void do_reconnect_dance(struct state *state)
/* BOLT #2:
*
- * - if it has sent `commitment_signed` for an
- * interactive transaction construction but it has
- * not received `tx_signatures`:
- * - MUST set `next_funding_txid` to the txid of that
- * interactive transaction.
- * - otherwise:
- * - MUST NOT set `next_funding_txid`.
+ * - if it has sent `commitment_signed` for an interactive transaction construction but
+ * it has not received `tx_signatures`:
+ * - MUST include the `next_funding` TLV.
+ * - MUST set `next_funding_txid` to the txid of that interactive transaction.
*/
tlvs = tlv_channel_reestablish_tlvs_new(tmpctx);
if (!tx_state->remote_funding_sigs_rcvd) {
@@ -4041,10 +4038,11 @@ static void do_reconnect_dance(struct state *state)
/* BOLT #2:
* A receiving node:
- * - if `next_funding_txid` is set:
+ * - if the `next_funding` TLV is set:
* - if `next_funding_txid` matches the latest interactive funding transaction:
* - if it has not received `tx_signatures` for that funding transaction:
- * - MUST retransmit its `commitment_signed` for that funding transaction.
+ * - if the `commitment_signed` bit is set in `retransmit_flags`:
+ * - MUST retransmit its `commitment_signed` for that funding transaction.
* - if it has already received `commitment_signed` and it should sign first,
* as specified in the [`tx_signatures` requirements](#the-tx_signatures-message):
* - MUST send its `tx_signatures` for that funding transaction.
@@ -4070,6 +4068,7 @@ static void do_reconnect_dance(struct state *state)
if (!tx_state->has_commitments)
send_our_sigs = false;
}
+ /* FIXME: examine retransmit_flags! */
if (send_our_sigs && psbt_side_finalized(tx_state->psbt, state->our_role)) {
msg = psbt_to_tx_sigs_msg(NULL, state, tx_state->psbt);
peer_write(state->pps, take(msg));
diff --git a/wire/extracted_peer_11_splice.patch b/wire/extracted_peer_11_splice.patch
index e4df1e2e..09a76c94 100644
--- a/wire/extracted_peer_11_splice.patch
+++ b/wire/extracted_peer_11_splice.patch
@@ -50,14 +50,10 @@ index f3a42e5537..4b01c56836 100644
msgtype,revoke_and_ack,133
msgdata,revoke_and_ack,channel_id,channel_id,
msgdata,revoke_and_ack,per_commitment_secret,byte,32
-@@ -301,8 +326,12 @@ msgdata,channel_reestablish,next_commitment_number,u64,
- msgdata,channel_reestablish,next_revocation_number,u64,
- msgdata,channel_reestablish,your_last_per_commitment_secret,byte,32
- msgdata,channel_reestablish,my_current_per_commitment_point,point,
--tlvtype,channel_reestablish_tlvs,next_funding,0
-+tlvtype,channel_reestablish_tlvs,next_funding,1
+@@ -301,6 +326,9 @@ msgdata,channel_reestablish,next_commitment_number,u64,
+ tlvtype,channel_reestablish_tlvs,next_funding,1
tlvdata,channel_reestablish_tlvs,next_funding,next_funding_txid,sha256,
-+tlvdata,channel_reestablish_tlvs,next_funding,retransmit_flags,byte,
+ tlvdata,channel_reestablish_tlvs,next_funding,retransmit_flags,byte,
+tlvtype,channel_reestablish_tlvs,my_current_funding_locked,5
+tlvdata,channel_reestablish_tlvs,my_current_funding_locked,my_current_funding_locked_txid,sha256,
+tlvdata,channel_reestablish_tlvs,my_current_funding_locked,retransmit_flags,byte,
Why this scored 27/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.