diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dac258bf2bd9..efc471a70027 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,10 @@ > [!IMPORTANT] > -> 26.06 FREEZE April 30th: Non-bugfix PRs not ready by this date will wait for 26.09. +> 26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12. > -> RC1 is scheduled on _May 14th_ +> RC1 is scheduled on _August 17th_ > -> The final release is scheduled for June 1st. +> The final release is scheduled for September 7th. ## Checklist diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 87ad7e29b3ad..5d5419cf3e56 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -345,7 +345,7 @@ jobs: env: PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig run: | - ./configure --disable-rust --enable-debugbuild CC="gcc -m32" + ./configure --disable-rust --enable-debugbuild CC="gcc -m32" uv run make -j $(nproc) all-programs check-fuzz: @@ -445,8 +445,8 @@ jobs: run: | mkdir old-cln cd old-cln - wget https://github.com/ElementsProject/lightning/releases/download/v26.04/clightning-v26.04-ubuntu-24.04-amd64.tar.xz - tar -xaf clightning-v26.04-ubuntu-24.04-amd64.tar.xz + wget https://github.com/ElementsProject/lightning/releases/download/v26.06/clightning-v26.06-ubuntu-24.04-amd64.tar.xz + tar -xaf clightning-v26.06-ubuntu-24.04-amd64.tar.xz - name: Switch network if: ${{ matrix.TEST_NETWORK == 'liquid-regtest' }} @@ -768,7 +768,7 @@ jobs: - name: Test env: - PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42 + PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42 run: | sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}" - name: Upload test results diff --git a/Makefile b/Makefile index 9f874ea3aa2c..72c8d7757647 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ VERSION ?= $(shell git describe --tags --always --dirty=-modded --abbrev=7 2>/de $(info Building version $(VERSION)) # Next release. -CLN_NEXT_VERSION := v26.06 +CLN_NEXT_VERSION := v26.09 # Previous release (for downgrade testing) -CLN_PREV_VERSION := v26.04 +CLN_PREV_VERSION := v26.06 # --quiet / -s means quiet, dammit! ifeq ($(findstring s,$(word 1, $(MAKEFLAGS))),s) @@ -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 ed4cc6e8a733..b2e662fdb53f 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,19 +5960,36 @@ 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: * - * - if `next_commitment_number` is 1 in both the - * `channel_reestablish` it sent and received: - * - MUST retransmit `channel_ready`. - * - otherwise: - * - MUST NOT retransmit `channel_ready`, but MAY send - * `channel_ready` with a different `short_channel_id` - * `alias` field. + * A node: + * - if `next_commitment_number` is zero: + * - MUST immediately fail the channel and broadcast any relevant latest commitment + * transaction. + * - if `next_commitment_number` is 1 in both the `channel_reestablish` it + * sent and received, and none of those `channel_reestablish` messages + * contain `my_current_funding_locked` or `next_funding` for a splice transaction: + * - MUST retransmit `channel_ready`. + * - otherwise: + * - MUST NOT retransmit `channel_ready`, but MAY send `channel_ready` with + * a different `short_channel_id` `alias` field. */ + 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 38b57c19d29b..aaa4e12c2bbe 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 87473aeeebcb..317a571dc6d0 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 5f628c1763c0..5d1232acc99a 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 3c1808f63d9a..a23e6030bfd5 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 59e483d97596..1776d541e7c6 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 3815e17377fa..52dfc8bc1d6c 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/lightningd/channel_gossip.c b/lightningd/channel_gossip.c index 63088b17c209..8eea0cd9bd83 100644 --- a/lightningd/channel_gossip.c +++ b/lightningd/channel_gossip.c @@ -688,9 +688,13 @@ static void stash_remote_announce_sigs(struct channel *channel, * - If the `open_channel` message has the `announce_channel` bit set AND a * `shutdown` message has not been sent: * - After `channel_ready` has been sent and received AND the funding - * transaction has enough confirmations to ensure that it won't be - * reorganized: - * - MUST send `announcement_signatures` for the funding transaction. + * transaction has enough confirmations to ensure that it won't be + * reorganized: + * - MUST send `announcement_signatures` for the funding transaction. + * - After `splice_locked` has been sent and received AND the splice + * transaction has enough confirmations to ensure that it won't be + * reorganized: + * - MUST send `announcement_signatures` for the matching splice transaction. * - Otherwise: * - MUST NOT send the `announcement_signatures` message. */ diff --git a/openingd/dualopend.c b/openingd/dualopend.c index e7da540dab70..e1940a44e516 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", @@ -3976,7 +3976,9 @@ static void do_reconnect_dance(struct state *state) * - 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) { + /* Track whether we set next_funding before tlvs is overwritten by received msg */ + bool we_set_next_funding = !tx_state->remote_funding_sigs_rcvd; + if (we_set_next_funding) { tlvs->next_funding = talz(tlvs, struct tlv_channel_reestablish_tlvs_next_funding); tlvs->next_funding->next_funding_txid = tx_state->funding.txid; tlvs->next_funding->retransmit_flags = 1; /* COMMITMENT_SIGNED */ @@ -4048,9 +4050,12 @@ static void do_reconnect_dance(struct state *state) * - MUST send its `tx_signatures` for that funding transaction. * - if it has already received `tx_signatures` for that funding transaction: * - MUST send its `tx_signatures` for that funding transaction. - * - otherwise: - * - MUST send `tx_abort` to let the sending node know that they can forget - * this funding transaction. + * - if it also sets `next_funding` in its own `channel_reestablish`, but the + * values don't match: + * - MUST send an `error` and fail the channel. + * - otherwise: + * - MUST send `tx_abort` to let the sending node know that they can forget + * this funding transaction. */ if (tlvs->next_funding) { /* Does this match ours? */ @@ -4079,15 +4084,21 @@ static void do_reconnect_dance(struct state *state) status_debug("Unable to send our sigs, our psbt isn't signed"); } else status_debug("No commitment, not sending our sigs (reconnected)"); + } else if (we_set_next_funding) { + /* BOLT #2: if it also sets `next_funding` in its own + * `channel_reestablish`, but the values don't match: + * - MUST send an `error` and fail the channel. */ + open_err_fatal(state, "next_funding_txid %s doesn't match ours %s", + fmt_bitcoin_txid(tmpctx, + &tlvs->next_funding->next_funding_txid), + fmt_bitcoin_txid(tmpctx, + &tx_state->funding.txid)); } else { - peer_billboard(true, "Non-matching next_funding on reconnect. Aborting."); open_abort(state, "Sent next_funding_txid %s doesn't match ours %s", - fmt_bitcoin_txid(tmpctx, &tlvs->next_funding->next_funding_txid), fmt_bitcoin_txid(tmpctx, &tx_state->funding.txid)); - return; } } @@ -4279,7 +4290,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 df9280cac434..7da28340e3f4 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 35a8d9ad800d..862463372a0e 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 ed57ee97e974..8c1805dc8a0f 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 2b8e82e6f8c3..22d57d71d9e2 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/tests/test_opening.py b/tests/test_opening.py index 918e37bbda44..dcfbdfdc3bde 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -7,8 +7,10 @@ from pyln.testing.utils import FUNDAMOUNT from pathlib import Path +import os import pytest import re +import threading import unittest import time @@ -172,6 +174,59 @@ def test_v2_open_sigs_reconnect_2(node_factory, bitcoind): l2.daemon.wait_for_log(r'to CHANNELD_NORMAL') +@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') +@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "sqlite3-specific DB manipulation") +@pytest.mark.openchannel('v2') +def test_v2_open_reconnect_next_funding_mismatch(node_factory, bitcoind): + """Both nodes set next_funding on reconnect but disagree on txid: error sent, channel fails.""" + # l2 always sends tx_signatures first. Disconnecting l2 just before it + # sends tx_signatures means neither node ever receives remote tx_sigs, so + # both end up in DUALOPEND_OPEN_COMMITTED with remote_funding_sigs_rcvd=False + # and will set next_funding in channel_reestablish. + broken = r'dualopend daemon died before signed PSBT returned|Owning subdaemon dualopend died' + l1, l2 = node_factory.get_nodes(2, opts=[ + {'may_reconnect': True, 'dev-no-reconnect': None, 'broken_log': broken}, + {'disconnect': ['-WIRE_TX_SIGNATURES'], 'may_reconnect': True, + 'dev-no-reconnect': None, 'broken_log': broken} + ]) + + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + amount = 2**24 + bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['p2tr'], amount / 10**8 + 0.01) + bitcoind.generate_block(1) + wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0) + + # -WIRE_TX_SIGNATURES causes fundchannel to block (it waits for reconnect + # that will never come due to dev-no-reconnect); run it in a daemon thread + # so the test can proceed. l2.stop() below unblocks it via peer death. + def _fund(): + try: + l1.rpc.fundchannel(l2.info['id'], 100000) + except Exception: + pass + + threading.Thread(target=_fund, daemon=True).start() + + # Both have exchanged commitment_signed (inflight in DB) but no tx_sigs yet. + # Use any() because the channel record may not exist yet when the thread starts. + wait_for(lambda: any(c['state'] == 'DUALOPEND_OPEN_COMMITTED' + for c in l1.rpc.listpeerchannels()['channels'])) + wait_for(lambda: any(c['state'] == 'DUALOPEND_OPEN_COMMITTED' + for c in l2.rpc.listpeerchannels()['channels'])) + + # Corrupt l2's stored funding txid so it disagrees with l1's on reconnect. + l2.stop() + l2.db_manip("UPDATE channel_funding_inflights SET funding_tx_id = X'{}'".format('01' * 32)) + l2.start() + + # Reconnect: both will set next_funding in channel_reestablish but with + # different txids, triggering open_err_fatal on each side per BOLT #2. + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + + l1.daemon.wait_for_log(r"next_funding_txid .* doesn't match ours") + l2.daemon.wait_for_log(r"next_funding_txid .* doesn't match ours") + + @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2') def test_v2_open_sigs_reconnect_1(node_factory, bitcoind): diff --git a/tools/lightning-downgrade.c b/tools/lightning-downgrade.c index a1fc9beb7b0f..33d8a40b6332 100644 --- a/tools/lightning-downgrade.c +++ b/tools/lightning-downgrade.c @@ -167,6 +167,7 @@ static const struct db_version db_versions[] = { { "v25.09", 276, downgrade_askrene_layers, false }, { "v25.12", 280, NULL, false }, { "v26.04", 282, NULL, false }, + { "v26.06", 282, NULL, false }, }; static const struct db_version *version_db(const char *version) 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 3da5b65dfac9..000000000000 --- 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 dbda248d2697..000000000000 --- 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 09a76c942683..000000000000 --- 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 000000000000..375c44716798 --- /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 3200fe789d55..2357073491a1 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 1dad37d9b7f3..8b3cf9ff5d44 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 cc688645673b..dada13949e99 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);