wire/splice: rename messages and TLV fields per updated BOLTs
What changed, and why it matters
This commit is a routine renaming and cleanup of internal Lightning protocol message names and fields to match a newer version of the BOLTs specification. It does not fix a security bug, add a security feature, or change any security-critical behavior. The only functional logic change is a small, clearly described fix to avoid re-sending a 'channel_ready' message during an active splice on reconnection.
No security action required. Treat as a normal upstream compatibility/refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates Core Lightning’s wire protocol definitions to align with a newer BOLT version (311119388a… -> 4b539711d4…). It renames message type WIRE_SPLICE to WIRE_SPLICE_INIT, field relative_satoshis to funding_contribution_satoshis, TLV txsigs_tlvs to tx_signatures_tlvs, and TLV fields splice_info/batch_info to funding_txid/message_type. It also consolidates three CLN-specific shim patches into one. The only non-cosmetic code change is in channeld/channeld.c peer_reconnect(), where a new is_splice_active flag suppresses re-sending channel_ready when a splice is in flight. This is a protocol-correctness improvement, not a vulnerability fix.
Changed components
wire/peer_wire.csvwire/peer_wire.cchanneld/channeld.copeningd/dualopend.ccommon/interactivetx.ctests/fuzz/*Inspect captured patch +143 / −191
diff --git a/Makefile b/Makefile
index 2bdeea1..72c8d77 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
-DEFAULT_BOLTVERSION := 311119388a46dfa859da3d2eda0ca836cfc5f078
+DEFAULT_BOLTVERSION := 4b539711d4726f274482051150bc6612e370b4e2
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)
diff --git a/channeld/channeld.c b/channeld/channeld.c
index 9c7aeae..b2e662f 100644
--- a/channeld/channeld.c
+++ b/channeld/channeld.c
@@ -51,7 +51,7 @@
#define HSM_FD 4
#define VALID_STFU_MESSAGE(msg) \
- ((msg) == WIRE_SPLICE || \
+ ((msg) == WIRE_SPLICE_INIT || \
(msg) == WIRE_SPLICE_ACK || \
(msg) == WIRE_TX_INIT_RBF || \
(msg) == WIRE_TX_ACK_RBF || \
@@ -1220,7 +1220,7 @@ static u8 *send_commit_part(const tal_t *ctx,
(int)splice_amnt, (int)remote_splice_amnt,
remote_index);
- cs_tlv->splice_info = tal_dup(cs_tlv, struct bitcoin_txid, &funding->txid);
+ cs_tlv->funding_txid = tal_dup(cs_tlv, struct bitcoin_txid, &funding->txid);
}
txs = channel_txs(tmpctx, funding, funding_sats, &htlc_map,
@@ -1319,8 +1319,8 @@ static void send_message_batch(struct peer *peer, u8 **msgs)
/* Build the `start_batch` msg now so know it's size */
tlvs = tlv_start_batch_tlvs_new(tmpctx);
- tlvs->batch_info = tal(tlvs, u16);
- *tlvs->batch_info = WIRE_COMMITMENT_SIGNED;
+ tlvs->message_type = tal(tlvs, u16);
+ *tlvs->message_type = WIRE_COMMITMENT_SIGNED;
batch_msg = towire_start_batch(tmpctx, &peer->channel_id,
tal_count(msgs), tlvs);
size += tal_bytelen(batch_msg) + hdr_size;
@@ -2053,7 +2053,7 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
* - If `funding_txid` is missing in one of the `commitment_signed` messages:
* - MUST send an `error` and fail the channel.
*/
- if (!cs_tlv->splice_info)
+ if (!cs_tlv->funding_txid)
peer_failed_err(peer->pps, &peer->channel_id,
"Must send funding_txid when sending"
" a commitment batch.");
@@ -2065,7 +2065,7 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
* - MUST send an `error` and fail the channel.
*/
if (!tal_count(peer->splice_state->inflights)
- && !bitcoin_txid_eq(cs_tlv->splice_info,
+ && !bitcoin_txid_eq(cs_tlv->funding_txid,
&peer->channel->funding.txid))
peer_failed_err(peer->pps, &peer->channel_id,
"Commitment batch is is missing our"
@@ -2077,7 +2077,7 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
* - If `funding_txid` is missing in one of the `commitment_signed` messages:
* - MUST send an `error` and fail the channel.
*/
- if (commit_index && !cs_tlv->splice_info)
+ if (commit_index && !cs_tlv->funding_txid)
peer_failed_err(peer->pps, &peer->channel_id,
"Must send funding_txid when sending"
" a commitment batch");
@@ -2123,14 +2123,14 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
status_debug("handle_peer_commit_sig for inflight outpoint %s",
fmt_bitcoin_txid(tmpctx, &outpoint.txid));
- if (cs_tlv->splice_info
+ if (cs_tlv->funding_txid
&& !bitcoin_txid_eq(&outpoint.txid,
- cs_tlv->splice_info))
+ cs_tlv->funding_txid))
peer_failed_err(peer->pps, &peer->channel_id,
"Expected commit sig message for %s but"
" got %s",
fmt_bitcoin_txid(tmpctx, &outpoint.txid),
- fmt_bitcoin_txid(tmpctx, cs_tlv->splice_info));
+ fmt_bitcoin_txid(tmpctx, cs_tlv->funding_txid));
}
else {
outpoint = peer->channel->funding;
@@ -2174,7 +2174,7 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
peer_failed_warn(peer->pps, &peer->channel_id,
"Bad commit_sig signature %"PRIu64" %s for tx"
" %s wscript %s key %s feerate %u. Outpoint"
- " %s, funding_sats: %s, splice_info: %s,"
+ " %s, funding_sats: %s, funding_txid: %s,"
" inflight splice count: %zu",
local_index,
fmt_bitcoin_signature(msg, &commit_sig),
@@ -2184,9 +2184,9 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
channel_feerate(peer->channel, LOCAL),
fmt_bitcoin_outpoint(tmpctx, &outpoint),
fmt_amount_sat(tmpctx, funding_sats),
- cs_tlv && cs_tlv->splice_info
+ cs_tlv && cs_tlv->funding_txid
? fmt_bitcoin_txid(tmpctx,
- cs_tlv->splice_info)
+ cs_tlv->funding_txid)
: "N/A",
tal_count(peer->splice_state->inflights));
}
@@ -2350,10 +2350,10 @@ static int commit_index_from_msg(const u8 *msg, struct peer *peer)
fromwire_commitment_signed(tmpctx, msg, &channel_id, &commit_sig.s,
&raw_sigs, &cs_tlv);
- if (!cs_tlv || !cs_tlv->splice_info)
+ if (!cs_tlv || !cs_tlv->funding_txid)
return -1;
- funding_txid = *cs_tlv->splice_info;
+ funding_txid = *cs_tlv->funding_txid;
if (bitcoin_txid_eq(&funding_txid, &peer->channel->funding.txid))
return 0;
@@ -2451,11 +2451,11 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
" [%"PRIu16"/%"PRIu16"]",
tal_hex(sub_msg, sub_msg), i, batch_size);
- if (!sub_cs_tlv->splice_info)
+ if (!sub_cs_tlv->funding_txid)
peer_failed_warn(peer->pps, &peer->channel_id,
"commit_sig %s in commit_sig batch:"
" [%"PRIu16"/%"PRIu16"] missing"
- " splice_info",
+ " funding_txid",
tal_hex(sub_msg, sub_msg), i, batch_size);
msg_batch[i] = sub_msg;
@@ -2486,12 +2486,12 @@ static void handle_peer_start_batch(struct peer *peer, const u8 *msg)
peer_failed_warn(peer->pps, &peer->channel_id,
"Bad start_batch %s", tal_hex(msg, msg));
- if (!tlvs || !tlvs->batch_info
- || *tlvs->batch_info != WIRE_COMMITMENT_SIGNED) {
+ if (!tlvs || !tlvs->message_type
+ || *tlvs->message_type != WIRE_COMMITMENT_SIGNED) {
status_unusual("Ignoring Unrecognized start_batch message type"
" %s, expected WIRE_COMMITMENT_SIGNED.",
- tlvs && tlvs->batch_info
- ? peer_wire_name(*tlvs->batch_info)
+ tlvs && tlvs->message_type
+ ? peer_wire_name(*tlvs->message_type)
: "N/A");
return;
}
@@ -2885,7 +2885,7 @@ static void handle_unexpected_tx_sigs(struct peer *peer, const u8 *msg)
struct channel_id cid;
struct bitcoin_txid txid;
- struct tlv_txsigs_tlvs *txsig_tlvs = tlv_txsigs_tlvs_new(tmpctx);
+ struct tlv_tx_signatures_tlvs *txsig_tlvs = tlv_tx_signatures_tlvs_new(tmpctx);
/* In a rare case, a v2 peer may re-send a tx_sigs message.
* This happens when they've/we've exchanged channel_ready,
@@ -3793,7 +3793,7 @@ static void resume_splice_negotiation(struct peer *peer,
struct bitcoin_tx *final_tx;
struct bitcoin_txid final_txid;
u8 **wit_stack;
- struct tlv_txsigs_tlvs *txsig_tlvs, *their_txsigs_tlvs;
+ struct tlv_tx_signatures_tlvs *txsig_tlvs, *their_txsigs_tlvs;
const u8 *msg_received;
struct witness **inws;
struct bitcoin_signature *their_sig;
@@ -3898,7 +3898,7 @@ static void resume_splice_negotiation(struct peer *peer,
fmt_bitcoin_signature(tmpctx, &splice_sig),
fmt_wally_psbt(tmpctx, current_psbt));
- txsig_tlvs = tlv_txsigs_tlvs_new(tmpctx);
+ txsig_tlvs = tlv_tx_signatures_tlvs_new(tmpctx);
txsig_tlvs->shared_input_signature = &splice_sig.s;
/* DTODO: is this finalize call required? */
@@ -3965,7 +3965,7 @@ static void resume_splice_negotiation(struct peer *peer,
" WIRE_TX_SIGNATURES)",
peer_wire_name(type));
- their_txsigs_tlvs = tlv_txsigs_tlvs_new(tmpctx);
+ their_txsigs_tlvs = tlv_tx_signatures_tlvs_new(tmpctx);
if (!fromwire_tx_signatures(tmpctx, msg, &cid,
&inflight->outpoint.txid,
cast_const3(struct witness ***,
@@ -4224,15 +4224,17 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
type = fromwire_peektype(inmsg);
- if (type == WIRE_SPLICE) {
- if (!fromwire_splice(inmsg,
- &channel_id,
- &peer->splicing->opener_relative,
- &funding_feerate_perkw,
- &locktime,
- &peer->splicing->remote_funding_pubkey))
+ if (type == WIRE_SPLICE_INIT) {
+ struct tlv_splice_init_tlvs *splice_init_tlvs;
+ if (!fromwire_splice_init(tmpctx, inmsg,
+ &channel_id,
+ &peer->splicing->opener_relative,
+ &funding_feerate_perkw,
+ &locktime,
+ &peer->splicing->remote_funding_pubkey,
+ &splice_init_tlvs))
peer_failed_warn(peer->pps, &peer->channel_id,
- "Bad wire_splice %s",
+ "Bad wire_splice_init %s",
tal_hex(tmpctx, inmsg));
if (last_inflight(peer)) {
peer_failed_warn(peer->pps, &peer->channel_id,
@@ -4282,11 +4284,12 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
/* TODO: Add plugin hook for user to adjust accepter amount */
peer->splicing->accepter_relative = 0;
- if (type == WIRE_SPLICE) {
+ if (type == WIRE_SPLICE_INIT) {
msg = towire_splice_ack(NULL,
&peer->channel_id,
peer->splicing->accepter_relative,
- &peer->channel->funding_pubkey[LOCAL]);
+ &peer->channel->funding_pubkey[LOCAL],
+ NULL);
} else if (type == WIRE_TX_INIT_RBF) {
ack_rbf_tlvs = tlv_tx_ack_rbf_tlvs_new(tmpctx);
ack_rbf_tlvs->funding_output_contribution = tal(ack_rbf_tlvs, s64);
@@ -4415,10 +4418,12 @@ static void splice_initiator(struct peer *peer, const u8 *inmsg)
type = fromwire_peektype(inmsg);
if (type == WIRE_SPLICE_ACK) {
- if (!fromwire_splice_ack(inmsg,
+ struct tlv_splice_ack_tlvs *splice_ack_tlvs;
+ if (!fromwire_splice_ack(tmpctx, inmsg,
&channel_id,
&peer->splicing->accepter_relative,
- &peer->splicing->remote_funding_pubkey))
+ &peer->splicing->remote_funding_pubkey,
+ &splice_ack_tlvs))
peer_failed_warn(peer->pps, &peer->channel_id,
"Bad wire_splice_ack %s",
tal_hex(tmpctx, inmsg));
@@ -4928,12 +4933,13 @@ static void handle_splice_stfu_success(struct peer *peer)
u8 *msg;
struct tlv_tx_init_rbf_tlvs *init_rbf_tlvs;
if (!last_inflight(peer)) {
- msg = towire_splice(tmpctx,
- &peer->channel_id,
- peer->splicing->opener_relative,
- peer->splicing->feerate_per_kw,
- peer->splicing->current_psbt->fallback_locktime,
- &peer->channel->funding_pubkey[LOCAL]);
+ msg = towire_splice_init(tmpctx,
+ &peer->channel_id,
+ peer->splicing->opener_relative,
+ peer->splicing->feerate_per_kw,
+ peer->splicing->current_psbt->fallback_locktime,
+ &peer->channel->funding_pubkey[LOCAL],
+ NULL);
}
else { /* RBF attempt */
init_rbf_tlvs = tlv_tx_init_rbf_tlvs_new(tmpctx);
@@ -5191,7 +5197,7 @@ static void peer_in(struct peer *peer, const u8 *msg)
case WIRE_STFU:
handle_stfu(peer, msg);
return;
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_TX_INIT_RBF:
splice_accepter(peer, msg);
return;
@@ -5954,6 +5960,17 @@ static void peer_reconnect(struct peer *peer,
"next_funding_txid not recognized.");
}
+ /* "none of those channel_reestablish messages contain
+ * my_current_funding_locked or next_funding for a splice transaction" */
+ bool is_splice_active = local_next_funding
+ || peer->splice_state->locked_ready[LOCAL]
+ || remote_next_funding
+ || (recv_tlvs
+ && recv_tlvs->my_current_funding_locked
+ && !bitcoin_txid_eq(
+ &recv_tlvs->my_current_funding_locked->my_current_funding_locked_txid,
+ &peer->channel->funding.txid));
+
/* BOLT #2:
*
* A node:
@@ -5971,7 +5988,8 @@ static void peer_reconnect(struct peer *peer,
if (peer->channel_ready[LOCAL]
&& peer->next_index[LOCAL] == 1
- && next_commitment_number == 1) {
+ && next_commitment_number == 1
+ && !is_splice_active) {
struct tlv_channel_ready_tlvs *tlvs = tlv_channel_ready_tlvs_new(tmpctx);
tlvs->short_channel_id = &peer->local_alias;
diff --git a/common/gossmap.c b/common/gossmap.c
index 38b57c1..aaa4e12 100644
--- a/common/gossmap.c
+++ b/common/gossmap.c
@@ -1947,7 +1947,7 @@ const void *gossmap_stream_next(const tal_t *ctx,
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
case WIRE_SHUTDOWN:
diff --git a/common/interactivetx.c b/common/interactivetx.c
index 87473ae..317a571 100644
--- a/common/interactivetx.c
+++ b/common/interactivetx.c
@@ -182,7 +182,7 @@ static u8 *read_next_msg(const tal_t *ctx,
case WIRE_STFU:
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
*error = tal_fmt(ctx,
@@ -838,7 +838,7 @@ char *process_interactivetx_updates(const tal_t *ctx,
case WIRE_PONG:
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_STFU:
case WIRE_SPLICE_LOCKED:
diff --git a/connectd/gossip_rcvd_filter.c b/connectd/gossip_rcvd_filter.c
index 5f628c1..5d1232a 100644
--- a/connectd/gossip_rcvd_filter.c
+++ b/connectd/gossip_rcvd_filter.c
@@ -93,7 +93,7 @@ static bool is_msg_gossip_broadcast(const u8 *cursor)
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
break;
diff --git a/connectd/gossip_store.c b/connectd/gossip_store.c
index 3c1808f..a23e603 100644
--- a/connectd/gossip_store.c
+++ b/connectd/gossip_store.c
@@ -101,7 +101,7 @@ static bool public_msg_type(enum peer_wire type)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
return false;
diff --git a/connectd/multiplex.c b/connectd/multiplex.c
index 59e483d..1776d54 100644
--- a/connectd/multiplex.c
+++ b/connectd/multiplex.c
@@ -355,7 +355,7 @@ static bool is_urgent(enum peer_wire type)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
case WIRE_PING:
diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c
index 3815e17..52dfc8b 100644
--- a/gossipd/gossipd.c
+++ b/gossipd/gossipd.c
@@ -261,7 +261,7 @@ static void handle_recv_gossip(struct daemon *daemon, const u8 *outermsg)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
break;
diff --git a/openingd/dualopend.c b/openingd/dualopend.c
index 2253bc3..451a2b1 100644
--- a/openingd/dualopend.c
+++ b/openingd/dualopend.c
@@ -1304,7 +1304,7 @@ static void handle_tx_sigs(struct state *state, const u8 *msg)
const struct witness **witnesses;
struct tx_state *tx_state = state->tx_state;
- struct tlv_txsigs_tlvs *txsig_tlvs = tlv_txsigs_tlvs_new(tmpctx);
+ struct tlv_tx_signatures_tlvs *txsig_tlvs = tlv_tx_signatures_tlvs_new(tmpctx);
if (!fromwire_tx_signatures(tmpctx, msg, &cid, &txid,
cast_const3(
struct witness ***,
@@ -1700,7 +1700,7 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
break;
@@ -2082,7 +2082,7 @@ static bool run_tx_interactive(struct state *state,
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
open_abort(state, "Unexpected wire message %s",
@@ -4282,7 +4282,7 @@ static u8 *handle_peer_in(struct state *state)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
case WIRE_PROTOCOL_BATCH_ELEMENT:
diff --git a/tests/fuzz/fuzz-wire-commitment_signed.c b/tests/fuzz/fuzz-wire-commitment_signed.c
index df9280c..7da2834 100644
--- a/tests/fuzz/fuzz-wire-commitment_signed.c
+++ b/tests/fuzz/fuzz-wire-commitment_signed.c
@@ -40,7 +40,7 @@ static bool equal(struct commitment_signed *x, struct commitment_signed *y)
return false;
assert(x->tlvs && y->tlvs);
- return tal_arr_eq(x->tlvs->splice_info, y->tlvs->splice_info);
+ return tal_arr_eq(x->tlvs->funding_txid, y->tlvs->funding_txid);
}
void run(const u8 *data, size_t size)
diff --git a/tests/fuzz/fuzz-wire-splice.c b/tests/fuzz/fuzz-wire-splice.c
index 35a8d9a..8624633 100644
--- a/tests/fuzz/fuzz-wire-splice.c
+++ b/tests/fuzz/fuzz-wire-splice.c
@@ -5,7 +5,7 @@
struct fuzzsplice {
struct channel_id channel_id;
- s64 relative_satoshis;
+ s64 funding_contribution_satoshis;
u32 funding_feerate_perkw;
u32 locktime;
struct pubkey funding_pubkey;
@@ -13,18 +13,19 @@ struct fuzzsplice {
static void *encode(const tal_t *ctx, const struct fuzzsplice *s)
{
- return towire_splice(ctx, &s->channel_id,
- s->relative_satoshis, s->funding_feerate_perkw,
- s->locktime, &s->funding_pubkey);
+ return towire_splice_init(ctx, &s->channel_id,
+ s->funding_contribution_satoshis, s->funding_feerate_perkw,
+ s->locktime, &s->funding_pubkey, NULL);
}
static struct fuzzsplice *decode(const tal_t *ctx, const void *p)
{
struct fuzzsplice *s = tal(ctx, struct fuzzsplice);
+ struct tlv_splice_init_tlvs *tlvs;
- if (fromwire_splice(p, &s->channel_id,
- &s->relative_satoshis, &s->funding_feerate_perkw,
- &s->locktime, &s->funding_pubkey))
+ if (fromwire_splice_init(s, p, &s->channel_id,
+ &s->funding_contribution_satoshis, &s->funding_feerate_perkw,
+ &s->locktime, &s->funding_pubkey, &tlvs))
return s;
return tal_free(s);
}
@@ -36,5 +37,5 @@ static bool equal(const struct fuzzsplice *x, const struct fuzzsplice *y)
void run(const u8 *data, size_t size)
{
- test_decode_encode(data, size, WIRE_SPLICE, struct fuzzsplice);
+ test_decode_encode(data, size, WIRE_SPLICE_INIT, struct fuzzsplice);
}
diff --git a/tests/fuzz/fuzz-wire-splice_ack.c b/tests/fuzz/fuzz-wire-splice_ack.c
index ed57ee9..8c1805d 100644
--- a/tests/fuzz/fuzz-wire-splice_ack.c
+++ b/tests/fuzz/fuzz-wire-splice_ack.c
@@ -5,22 +5,25 @@
struct splice_ack {
struct channel_id channel_id;
- s64 relative_satoshis;
+ s64 funding_contribution_satoshis;
struct pubkey funding_pubkey;
};
static void *encode(const tal_t *ctx, const struct splice_ack *s)
{
return towire_splice_ack(ctx, &s->channel_id,
- s->relative_satoshis, &s->funding_pubkey);
+ s->funding_contribution_satoshis, &s->funding_pubkey,
+ NULL);
}
static struct splice_ack *decode(const tal_t *ctx, const void *p)
{
struct splice_ack *s = tal(ctx, struct splice_ack);
+ struct tlv_splice_ack_tlvs *tlvs;
- if (fromwire_splice_ack(p, &s->channel_id,
- &s->relative_satoshis, &s->funding_pubkey))
+ if (fromwire_splice_ack(s, p, &s->channel_id,
+ &s->funding_contribution_satoshis, &s->funding_pubkey,
+ &tlvs))
return s;
return tal_free(s);
}
diff --git a/tests/fuzz/fuzz-wire-tx_signatures.c b/tests/fuzz/fuzz-wire-tx_signatures.c
index 2b8e82e..22d57d7 100644
--- a/tests/fuzz/fuzz-wire-tx_signatures.c
+++ b/tests/fuzz/fuzz-wire-tx_signatures.c
@@ -10,7 +10,7 @@ struct tx_signatures {
struct channel_id channel_id;
struct bitcoin_txid txid;
struct witness **witnesses;
- struct tlv_txsigs_tlvs *tlvs;
+ struct tlv_tx_signatures_tlvs *tlvs;
};
static void *encode(const tal_t *ctx, const struct tx_signatures *s)
diff --git a/wire/extracted_peer_06_funding_outpoint_sigs.patch b/wire/extracted_peer_06_funding_outpoint_sigs.patch
deleted file mode 100644
index 3da5b65..0000000
--- a/wire/extracted_peer_06_funding_outpoint_sigs.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- wire/peer_exp_wire.csv 2022-06-22 19:07:24.000000000 -0500
-+++ - 2022-06-30 16:00:51.000000000 -0500
-@@ -65,9 +57,12 @@
- msgdata,tx_signatures,txid,sha256,
- msgdata,tx_signatures,num_witnesses,u16,
- msgdata,tx_signatures,witnesses,witness,num_witnesses
-+msgdata,tx_signatures,tlvs,txsigs_tlvs,
- subtype,witness
- subtypedata,witness,len,u16,
- subtypedata,witness,witness_data,byte,len
-+tlvtype,txsigs_tlvs,shared_input_signature,0
-+tlvdata,txsigs_tlvs,shared_input_signature,signature,signature,
- msgtype,tx_init_rbf,72
- msgdata,tx_init_rbf,channel_id,channel_id,
- msgdata,tx_init_rbf,locktime,u32,
diff --git a/wire/extracted_peer_08_add_input_tlvs.patch b/wire/extracted_peer_08_add_input_tlvs.patch
deleted file mode 100644
index dbda248..0000000
--- a/wire/extracted_peer_08_add_input_tlvs.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git b/wire/peer_wire.csv a/wire/peer_wire.csv
-index 6543e34ee4..c36d90807b 100644
---- b/wire/peer_wire.csv
-+++ a/wire/peer_wire.csv
-@@ -44,6 +44,9 @@ msgdata,tx_add_input,prevtx_len,u16,
- msgdata,tx_add_input,prevtx,byte,prevtx_len
- msgdata,tx_add_input,prevtx_vout,u32,
- msgdata,tx_add_input,sequence,u32,
-+msgdata,tx_add_input,tlvs,tx_add_input_tlvs,
-+tlvtype,tx_add_input_tlvs,shared_input_txid,0
-+tlvdata,tx_add_input_tlvs,shared_input_txid,funding_txid,sha256,
- msgtype,tx_add_output,67
- msgdata,tx_add_output,channel_id,channel_id,
- msgdata,tx_add_output,serial_id,u64,
diff --git a/wire/extracted_peer_11_splice.patch b/wire/extracted_peer_11_splice.patch
deleted file mode 100644
index 09a76c9..0000000
--- a/wire/extracted_peer_11_splice.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-diff --git b/wire/peer_wire.csv a/wire/peer_wire.csv
-index f3a42e5537..4b01c56836 100644
---- b/wire/peer_wire.csv
-+++ a/wire/peer_wire.csv
-@@ -1,3 +1,6 @@
-+msgtype,protocol_batch_element,0
-+msgdata,protocol_batch_element,channel_id,channel_id,
-+msgdata,protocol_batch_element,element_size,u16,
- msgtype,init,16
- msgdata,init,gflen,u16,
- msgdata,init,globalfeatures,byte,gflen
-@@ -217,6 +220,19 @@ subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
- msgtype,stfu,2
- msgdata,stfu,channel_id,channel_id,
- msgdata,stfu,initiator,u8,
-+msgtype,splice,80
-+msgdata,splice,channel_id,channel_id,
-+msgdata,splice,relative_satoshis,s64,
-+msgdata,splice,funding_feerate_perkw,u32,
-+msgdata,splice,locktime,u32,
-+msgdata,splice,funding_pubkey,point,
-+msgtype,splice_ack,81
-+msgdata,splice_ack,channel_id,channel_id,
-+msgdata,splice_ack,relative_satoshis,s64,
-+msgdata,splice_ack,funding_pubkey,point,
-+msgtype,splice_locked,77,
-+msgdata,splice_locked,channel_id,channel_id,
-+msgdata,splice_locked,splice_txid,sha256,
- msgtype,shutdown,38
- msgdata,shutdown,channel_id,channel_id,
- msgdata,shutdown,len,u16,
-@@ -280,11 +296,20 @@ msgdata,update_fail_malformed_htlc,channel_id,channel_id,
- msgdata,update_fail_malformed_htlc,id,u64,
- msgdata,update_fail_malformed_htlc,sha256_of_onion,sha256,
- msgdata,update_fail_malformed_htlc,failure_code,u16,
-+msgtype,start_batch,127
-+msgdata,start_batch,channel_id,channel_id,
-+msgdata,start_batch,batch_size,u16,
-+msgdata,start_batch,batch_info,start_batch_tlvs,
-+tlvtype,start_batch_tlvs,batch_info,1
-+tlvdata,start_batch_tlvs,batch_info,message_type,u16,
- msgtype,commitment_signed,132
- msgdata,commitment_signed,channel_id,channel_id,
- msgdata,commitment_signed,signature,signature,
- msgdata,commitment_signed,num_htlcs,u16,
- msgdata,commitment_signed,htlc_signature,signature,num_htlcs
-+msgdata,commitment_signed,splice_channel_id,commitment_signed_tlvs,
-+tlvtype,commitment_signed_tlvs,splice_info,1
-+tlvdata,commitment_signed_tlvs,splice_info,funding_txid,sha256,
- msgtype,revoke_and_ack,133
- msgdata,revoke_and_ack,channel_id,channel_id,
- msgdata,revoke_and_ack,per_commitment_secret,byte,32
-@@ -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,
-+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,
- msgtype,announcement_signatures,259
- msgdata,announcement_signatures,channel_id,channel_id,
- msgdata,announcement_signatures,short_channel_id,short_channel_id,
diff --git a/wire/extracted_peer_cln_batch_element.patch b/wire/extracted_peer_cln_batch_element.patch
new file mode 100644
index 0000000..375c447
--- /dev/null
+++ b/wire/extracted_peer_cln_batch_element.patch
@@ -0,0 +1,16 @@
+--- wire/peer_wire.csv
++++ wire/peer_wire.csv
+@@ -1,3 +1,6 @@
++msgtype,protocol_batch_element,0
++msgdata,protocol_batch_element,channel_id,channel_id,
++msgdata,protocol_batch_element,element_size,u16,
+ msgtype,init,16
+ msgdata,init,gflen,u16,
+ msgdata,init,globalfeatures,byte,gflen
+@@ -300,6 +303,7 @@
+ msgtype,start_batch,127
+ msgdata,start_batch,channel_id,channel_id,
+ msgdata,start_batch,batch_size,u16,
++msgdata,start_batch,tlvs,start_batch_tlvs,
+ tlvtype,start_batch_tlvs,message_type,1
+ tlvdata,start_batch_tlvs,message_type,message_type,u16,
diff --git a/wire/peer_wire.c b/wire/peer_wire.c
index 3200fe7..2357073 100644
--- a/wire/peer_wire.c
+++ b/wire/peer_wire.c
@@ -54,7 +54,7 @@ static bool unknown_type(enum peer_wire t)
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
return false;
@@ -115,7 +115,7 @@ bool is_msg_for_gossipd(const u8 *cursor)
case WIRE_PEER_STORAGE:
case WIRE_PEER_STORAGE_RETRIEVAL:
case WIRE_STFU:
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
break;
@@ -396,29 +396,30 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id)
* 2. data:
* * [`channel_id`:`channel_id`]
*/
- case WIRE_SPLICE:
+ case WIRE_SPLICE_INIT:
/* BOLT-splice #2:
- * 1. type: 74 (`splice`)
+ * 1. type: 80 (`splice_init`)
* 2. data:
- * * [`chain_hash`:`chain_hash`]
* * [`channel_id`:`channel_id`]
+ * * [`s64`:`funding_contribution_satoshis`]
* * [`u32`:`funding_feerate_perkw`]
+ * * [`u32`:`locktime`]
* * [`point`:`funding_pubkey`]
*/
case WIRE_SPLICE_ACK:
/* BOLT-splice #2:
- * 1. type: 76 (`splice_ack`)
+ * 1. type: 81 (`splice_ack`)
* 2. data:
- * * [`chain_hash`:`chain_hash`]
* * [`channel_id`:`channel_id`]
+ * * [`s64`:`funding_contribution_satoshis`]
* * [`point`:`funding_pubkey`]
*/
case WIRE_SPLICE_LOCKED:
/* BOLT-splice #2:
- * 1. type: 78 (`splice_locked`)
+ * 1. type: 77 (`splice_locked`)
* 2. data:
- * * [`chain_hash`:`chain_hash`]
* * [`channel_id`:`channel_id`]
+ * * [`sha256`:`splice_txid`]
*/
return fromwire_channel_id(&cursor, &max, channel_id);
}
diff --git a/wire/peer_wire.csv b/wire/peer_wire.csv
index 1dad37d..8b3cf9f 100644
--- a/wire/peer_wire.csv
+++ b/wire/peer_wire.csv
@@ -75,12 +75,12 @@ msgdata,tx_signatures,channel_id,channel_id,
msgdata,tx_signatures,txid,sha256,
msgdata,tx_signatures,num_witnesses,u16,
msgdata,tx_signatures,witnesses,witness,num_witnesses
-msgdata,tx_signatures,tlvs,txsigs_tlvs,
+msgdata,tx_signatures,tlvs,tx_signatures_tlvs,
subtype,witness
subtypedata,witness,len,u16,
subtypedata,witness,witness_data,byte,len
-tlvtype,txsigs_tlvs,shared_input_signature,0
-tlvdata,txsigs_tlvs,shared_input_signature,signature,signature,
+tlvtype,tx_signatures_tlvs,shared_input_signature,0
+tlvdata,tx_signatures_tlvs,shared_input_signature,signature,signature,
msgtype,tx_init_rbf,72
msgdata,tx_init_rbf,channel_id,channel_id,
msgdata,tx_init_rbf,locktime,u32,
@@ -220,17 +220,21 @@ subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
msgtype,stfu,2
msgdata,stfu,channel_id,channel_id,
msgdata,stfu,initiator,u8,
-msgtype,splice,80
-msgdata,splice,channel_id,channel_id,
-msgdata,splice,relative_satoshis,s64,
-msgdata,splice,funding_feerate_perkw,u32,
-msgdata,splice,locktime,u32,
-msgdata,splice,funding_pubkey,point,
+msgtype,splice_init,80
+msgdata,splice_init,channel_id,channel_id,
+msgdata,splice_init,funding_contribution_satoshis,s64,
+msgdata,splice_init,funding_feerate_perkw,u32,
+msgdata,splice_init,locktime,u32,
+msgdata,splice_init,funding_pubkey,point,
+msgdata,splice_init,tlvs,splice_init_tlvs,
+tlvtype,splice_init_tlvs,require_confirmed_inputs,2
msgtype,splice_ack,81
msgdata,splice_ack,channel_id,channel_id,
-msgdata,splice_ack,relative_satoshis,s64,
+msgdata,splice_ack,funding_contribution_satoshis,s64,
msgdata,splice_ack,funding_pubkey,point,
-msgtype,splice_locked,77,
+msgdata,splice_ack,tlvs,splice_ack_tlvs,
+tlvtype,splice_ack_tlvs,require_confirmed_inputs,2
+msgtype,splice_locked,77
msgdata,splice_locked,channel_id,channel_id,
msgdata,splice_locked,splice_txid,sha256,
msgtype,shutdown,38
@@ -299,17 +303,17 @@ msgdata,update_fail_malformed_htlc,failure_code,u16,
msgtype,start_batch,127
msgdata,start_batch,channel_id,channel_id,
msgdata,start_batch,batch_size,u16,
-msgdata,start_batch,batch_info,start_batch_tlvs,
-tlvtype,start_batch_tlvs,batch_info,1
-tlvdata,start_batch_tlvs,batch_info,message_type,u16,
+msgdata,start_batch,tlvs,start_batch_tlvs,
+tlvtype,start_batch_tlvs,message_type,1
+tlvdata,start_batch_tlvs,message_type,message_type,u16,
msgtype,commitment_signed,132
msgdata,commitment_signed,channel_id,channel_id,
msgdata,commitment_signed,signature,signature,
msgdata,commitment_signed,num_htlcs,u16,
msgdata,commitment_signed,htlc_signature,signature,num_htlcs
-msgdata,commitment_signed,splice_channel_id,commitment_signed_tlvs,
-tlvtype,commitment_signed_tlvs,splice_info,1
-tlvdata,commitment_signed_tlvs,splice_info,funding_txid,sha256,
+msgdata,commitment_signed,tlvs,commitment_signed_tlvs,
+tlvtype,commitment_signed_tlvs,funding_txid,1
+tlvdata,commitment_signed_tlvs,funding_txid,funding_txid,sha256,
msgtype,revoke_and_ack,133
msgdata,revoke_and_ack,channel_id,channel_id,
msgdata,revoke_and_ack,per_commitment_secret,byte,32
diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c
index cc68864..dada139 100644
--- a/wire/test/run-peer-wire.c
+++ b/wire/test/run-peer-wire.c
@@ -805,7 +805,7 @@ static bool commitment_signed_eq(const struct msg_commitment_signed *a,
{
return eq_upto(a, b, htlc_signature)
&& eq_var(a, b, htlc_signature)
- && eq_tlv(a, b, splice_info, bitcoin_txid_eq);
+ && eq_tlv(a, b, funding_txid, bitcoin_txid_eq);
}
static bool funding_signed_eq(const struct msg_funding_signed *a,
@@ -1027,8 +1027,8 @@ int main(int argc, char *argv[])
cs.htlc_signature = tal_arr(ctx, secp256k1_ecdsa_signature, 2);
memset(cs.htlc_signature, 2, sizeof(secp256k1_ecdsa_signature)*2);
cs.tlvs = tlv_commitment_signed_tlvs_new(tmpctx);
- cs.tlvs->splice_info = tal(ctx, struct bitcoin_txid);
- set_bitcoin_txid(cs.tlvs->splice_info);
+ cs.tlvs->funding_txid = tal(ctx, struct bitcoin_txid);
+ set_bitcoin_txid(cs.tlvs->funding_txid);
msg = towire_struct_commitment_signed(ctx, &cs);
cs2 = fromwire_struct_commitment_signed(ctx, msg);
Why this scored 15/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.