Browse Source

dual-fund: add interactive dual-funding wires

imported from ??? TODO: FIXME
niftynei/lightning-rfc:nifty/interactive-dual-funding
bump-pyln-proto
niftynei 4 years ago
committed by Rusty Russell
parent
commit
05a6a11860
  1. 14
      channeld/channeld.c
  2. 10
      gossipd/gossipd.c
  3. 117
      wire/extracted_peer_experimental_dual_fund
  4. 20
      wire/peer_wire.c

14
channeld/channeld.c

@ -2104,6 +2104,9 @@ static void peer_in(struct peer *peer, const u8 *msg)
case WIRE_ONION_MESSAGE: case WIRE_ONION_MESSAGE:
handle_onion_message(peer, msg); handle_onion_message(peer, msg);
return; return;
/* FIXME: handle this here */
case WIRE_INIT_RBF:
break;
#endif #endif
case WIRE_INIT: case WIRE_INIT:
@ -2112,6 +2115,17 @@ static void peer_in(struct peer *peer, const u8 *msg)
case WIRE_FUNDING_CREATED: case WIRE_FUNDING_CREATED:
case WIRE_FUNDING_SIGNED: case WIRE_FUNDING_SIGNED:
case WIRE_CLOSING_SIGNED: case WIRE_CLOSING_SIGNED:
#if EXPERIMENTAL_FEATURES
case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT:
case WIRE_TX_ADD_OUTPUT:
case WIRE_TX_REMOVE_OUTPUT:
case WIRE_TX_COMPLETE:
case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_BLACKLIST_PODLE:
#endif
break; break;
case WIRE_CHANNEL_REESTABLISH: case WIRE_CHANNEL_REESTABLISH:

10
gossipd/gossipd.c

