diff --git a/channeld/channeld.c b/channeld/channeld.c index 058115870..a86cc8350 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -2270,13 +2270,14 @@ static void peer_in(struct peer *peer, const u8 *msg) case WIRE_TX_ADD_OUTPUT: case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: + case WIRE_TX_ABORT: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: case WIRE_TX_SIGNATURES: handle_unexpected_tx_sigs(peer, msg); return; - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: break; case WIRE_CHANNEL_REESTABLISH: diff --git a/connectd/gossip_rcvd_filter.c b/connectd/gossip_rcvd_filter.c index a0e9b6b53..b3a73ee24 100644 --- a/connectd/gossip_rcvd_filter.c +++ b/connectd/gossip_rcvd_filter.c @@ -84,10 +84,11 @@ static bool is_msg_gossip_broadcast(const u8 *cursor) case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: case WIRE_TX_SIGNATURES: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: + case WIRE_TX_ABORT: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif diff --git a/connectd/gossip_store.c b/connectd/gossip_store.c index 02af672ed..9101812c1 100644 --- a/connectd/gossip_store.c +++ b/connectd/gossip_store.c @@ -71,8 +71,9 @@ static bool public_msg_type(enum peer_wire type) case WIRE_CHANNEL_READY: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: + case WIRE_TX_ABORT: case WIRE_SHUTDOWN: case WIRE_CLOSING_SIGNED: case WIRE_UPDATE_ADD_HTLC: diff --git a/connectd/multiplex.c b/connectd/multiplex.c index 90fc34a24..e2e50e96a 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -355,6 +355,7 @@ static bool is_urgent(enum peer_wire type) case WIRE_TX_REMOVE_INPUT: case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: + case WIRE_TX_ABORT: case WIRE_TX_SIGNATURES: case WIRE_OPEN_CHANNEL: case WIRE_ACCEPT_CHANNEL: @@ -363,8 +364,8 @@ static bool is_urgent(enum peer_wire type) case WIRE_CHANNEL_READY: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: case WIRE_SHUTDOWN: case WIRE_CLOSING_SIGNED: case WIRE_UPDATE_ADD_HTLC: diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index c2e35e05b..9d34f91c5 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -562,11 +562,12 @@ static void handle_recv_gossip(struct daemon *daemon, const u8 *outermsg) case WIRE_TX_ADD_OUTPUT: case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: + case WIRE_TX_ABORT: case WIRE_TX_SIGNATURES: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: case WIRE_ONION_MESSAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: diff --git a/openingd/dualopend.c b/openingd/dualopend.c index bce9ac197..8004e35a6 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -231,7 +231,6 @@ static u8 *psbt_changeset_get_next(const tal_t *ctx, if (tal_count(set->added_ins) != 0) { const struct input_set *in = &set->added_ins[0]; - u8 *script; if (!psbt_get_serial_id(&in->input.unknowns, &serial_id)) abort(); @@ -239,17 +238,9 @@ static u8 *psbt_changeset_get_next(const tal_t *ctx, const u8 *prevtx = linearize_wtx(ctx, in->input.utxo); - if (in->input.redeem_script_len) - script = tal_dup_arr(ctx, u8, - in->input.redeem_script, - in->input.redeem_script_len, 0); - else - script = NULL; - msg = towire_tx_add_input(ctx, cid, serial_id, prevtx, in->tx_input.index, - in->tx_input.sequence, - script); + in->tx_input.sequence); tal_arr_remove(&set->added_ins, 0); return msg; @@ -866,15 +857,9 @@ static char *check_balances(const tal_t *ctx, return NULL; } -static bool is_segwit_output(struct wally_tx_output *output, - const u8 *redeemscript) +static bool is_segwit_output(struct wally_tx_output *output) { - const u8 *wit_prog; - if (tal_bytelen(redeemscript) > 0) - wit_prog = redeemscript; - else - wit_prog = wally_tx_output_get_script(tmpctx, output); - + const u8 *wit_prog = wally_tx_output_get_script(tmpctx, output); return is_p2wsh(wit_prog, NULL) || is_p2wpkh(wit_prog, NULL); } @@ -1264,7 +1249,7 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state) if (shutdown_complete(state)) dualopen_shutdown(state); return NULL; - case WIRE_INIT_RBF: + case WIRE_TX_INIT_RBF: case WIRE_OPEN_CHANNEL2: case WIRE_INIT: case WIRE_ERROR: @@ -1291,7 +1276,8 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state) case WIRE_TX_ADD_OUTPUT: case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: - case WIRE_ACK_RBF: + case WIRE_TX_ABORT: + case WIRE_TX_ACK_RBF: case WIRE_CHANNEL_ANNOUNCEMENT: case WIRE_CHANNEL_UPDATE: case WIRE_NODE_ANNOUNCEMENT: @@ -1338,7 +1324,7 @@ static bool run_tx_interactive(struct state *state, t = fromwire_peektype(msg); switch (t) { case WIRE_TX_ADD_INPUT: { - const u8 *tx_bytes, *redeemscript; + const u8 *tx_bytes; u32 sequence; size_t len; struct bitcoin_tx *tx; @@ -1349,9 +1335,7 @@ static bool run_tx_interactive(struct state *state, &serial_id, cast_const2(u8 **, &tx_bytes), - &outpoint.n, &sequence, - cast_const2(u8 **, - &redeemscript))) + &outpoint.n, &sequence)) open_err_fatal(state, "Parsing tx_add_input %s", tal_hex(tmpctx, msg)); @@ -1406,8 +1390,7 @@ static bool run_tx_interactive(struct state *state, * - the `prevtx_out` input of `prevtx` is * not an `OP_0` to `OP_16` followed by a single push */ - if (!is_segwit_output(&tx->wtx->outputs[outpoint.n], - redeemscript)) + if (!is_segwit_output(&tx->wtx->outputs[outpoint.n])) open_err_warn(state, "Invalid tx sent. Not SegWit %s", type_to_string(tmpctx, @@ -1439,8 +1422,7 @@ static bool run_tx_interactive(struct state *state, struct wally_psbt_input *in = psbt_append_input(psbt, &outpoint, sequence, NULL, - NULL, - redeemscript); + NULL, NULL); if (!in) open_err_warn(state, "Unable to add input %s", @@ -1608,6 +1590,9 @@ static bool run_tx_interactive(struct state *state, check_channel_id(state, &cid, &state->channel_id); they_complete = true; break; + case WIRE_TX_ABORT: + // FIXME: end open negotiation + break; case WIRE_INIT: case WIRE_ERROR: case WIRE_WARNING: @@ -1633,8 +1618,8 @@ static bool run_tx_interactive(struct state *state, case WIRE_TX_SIGNATURES: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: case WIRE_CHANNEL_ANNOUNCEMENT: case WIRE_CHANNEL_UPDATE: case WIRE_NODE_ANNOUNCEMENT: @@ -2066,9 +2051,9 @@ static void accepter_start(struct state *state, const u8 *oc2_msg) open_err_fatal(state, "Parsing open_channel2 %s", tal_hex(tmpctx, oc2_msg)); - if (open_tlv->option_upfront_shutdown_script) { - state->upfront_shutdown_script[REMOTE] = tal_steal(state, - open_tlv->option_upfront_shutdown_script->shutdown_scriptpubkey); + if (open_tlv->upfront_shutdown_script) { + state->upfront_shutdown_script[REMOTE] = + tal_steal(state, open_tlv->upfront_shutdown_script); } else state->upfront_shutdown_script[REMOTE] = NULL; @@ -2282,9 +2267,7 @@ static void accepter_start(struct state *state, const u8 *oc2_msg) state->their_features); if (tal_bytelen(state->upfront_shutdown_script[LOCAL])) { - a_tlv->option_upfront_shutdown_script - = tal(a_tlv, struct tlv_accept_tlvs_option_upfront_shutdown_script); - a_tlv->option_upfront_shutdown_script->shutdown_scriptpubkey + a_tlv->upfront_shutdown_script = tal_dup_arr(a_tlv, u8, state->upfront_shutdown_script[LOCAL], tal_count(state->upfront_shutdown_script[LOCAL]), @@ -2711,11 +2694,10 @@ static void opener_start(struct state *state, u8 *msg) state->their_features); if (tal_bytelen(state->upfront_shutdown_script[LOCAL])) { - open_tlv->option_upfront_shutdown_script = - tal(open_tlv, - struct tlv_opening_tlvs_option_upfront_shutdown_script); - open_tlv->option_upfront_shutdown_script->shutdown_scriptpubkey = - state->upfront_shutdown_script[LOCAL]; + open_tlv->upfront_shutdown_script = + tal_dup_arr(open_tlv, u8, + state->upfront_shutdown_script[LOCAL], + tal_bytelen(state->upfront_shutdown_script[LOCAL]), 0); } if (state->requested_lease) { @@ -2795,12 +2777,10 @@ static void opener_start(struct state *state, u8 *msg) } } - if (a_tlv->option_upfront_shutdown_script) { + if (a_tlv->upfront_shutdown_script) state->upfront_shutdown_script[REMOTE] - = tal_steal(state, - a_tlv->option_upfront_shutdown_script - ->shutdown_scriptpubkey); - } else + = tal_steal(state, a_tlv->upfront_shutdown_script); + else state->upfront_shutdown_script[REMOTE] = NULL; /* Now we know the 'real channel id' */ @@ -3161,8 +3141,7 @@ static void rbf_local_start(struct state *state, u8 *msg) } tx_state->tx_locktime = tx_state->psbt->tx->locktime; - msg = towire_init_rbf(tmpctx, &state->channel_id, - tx_state->opener_funding, + msg = towire_tx_init_rbf(tmpctx, &state->channel_id, tx_state->tx_locktime, tx_state->feerate_per_kw_funding); @@ -3175,9 +3154,8 @@ static void rbf_local_start(struct state *state, u8 *msg) goto free_rbf_ctx; } - if (!fromwire_ack_rbf(msg, &cid, - &tx_state->accepter_funding)) - open_err_fatal(state, "Parsing ack_rbf %s", + if (!fromwire_tx_ack_rbf(msg, &cid)) + open_err_fatal(state, "Parsing tx_ack_rbf %s", tal_hex(tmpctx, msg)); peer_billboard(false, "channel rbf: ack received"); @@ -3266,11 +3244,10 @@ static void rbf_remote_start(struct state *state, const u8 *rbf_msg) /* We need a new tx_state! */ tx_state = new_tx_state(rbf_ctx); - if (!fromwire_init_rbf(rbf_msg, &cid, - &tx_state->opener_funding, - &tx_state->tx_locktime, - &tx_state->feerate_per_kw_funding)) - open_err_fatal(state, "Parsing init_rbf %s", + if (!fromwire_tx_init_rbf(rbf_msg, &cid, + &tx_state->tx_locktime, + &tx_state->feerate_per_kw_funding)) + open_err_fatal(state, "Parsing tx_init_rbf %s", tal_hex(tmpctx, rbf_msg)); /* Is this the correct channel? */ @@ -3378,10 +3355,7 @@ static void rbf_remote_start(struct state *state, const u8 *rbf_msg) goto free_rbf_ctx; } - msg = towire_ack_rbf(tmpctx, &state->channel_id, - state->our_role == TX_INITIATOR ? - tx_state->opener_funding : - tx_state->accepter_funding); + msg = towire_tx_ack_rbf(tmpctx, &state->channel_id); peer_write(state->pps, msg); peer_billboard(false, "channel rbf: ack sent, waiting for reply"); @@ -3739,9 +3713,12 @@ static u8 *handle_peer_in(struct state *state) case WIRE_SHUTDOWN: handle_peer_shutdown(state, msg); return NULL; - case WIRE_INIT_RBF: + case WIRE_TX_INIT_RBF: rbf_remote_start(state, msg); return NULL; + case WIRE_TX_ABORT: + /* FIXME: handle this */ + return NULL; /* Otherwise we fall through */ case WIRE_INIT: case WIRE_ERROR: @@ -3768,7 +3745,7 @@ static u8 *handle_peer_in(struct state *state) case WIRE_TX_ADD_OUTPUT: case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: - case WIRE_ACK_RBF: + case WIRE_TX_ACK_RBF: case WIRE_CHANNEL_ANNOUNCEMENT: case WIRE_CHANNEL_UPDATE: case WIRE_NODE_ANNOUNCEMENT: diff --git a/tests/test_opening.py b/tests/test_opening.py index e25ce60fc..e14afc961 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -526,8 +526,8 @@ def test_v2_rbf_multi(node_factory, bitcoind, chainparams): @pytest.mark.developer("uses dev-disconnect") @pytest.mark.openchannel('v2') def test_rbf_reconnect_init(node_factory, bitcoind, chainparams): - disconnects = ['-WIRE_INIT_RBF', - '+WIRE_INIT_RBF'] + disconnects = ['-WIRE_TX_INIT_RBF', + '+WIRE_TX_INIT_RBF'] l1, l2 = node_factory.get_nodes(2, opts=[{'disconnect': disconnects, @@ -576,8 +576,8 @@ def test_rbf_reconnect_init(node_factory, bitcoind, chainparams): @pytest.mark.developer("uses dev-disconnect") @pytest.mark.openchannel('v2') def test_rbf_reconnect_ack(node_factory, bitcoind, chainparams): - disconnects = ['-WIRE_ACK_RBF', - '+WIRE_ACK_RBF'] + disconnects = ['-WIRE_TX_ACK_RBF', + '+WIRE_TX_ACK_RBF'] l1, l2 = node_factory.get_nodes(2, opts=[{'may_reconnect': True}, diff --git a/wire/extracted_peer_03_openchannelv2.patch b/wire/extracted_peer_03_openchannelv2.patch index 81b5ce8cf..9f3e93f44 100644 --- a/wire/extracted_peer_03_openchannelv2.patch +++ b/wire/extracted_peer_03_openchannelv2.patch @@ -1,6 +1,6 @@ ---- wire/peer_exp_wire.csv 2021-03-03 15:46:56.845901075 -0600 -+++ - 2021-03-03 15:48:50.342984083 -0600 -@@ -35,6 +31,40 @@ +--- wire/peer_wire.csv 2022-05-16 13:44:14.131975828 -0500 ++++ - 2022-05-16 13:44:55.193718105 -0500 +@@ -37,6 +31,52 @@ tlvdata,n2,tlv1,amount_msat,tu64, tlvtype,n2,tlv2,11 tlvdata,n2,tlv2,cltv_expiry,tu32, @@ -11,8 +11,6 @@ +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,script_sig_len,u16, -+msgdata,tx_add_input,script_sig,byte,script_sig_len +msgtype,tx_add_output,67 +msgdata,tx_add_output,channel_id,channel_id, +msgdata,tx_add_output,serial_id,u64, @@ -38,16 +36,30 @@ +subtype,witness_element +subtypedata,witness_element,len,u16, +subtypedata,witness_element,witness,byte,len ++msgtype,tx_init_rbf,72 ++msgdata,tx_init_rbf,channel_id,channel_id, ++msgdata,tx_init_rbf,locktime,u32, ++msgdata,tx_init_rbf,feerate,u32, ++tlvtype,tx_init_rbf_tlvs,funding_output_contribution,0 ++tlvdata,tx_init_rbf_tlvs,funding_output_contribution,satoshis,tu64, ++msgtype,tx_ack_rbf,73 ++msgdata,tx_ack_rbf,channel_id,channel_id, ++tlvtype,tx_ack_rbf_tlvs,funding_output_contribution,0 ++tlvdata,tx_ack_rbf_tlvs,funding_output_contribution,satoshis,tu64, ++msgtype,tx_abort,74 ++msgdata,tx_abort,channel_id,channel_id, ++msgdata,tx_abort,len,u16, ++msgdata,tx_abort,data,byte,len msgtype,open_channel,32 msgdata,open_channel,chain_hash,chain_hash, msgdata,open_channel,temporary_channel_id,byte,32 -@@ -86,6 +116,56 @@ +@@ -92,6 +116,56 @@ msgdata,channel_ready,tlvs,channel_ready_tlvs, tlvtype,channel_ready_tlvs,short_channel_id,1 tlvdata,channel_ready_tlvs,short_channel_id,alias,short_channel_id, +msgtype,open_channel2,64 +msgdata,open_channel2,chain_hash,chain_hash, -+msgdata,open_channel2,channel_id,channel_id, ++msgdata,open_channel2,zerod_channel_id,channel_id, +msgdata,open_channel2,funding_feerate_perkw,u32, +msgdata,open_channel2,commitment_feerate_perkw,u32, +msgdata,open_channel2,funding_satoshis,u64, @@ -65,11 +77,12 @@ +msgdata,open_channel2,first_per_commitment_point,point, +msgdata,open_channel2,channel_flags,byte, +msgdata,open_channel2,tlvs,opening_tlvs, -+tlvtype,opening_tlvs,option_upfront_shutdown_script,1 -+tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_len,u16, -+tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len ++tlvtype,opening_tlvs,upfront_shutdown_script,0 ++tlvdata,opening_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... ++tlvtype,opening_tlvs,channel_type,1 ++tlvdata,opening_tlvs,channel_type,type,byte,... +msgtype,accept_channel2,65 -+msgdata,accept_channel2,channel_id,channel_id, ++msgdata,accept_channel2,zerod_channel_id,channel_id, +msgdata,accept_channel2,funding_satoshis,u64, +msgdata,accept_channel2,dust_limit_satoshis,u64, +msgdata,accept_channel2,max_htlc_value_in_flight_msat,u64, @@ -84,17 +97,10 @@ +msgdata,accept_channel2,htlc_basepoint,point, +msgdata,accept_channel2,first_per_commitment_point,point, +msgdata,accept_channel2,tlvs,accept_tlvs, -+tlvtype,accept_tlvs,option_upfront_shutdown_script,1 -+tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_len,u16, -+tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len -+msgtype,init_rbf,72 -+msgdata,init_rbf,channel_id,channel_id, -+msgdata,init_rbf,funding_satoshis,u64, -+msgdata,init_rbf,locktime,u32, -+msgdata,init_rbf,funding_feerate_perkw,u32, -+msgtype,ack_rbf,73 -+msgdata,ack_rbf,channel_id,channel_id, -+msgdata,ack_rbf,funding_satoshis,u64, ++tlvtype,accept_tlvs,upfront_shutdown_script,0 ++tlvdata,accept_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... ++tlvtype,accept_tlvs,channel_type,1 ++tlvdata,accept_tlvs,channel_type,type,byte,... msgtype,shutdown,38 msgdata,shutdown,channel_id,channel_id, msgdata,shutdown,len,u16, diff --git a/wire/extracted_peer_04_opt_will_fund.patch b/wire/extracted_peer_04_opt_will_fund.patch index 863ea4cba..183bedf80 100644 --- a/wire/extracted_peer_04_opt_will_fund.patch +++ b/wire/extracted_peer_04_opt_will_fund.patch @@ -1,9 +1,9 @@ --- wire/peer_wire.csv 2021-06-10 12:47:17.225844741 -0500 +++ - 2021-06-10 12:47:40.960373156 -0500 @@ -143,6 +139,9 @@ - tlvtype,opening_tlvs,option_upfront_shutdown_script,1 - tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_len,u16, - tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len + tlvdata,opening_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... + tlvtype,opening_tlvs,channel_type,1 + tlvdata,opening_tlvs,channel_type,type,byte,... +tlvtype,opening_tlvs,request_funds,3 +tlvdata,opening_tlvs,request_funds,requested_sats,u64, +tlvdata,opening_tlvs,request_funds,blockheight,u32, @@ -11,9 +11,9 @@ msgdata,accept_channel2,channel_id,channel_id, msgdata,accept_channel2,funding_satoshis,u64, @@ -162,6 +161,15 @@ - tlvtype,accept_tlvs,option_upfront_shutdown_script,1 - tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_len,u16, - tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len + tlvdata,accept_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... + tlvtype,accept_tlvs,channel_type,1 + tlvdata,accept_tlvs,channel_type,type,byte,... +tlvtype,accept_tlvs,will_fund,2 +tlvdata,accept_tlvs,will_fund,signature,signature, +tlvdata,accept_tlvs,will_fund,lease_rates,lease_rates, @@ -23,9 +23,9 @@ +subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16, +subtypedata,lease_rates,lease_fee_base_sat,u32, +subtypedata,lease_rates,channel_fee_max_base_msat,tu32, - msgtype,init_rbf,72 - msgdata,init_rbf,channel_id,channel_id, - msgdata,init_rbf,funding_satoshis,u64, + msgtype,shutdown,38 + msgdata,shutdown,channel_id,channel_id, + msgdata,shutdown,len,u16, @@ -215,6 +219,9 @@ msgtype,update_fee,134 msgdata,update_fee,channel_id,channel_id, diff --git a/wire/extracted_peer_exp_quiescence-protocol.patch b/wire/extracted_peer_exp_quiescence-protocol.patch index 804b726b9..de073f5f8 100644 --- a/wire/extracted_peer_exp_quiescence-protocol.patch +++ b/wire/extracted_peer_exp_quiescence-protocol.patch @@ -1,9 +1,9 @@ --- wire/peer_exp_wire.csv 2021-05-17 09:30:02.302260471 +0930 +++ - 2021-05-31 12:20:36.390910632 +0930 @@ -120,6 +82,9 @@ - msgtype,ack_rbf,73 - msgdata,ack_rbf,channel_id,channel_id, - msgdata,ack_rbf,funding_satoshis,u64, + subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16, + subtypedata,lease_rates,lease_fee_base_sat,u32, + subtypedata,lease_rates,channel_fee_max_base_msat,tu32, +msgtype,stfu,2 +msgdata,stfu,channel_id,channel_id, +msgdata,stfu,initiator,u8, diff --git a/wire/peer_wire.c b/wire/peer_wire.c index 010d19f18..29e67f386 100644 --- a/wire/peer_wire.c +++ b/wire/peer_wire.c @@ -42,10 +42,11 @@ static bool unknown_type(enum peer_wire t) case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: case WIRE_TX_SIGNATURES: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: + case WIRE_TX_ABORT: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif @@ -94,10 +95,11 @@ bool is_msg_for_gossipd(const u8 *cursor) case WIRE_TX_REMOVE_OUTPUT: case WIRE_TX_COMPLETE: case WIRE_TX_SIGNATURES: + case WIRE_TX_INIT_RBF: + case WIRE_TX_ACK_RBF: + case WIRE_TX_ABORT: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: - case WIRE_INIT_RBF: - case WIRE_ACK_RBF: case WIRE_ONION_MESSAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: @@ -221,6 +223,12 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id) * 2. data: * * [`channel_id`:`channel_id`] */ + case WIRE_TX_ABORT: + /* BOLT-dualfund #2: + * 1. type: 74 (`tx_abort`) + * 2. data: + * * [`channel_id`:`channel_id`] + */ case WIRE_ACCEPT_CHANNEL: /* BOLT #2: * 1. type: 33 (`accept_channel`) @@ -251,15 +259,15 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id) * 2. data: * * [`channel_id`:`channel_id`] */ - case WIRE_INIT_RBF: + case WIRE_TX_INIT_RBF: /* BOLT-dualfund #2: - * 1. type: 72 (`init_rbf`) + * 1. type: 72 (`tx_init_rbf`) * 2. data: * * [`channel_id`:`channel_id`] */ - case WIRE_ACK_RBF: + case WIRE_TX_ACK_RBF: /* BOLT-dualfund #2: - * 1. type: 73 (`ack_rbf`) + * 1. type: 73 (`tx_ack_rbf`) * 2. data: * * [`channel_id`:`channel_id`] */ diff --git a/wire/peer_wire.csv b/wire/peer_wire.csv index ee1290464..f8f175853 100644 --- a/wire/peer_wire.csv +++ b/wire/peer_wire.csv @@ -44,8 +44,6 @@ 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,script_sig_len,u16, -msgdata,tx_add_input,script_sig,byte,script_sig_len msgtype,tx_add_output,67 msgdata,tx_add_output,channel_id,channel_id, msgdata,tx_add_output,serial_id,u64, @@ -71,6 +69,20 @@ subtypedata,witness_stack,witness_element,witness_element,num_input_witness subtype,witness_element subtypedata,witness_element,len,u16, subtypedata,witness_element,witness,byte,len +msgtype,tx_init_rbf,72 +msgdata,tx_init_rbf,channel_id,channel_id, +msgdata,tx_init_rbf,locktime,u32, +msgdata,tx_init_rbf,feerate,u32, +tlvtype,tx_init_rbf_tlvs,funding_output_contribution,0 +tlvdata,tx_init_rbf_tlvs,funding_output_contribution,satoshis,tu64, +msgtype,tx_ack_rbf,73 +msgdata,tx_ack_rbf,channel_id,channel_id, +tlvtype,tx_ack_rbf_tlvs,funding_output_contribution,0 +tlvdata,tx_ack_rbf_tlvs,funding_output_contribution,satoshis,tu64, +msgtype,tx_abort,74 +msgdata,tx_abort,channel_id,channel_id, +msgdata,tx_abort,len,u16, +msgdata,tx_abort,data,byte,len msgtype,open_channel,32 msgdata,open_channel,chain_hash,chain_hash, msgdata,open_channel,temporary_channel_id,byte,32 @@ -131,7 +143,7 @@ tlvtype,channel_ready_tlvs,short_channel_id,1 tlvdata,channel_ready_tlvs,short_channel_id,alias,short_channel_id, msgtype,open_channel2,64 msgdata,open_channel2,chain_hash,chain_hash, -msgdata,open_channel2,channel_id,channel_id, +msgdata,open_channel2,zerod_channel_id,channel_id, msgdata,open_channel2,funding_feerate_perkw,u32, msgdata,open_channel2,commitment_feerate_perkw,u32, msgdata,open_channel2,funding_satoshis,u64, @@ -149,14 +161,15 @@ msgdata,open_channel2,htlc_basepoint,point, msgdata,open_channel2,first_per_commitment_point,point, msgdata,open_channel2,channel_flags,byte, msgdata,open_channel2,tlvs,opening_tlvs, -tlvtype,opening_tlvs,option_upfront_shutdown_script,1 -tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_len,u16, -tlvdata,opening_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len +tlvtype,opening_tlvs,upfront_shutdown_script,0 +tlvdata,opening_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... +tlvtype,opening_tlvs,channel_type,1 +tlvdata,opening_tlvs,channel_type,type,byte,... tlvtype,opening_tlvs,request_funds,3 tlvdata,opening_tlvs,request_funds,requested_sats,u64, tlvdata,opening_tlvs,request_funds,blockheight,u32, msgtype,accept_channel2,65 -msgdata,accept_channel2,channel_id,channel_id, +msgdata,accept_channel2,zerod_channel_id,channel_id, msgdata,accept_channel2,funding_satoshis,u64, msgdata,accept_channel2,dust_limit_satoshis,u64, msgdata,accept_channel2,max_htlc_value_in_flight_msat,u64, @@ -171,9 +184,10 @@ msgdata,accept_channel2,delayed_payment_basepoint,point, msgdata,accept_channel2,htlc_basepoint,point, msgdata,accept_channel2,first_per_commitment_point,point, msgdata,accept_channel2,tlvs,accept_tlvs, -tlvtype,accept_tlvs,option_upfront_shutdown_script,1 -tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_len,u16, -tlvdata,accept_tlvs,option_upfront_shutdown_script,shutdown_scriptpubkey,byte,shutdown_len +tlvtype,accept_tlvs,upfront_shutdown_script,0 +tlvdata,accept_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,... +tlvtype,accept_tlvs,channel_type,1 +tlvdata,accept_tlvs,channel_type,type,byte,... tlvtype,accept_tlvs,will_fund,2 tlvdata,accept_tlvs,will_fund,signature,signature, tlvdata,accept_tlvs,will_fund,lease_rates,lease_rates, @@ -183,14 +197,6 @@ subtypedata,lease_rates,lease_fee_basis,u16, subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16, subtypedata,lease_rates,lease_fee_base_sat,u32, subtypedata,lease_rates,channel_fee_max_base_msat,tu32, -msgtype,init_rbf,72 -msgdata,init_rbf,channel_id,channel_id, -msgdata,init_rbf,funding_satoshis,u64, -msgdata,init_rbf,locktime,u32, -msgdata,init_rbf,funding_feerate_perkw,u32, -msgtype,ack_rbf,73 -msgdata,ack_rbf,channel_id,channel_id, -msgdata,ack_rbf,funding_satoshis,u64, msgtype,shutdown,38 msgdata,shutdown,channel_id,channel_id, msgdata,shutdown,len,u16,