common: BOLT update which make channel_type assumed.
What changed, and why it matters
This commit updates Core Lightning to follow a newer version of the BOLT (Basis of Lightning Technology) specification. The change makes the `channel_type` field mandatory during channel opening, but the code already required it in practice. The patch is mostly textual: it updates comments, error messages, and the reference BOLT version. There is no evidence of a security vulnerability being fixed.
No security action required. Treat as a routine specification-compliance update.
Security signals we found
BOLT specification version update
Channel opening protocol compliance change
No functional security fix evident in diff
Evidence from the diff
The commit bumps the pinned BOLT specification version and adjusts comments and conditional checks in openingd/openingd.c, openingd/dualopend.c, and lightningd/opening_control.c to reflect that channel_type is now assumed to be present. The functional behavior—failing channel opening when channel_type is missing—was already implemented. The diff changes wording from optional (‘if it includes’, ‘if option_channel_type was negotiated’) to mandatory (‘MUST set’, ‘MUST fail’), matching the updated BOLT language. No code paths that alter security-critical behavior were introduced.
Changed components
openingd/openingd.copeningd/dualopend.clightningd/opening_control.cMakefile (BOLT reference version)Inspect captured patch +20 / −25
diff --git a/Makefile b/Makefile
index b15fe5c6..eaea6c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
-DEFAULT_BOLTVERSION := 68881992b97f20aca29edf7a4d673b8e6a70379a
+DEFAULT_BOLTVERSION := a678f8452eab8f93e6de802ba4e7e2a4c2be20dc
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)
diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c
index 0d482c24..820bf4ed 100644
--- a/lightningd/opening_control.c
+++ b/lightningd/opening_control.c
@@ -160,8 +160,7 @@ wallet_commit_channel(struct lightningd *ld,
* #### Requirements
*
* Both peers:
- * ...
- * - MUST use that `channel_type` for all commitment transactions.
+ * - MUST use the negotiated `channel_type` for all commitment transactions.
*/
/* i.e. We set it now for the channel permanently. */
if (channel_type_has(type, OPT_STATIC_REMOTEKEY))
diff --git a/openingd/dualopend.c b/openingd/dualopend.c
index 20ae07c6..bf70a318 100644
--- a/openingd/dualopend.c
+++ b/openingd/dualopend.c
@@ -2430,9 +2430,8 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
/* BOLT #2:
* The receiving node MUST fail the channel if:
*...
- * - It supports `channel_type` and `channel_type` was set:
- * - if `type` is not suitable.
- * - if `type` includes `option_zeroconf` and it does not trust the sender to open an unconfirmed channel.
+ * - the `channel_type` is not suitable.
+ * - the `channel_type` includes `option_zeroconf` and it does not trust the sender to open an unconfirmed channel.
*/
if (!open_tlv->channel_type) {
negotiation_failed(state,
@@ -2682,8 +2681,7 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
}
/* BOLT #2:
- * - if `option_channel_type` was negotiated:
- * - MUST set `channel_type` to the `channel_type` from `open_channel`
+ * - MUST set `channel_type` to the `channel_type` from `open_channel`
*/
a_tlv->channel_type = state->channel_type->features;
@@ -3143,8 +3141,7 @@ static void opener_start(struct state *state, u8 *msg)
}
/* BOLT #2:
- * - if `channel_type` is set, and `channel_type` was set in
- * `open_channel`, and they are not equal types:
+ * if `channel_type` does not match the `channel_type` from `open_channel`:
* - MUST fail the channel.
*/
if (!a_tlv->channel_type) {
diff --git a/openingd/openingd.c b/openingd/openingd.c
index cc51e1e6..52e50572 100644
--- a/openingd/openingd.c
+++ b/openingd/openingd.c
@@ -332,7 +332,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags,
= state->upfront_shutdown_script[LOCAL];
/* BOLT #2:
- * - if it includes `channel_type`:
+ * - MUST set `channel_type`:
* - MUST set it to a defined type representing the type it wants.
* - MUST use the smallest bitmap possible to represent the channel
* type.
@@ -410,9 +410,8 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags,
their_mindepth);
/* BOLT #2:
- * - if `option_channel_type` was negotiated but the message doesn't
- * include a `channel_type`:
- * - MAY fail the channel.
+ * - if the message doesn't include a `channel_type`:
+ * - MUST fail the channel.
*/
if (!accept_tlvs->channel_type) {
negotiation_failed(state,
@@ -420,8 +419,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags,
}
/* BOLT #2:
- * - if `channel_type` is set, and `channel_type` was set in
- * `open_channel`, and they are not equal types:
+ * - if `channel_type` does not match the `channel_type` from `open_channel`:
* - MUST fail the channel.
*/
/* Simple case: caller specified, don't allow any variants */
@@ -881,18 +879,20 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
set_remote_upfront_shutdown(state, open_tlvs->upfront_shutdown_script);
/* BOLT #2:
- * The receiving node MUST fail the channel if:
- *...
- * - It supports `channel_type` and `channel_type` was set:
- * - if `type` is not suitable.
- * - if `type` includes `option_zeroconf` and it does not trust the sender to open an unconfirmed channel.
+ * - if the message doesn't include a `channel_type`:
+ * - fail the channel.
*/
- /* option_channel_type is compulsory. */
if (!open_tlvs->channel_type) {
negotiation_failed(state,
"Did not set channel_type in open_channel message");
}
+ /* BOLT #2:
+ * The receiving node MUST fail the channel if:
+ *...
+ * - the `channel_type` is not suitable.
+ * - the `channel_type` includes `option_zeroconf` and it does not trust the sender to open an unconfirmed channel.
+ */
state->channel_type = channel_type_accept(
state, open_tlvs->channel_type, state->our_features);
if (!state->channel_type) {
@@ -1050,7 +1050,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
/* BOLT #2:
* The receiving node MUST fail the channel if:
*...
- * - if `type` includes `option_zeroconf` and it does not trust the
+ * - the `channel_type` includes `option_zeroconf` and it does not trust the
* sender to open an unconfirmed channel.
*/
if (channel_type_has(state->channel_type, OPT_ZEROCONF) &&
@@ -1077,8 +1077,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
accept_tlvs->upfront_shutdown_script
= state->upfront_shutdown_script[LOCAL];
/* BOLT #2:
- * - if `option_channel_type` was negotiated:
- * - MUST set `channel_type` to the `channel_type` from `open_channel`
+ * - MUST set `channel_type` to the `channel_type` from `open_channel`
*/
accept_tlvs->channel_type = state->channel_type->features;
Why this scored 14/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.