@ -490,6 +490,16 @@ static struct io_plan *peer_msg_in(struct io_conn *conn,
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
#if EXPERIMENTAL_FEATURES #if EXPERIMENTAL_FEATURES
case WIRE_ONION_MESSAGE: case WIRE_ONION_MESSAGE:
case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT:
case WIRE_TX_ADD_OUTPUT:
case WIRE_TX_REMOVE_OUTPUT:
case WIRE_TX_COMPLETE:
case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_INIT_RBF:
case WIRE_BLACKLIST_PODLE:
#endif #endif
status_broken("peer %s: relayed unexpected msg of type %s", status_broken("peer %s: relayed unexpected msg of type %s",
type_to_string(tmpctx, struct node_id, &peer->id), type_to_string(tmpctx, struct node_id, &peer->id),

117
wire/extracted_peer_experimental_dual_fund

@ -0,0 +1,117 @@
--- wire/extracted_peer_wire_csv 2020-07-28 12:36:12.063168014 -0500
+++ - 2020-08-24 19:16:50.026185750 -0500
@@ -31,6 +31,47 @@
tlvdata,n2,tlv1,amount_msat,tu64,
tlvtype,n2,tlv2,11
tlvdata,n2,tlv2,cltv_expiry,tu32,
+msgtype,tx_add_input,66
+msgdata,tx_add_input,channel_id,channel_id,
+msgdata,tx_add_input,serial_id,u16,
+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,max_witness_len,u16,
+msgdata,tx_add_input,redeemscript_len,u16,
+msgdata,tx_add_input,script,byte,redeemscript_len
+msgdata,tx_add_input,tlvs,tx_add_input_tlvs,
+tlvtype,tx_add_input_tlvs,podle_proof,2
+tlvdata,tx_add_input_tlvs,podle_proof,p,point,
+tlvdata,tx_add_input_tlvs,podle_proof,p2,point,
+tlvdata,tx_add_input_tlvs,podle_proof,e,sha256,
+tlvdata,tx_add_input_tlvs,podle_proof,sig,byte,32
+msgtype,tx_add_output,67
+msgdata,tx_add_output,channel_id,channel_id,
+msgdata,tx_add_output,serial_id,u16,
+msgdata,tx_add_output,sats,u64,
+msgdata,tx_add_output,scriptlen,u16,
+msgdata,tx_add_output,script,byte,scriptlen
+msgtype,tx_remove_input,68
+msgdata,tx_remove_input,channel_id,channel_id,
+msgdata,tx_remove_input,serial_id,u16,
+msgtype,tx_remove_output,69
+msgdata,tx_remove_output,channel_id,channel_id,
+msgdata,tx_remove_output,serial_id,u16,
+msgtype,tx_complete,70
+msgdata,tx_complete,channel_id,channel_id,
+msgtype,tx_signatures,71
+msgdata,tx_signatures,channel_id,channel_id,
+msgdata,tx_signatures,txid,sha256,
+msgdata,tx_signatures,num_witnesses,u16,
+msgdata,tx_signatures,witness_stack,witness_stack,num_witnesses
+subtype,witness_stack
+subtypedata,witness_stack,num_input_witness,u16,
+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,open_channel,32
msgdata,open_channel,chain_hash,chain_hash,
msgdata,open_channel,temporary_channel_id,byte,32
@@ -82,6 +123,54 @@
msgtype,funding_locked,36
msgdata,funding_locked,channel_id,channel_id,
msgdata,funding_locked,next_per_commitment_point,point,
+msgtype,open_channel2,64
+msgdata,open_channel2,chain_hash,chain_hash,
+msgdata,open_channel2,podle_h2,sha256,
+msgdata,open_channel2,feerate_per_kw_funding,u32,
+msgdata,open_channel2,funding_satoshis,u64,
+msgdata,open_channel2,dust_limit_satoshis,u64,
+msgdata,open_channel2,max_htlc_value_in_flight_msat,u64,
+msgdata,open_channel2,htlc_minimum_msat,u64,
+msgdata,open_channel2,feerate_per_kw,u32,
+msgdata,open_channel2,to_self_delay,u16,
+msgdata,open_channel2,max_accepted_htlcs,u16,
+msgdata,open_channel2,locktime,u32,
+msgdata,open_channel2,funding_pubkey,point,
+msgdata,open_channel2,revocation_basepoint,point,
+msgdata,open_channel2,payment_basepoint,point,
+msgdata,open_channel2,delayed_payment_basepoint,point,
+msgdata,open_channel2,htlc_basepoint,point,
+msgdata,open_channel2,first_per_commitment_point,point,
+msgdata,open_channel2,channel_flags,byte,
+msgdata,open_channel2,opening_tlv,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
+msgtype,accept_channel2,65
+msgdata,accept_channel2,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,
+msgdata,accept_channel2,htlc_minimum_msat,u64,
+msgdata,accept_channel2,minimum_depth,u32,
+msgdata,accept_channel2,to_self_delay,u16,
+msgdata,accept_channel2,max_accepted_htlcs,u16,
+msgdata,accept_channel2,funding_pubkey,point,
+msgdata,accept_channel2,revocation_basepoint,point,
+msgdata,accept_channel2,payment_basepoint,point,
+msgdata,accept_channel2,delayed_payment_basepoint,point,
+msgdata,accept_channel2,htlc_basepoint,point,
+msgdata,accept_channel2,first_per_commitment_point,point,
+msgdata,accept_channel2,accept_tlv,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,feerate_per_kw,u32,
+msgdata,init_rbf,fee_step,byte,
msgtype,shutdown,38
msgdata,shutdown,channel_id,channel_id,
msgdata,shutdown,len,u16,
@@ -169,6 +258,11 @@
msgdata,channel_update,fee_base_msat,u32,
msgdata,channel_update,fee_proportional_millionths,u32,
msgdata,channel_update,htlc_maximum_msat,u64,,option_channel_htlc_max
+msgtype,blacklist_podle,260
+msgdata,blacklist_podle,signature,signature,
+msgdata,blacklist_podle,node_id,point,
+msgdata,blacklist_podle,podle_h2,byte,32
+msgdata,blacklist_podle,timestamp,u32,
msgtype,query_short_channel_ids,261,gossip_queries
msgdata,query_short_channel_ids,chain_hash,chain_hash,
msgdata,query_short_channel_ids,len,u16,

20
wire/peer_wire.c

@ -34,6 +34,16 @@ static bool unknown_type(enum peer_wire t)
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
#if EXPERIMENTAL_FEATURES #if EXPERIMENTAL_FEATURES
case WIRE_ONION_MESSAGE: case WIRE_ONION_MESSAGE:
case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT:
case WIRE_TX_ADD_OUTPUT:
case WIRE_TX_REMOVE_OUTPUT:
case WIRE_TX_COMPLETE:
case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_INIT_RBF:
case WIRE_BLACKLIST_PODLE:
#endif #endif
return false; return false;
} }
@ -74,6 +84,16 @@ bool is_msg_for_gossipd(const u8 *cursor)
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
#if EXPERIMENTAL_FEATURES #if EXPERIMENTAL_FEATURES
case WIRE_ONION_MESSAGE: case WIRE_ONION_MESSAGE:
case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT:
case WIRE_TX_ADD_OUTPUT:
case WIRE_TX_REMOVE_OUTPUT:
case WIRE_TX_COMPLETE:
case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_INIT_RBF:
case WIRE_BLACKLIST_PODLE:
#endif #endif
break; break;
} }

Loading…
Cancel
Save