core-lightning/channeld/channeld_wire.csv
niftynei d6558deaa4 opening: pass two messages to channeld to send to peer
v2 of channel establishment, in the accpeter case, now sends 2 messages
to our peer after saving the information to disk (our commitment
signatures and our funding transaction signatures)
2020-09-09 19:54:20 +09:30

9.9 KiB

1#include <common/cryptomsg.h>
2#include <common/channel_config.h>
3#include <common/channel_id.h>
4#include <common/derive_basepoints.h>
5#include <common/features.h>
6#include <common/fee_states.h>
7#include <common/per_peer_state.h>
8# Begin! (passes gossipd-client fd)
9msgtype,channeld_init,1000
10msgdata,channeld_init,chainparams,chainparams,
11msgdata,channeld_init,our_features,feature_set,
12msgdata,channeld_init,channel_id,channel_id,
13msgdata,channeld_init,funding_txid,bitcoin_txid,
14msgdata,channeld_init,funding_txout,u16,
15msgdata,channeld_init,funding_satoshi,amount_sat,
16msgdata,channeld_init,minimum_depth,u32,
17msgdata,channeld_init,our_config,channel_config,
18msgdata,channeld_init,their_config,channel_config,
19msgdata,channeld_init,fee_states,fee_states,
20msgdata,channeld_init,feerate_min,u32,
21msgdata,channeld_init,feerate_max,u32,
22msgdata,channeld_init,feerate_penalty,u32,
23msgdata,channeld_init,first_commit_sig,bitcoin_signature,
24msgdata,channeld_init,per_peer_state,per_peer_state,
25msgdata,channeld_init,remote_fundingkey,pubkey,
26msgdata,channeld_init,remote_basepoints,basepoints,
27msgdata,channeld_init,remote_per_commit,pubkey,
28msgdata,channeld_init,old_remote_per_commit,pubkey,
29msgdata,channeld_init,opener,enum side,
30msgdata,channeld_init,fee_base,u32,
31msgdata,channeld_init,fee_proportional,u32,
32msgdata,channeld_init,local_msatoshi,amount_msat,
33msgdata,channeld_init,our_basepoints,basepoints,
34msgdata,channeld_init,our_funding_pubkey,pubkey,
35msgdata,channeld_init,local_node_id,node_id,
36msgdata,channeld_init,remote_node_id,node_id,
37msgdata,channeld_init,commit_msec,u32,
38msgdata,channeld_init,cltv_delta,u16,
39msgdata,channeld_init,last_was_revoke,bool,
40msgdata,channeld_init,num_last_sent_commit,u16,
41msgdata,channeld_init,last_sent_commit,changed_htlc,num_last_sent_commit
42msgdata,channeld_init,next_index_local,u64,
43msgdata,channeld_init,next_index_remote,u64,
44msgdata,channeld_init,revocations_received,u64,
45msgdata,channeld_init,next_htlc_id,u64,
46msgdata,channeld_init,num_existing_htlcs,u16,
47msgdata,channeld_init,htlcs,existing_htlc,num_existing_htlcs
48msgdata,channeld_init,local_funding_locked,bool,
49msgdata,channeld_init,remote_funding_locked,bool,
50msgdata,channeld_init,funding_short_id,short_channel_id,
51msgdata,channeld_init,reestablish,bool,
52msgdata,channeld_init,send_shutdown,bool,
53msgdata,channeld_init,remote_shutdown_received,bool,
54msgdata,channeld_init,final_scriptpubkey_len,u16,
55msgdata,channeld_init,final_scriptpubkey,u8,final_scriptpubkey_len
56msgdata,channeld_init,flags,u8,
57msgdata,channeld_init,init_peer_pkt_len,u16,
58msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len
59msgdata,channeld_init,init_peer_pkt_two_len,u16,
60msgdata,channeld_init,init_peer_pkt_two,u8,init_peer_pkt_two_len
61msgdata,channeld_init,reached_announce_depth,bool,
62msgdata,channeld_init,last_remote_secret,secret,
63msgdata,channeld_init,flen,u16,
64msgdata,channeld_init,their_features,u8,flen
65msgdata,channeld_init,upfront_shutdown_script_len,u16,
66msgdata,channeld_init,upfront_shutdown_script,u8,upfront_shutdown_script_len
67msgdata,channeld_init,remote_ann_node_sig,?secp256k1_ecdsa_signature,
68msgdata,channeld_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature,
69msgdata,channeld_init,option_static_remotekey,bool,
70msgdata,channeld_init,option_anchor_outputs,bool,
71msgdata,channeld_init,dev_fast_gossip,bool,
72msgdata,channeld_init,dev_fail_process_onionpacket,bool,
73msgdata,channeld_init,num_penalty_bases,u32,
74msgdata,channeld_init,pbases,penalty_base,num_penalty_bases
75# master->channeld funding hit new depth(funding locked if >= lock depth)
76msgtype,channeld_funding_depth,1002
77msgdata,channeld_funding_depth,short_channel_id,?short_channel_id,
78msgdata,channeld_funding_depth,depth,u32,
79# Tell channel to offer this htlc
80msgtype,channeld_offer_htlc,1004
81msgdata,channeld_offer_htlc,amount_msat,amount_msat,
82msgdata,channeld_offer_htlc,cltv_expiry,u32,
83msgdata,channeld_offer_htlc,payment_hash,sha256,
84msgdata,channeld_offer_htlc,onion_routing_packet,u8,1366
85msgdata,channeld_offer_htlc,blinding,?pubkey,
86# Reply; synchronous since IDs have to increment.
87msgtype,channeld_offer_htlc_reply,1104
88msgdata,channeld_offer_htlc_reply,id,u64,
89# Empty failure message means success.
90msgdata,channeld_offer_htlc_reply,len,u16,
91msgdata,channeld_offer_htlc_reply,failuremsg,u8,len
92msgdata,channeld_offer_htlc_reply,failurestr,wirestring,
93# Main daemon found out the preimage for an HTLC
94#include <bitcoin/preimage.h>
95msgtype,channeld_fulfill_htlc,1005
96msgdata,channeld_fulfill_htlc,fulfilled_htlc,fulfilled_htlc,
97# Main daemon says HTLC failed
98msgtype,channeld_fail_htlc,1006
99msgdata,channeld_fail_htlc,failed_htlc,failed_htlc,
100# When we receive funding_locked.
101msgtype,channeld_got_funding_locked,1019
102msgdata,channeld_got_funding_locked,next_per_commit_point,pubkey,
103#include <common/penalty_base.h>
104# When we send a commitment_signed message, tell master.
105msgtype,channeld_sending_commitsig,1020
106msgdata,channeld_sending_commitsig,commitnum,u64,
107msgdata,channeld_sending_commitsig,pbase,?penalty_base,
108msgdata,channeld_sending_commitsig,fee_states,fee_states,
109# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
110msgdata,channeld_sending_commitsig,num_changed,u16,
111msgdata,channeld_sending_commitsig,changed,changed_htlc,num_changed
112msgdata,channeld_sending_commitsig,commit_sig,bitcoin_signature,
113msgdata,channeld_sending_commitsig,num_htlc_sigs,u16,
114msgdata,channeld_sending_commitsig,htlc_sigs,bitcoin_signature,num_htlc_sigs
115# Wait for reply, to make sure it's on disk before we send commit.
116msgtype,channeld_sending_commitsig_reply,1120
117# When we have a commitment_signed message, tell master to remember.
118msgtype,channeld_got_commitsig,1021
119msgdata,channeld_got_commitsig,commitnum,u64,
120msgdata,channeld_got_commitsig,fee_states,fee_states,
121msgdata,channeld_got_commitsig,signature,bitcoin_signature,
122msgdata,channeld_got_commitsig,num_htlcs,u16,
123msgdata,channeld_got_commitsig,htlc_signature,bitcoin_signature,num_htlcs
124# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
125msgdata,channeld_got_commitsig,num_added,u16,
126msgdata,channeld_got_commitsig,added,added_htlc,num_added
127# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
128msgdata,channeld_got_commitsig,num_fulfilled,u16,
129msgdata,channeld_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled
130msgdata,channeld_got_commitsig,num_failed,u16,
131msgdata,channeld_got_commitsig,failed,failed_htlc,num_failed
132# RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT
133msgdata,channeld_got_commitsig,num_changed,u16,
134msgdata,channeld_got_commitsig,changed,changed_htlc,num_changed
135msgdata,channeld_got_commitsig,tx,bitcoin_tx,
136# Wait for reply, to make sure it's on disk before we send revocation.
137msgtype,channeld_got_commitsig_reply,1121
138#include <common/htlc_wire.h>
139msgtype,channeld_got_revoke,1022
140msgdata,channeld_got_revoke,revokenum,u64,
141msgdata,channeld_got_revoke,per_commitment_secret,secret,
142msgdata,channeld_got_revoke,next_per_commit_point,pubkey,
143# RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION
144msgdata,channeld_got_revoke,fee_states,fee_states,
145msgdata,channeld_got_revoke,num_changed,u16,
146msgdata,channeld_got_revoke,changed,changed_htlc,num_changed
147msgdata,channeld_got_revoke,pbase,?penalty_base,
148msgdata,channeld_got_revoke,penalty_tx,?bitcoin_tx,
149# Wait for reply, to make sure it's on disk before we continue
150# (eg. if we sent another commitment_signed, that would implicitly ack).
151msgtype,channeld_got_revoke_reply,1122
152# Tell peer to shut down channel.
153msgtype,channeld_send_shutdown,1023
154msgdata,channeld_send_shutdown,shutdown_len,u16,
155msgdata,channeld_send_shutdown,shutdown_scriptpubkey,u8,shutdown_len
156# Peer told us that channel is shutting down
157msgtype,channeld_got_shutdown,1024
158msgdata,channeld_got_shutdown,scriptpubkey_len,u16,
159msgdata,channeld_got_shutdown,scriptpubkey,u8,scriptpubkey_len
160# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
161msgtype,channeld_shutdown_complete,1025
162msgdata,channeld_shutdown_complete,per_peer_state,per_peer_state,
163# Re-enable commit timer.
164msgtype,channeld_dev_reenable_commit,1026
165msgtype,channeld_dev_reenable_commit_reply,1126,
166msgtype,channeld_feerates,1027
167msgdata,channeld_feerates,feerate,u32,
168msgdata,channeld_feerates,min_feerate,u32,
169msgdata,channeld_feerates,max_feerate,u32,
170msgdata,channeld_feerates,penalty_feerate,u32,
171# master -> channeld: do you have a memleak?
172msgtype,channeld_dev_memleak,1033
173msgtype,channeld_dev_memleak_reply,1133
174msgdata,channeld_dev_memleak_reply,leak,bool,
175# Peer presented proof it was from the future.
176msgtype,channeld_fail_fallen_behind,1028
177# This is NULL if option_static_remotekey.
178msgdata,channeld_fail_fallen_behind,remote_per_commitment_point,?pubkey,
179# Handle a channel specific feerate base ppm configuration
180msgtype,channeld_specific_feerates,1029
181msgdata,channeld_specific_feerates,feerate_base,u32,
182msgdata,channeld_specific_feerates,feerate_ppm,u32,
183# When we receive announcement_signatures for channel announce
184msgtype,channeld_got_announcement,1017
185msgdata,channeld_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature,
186msgdata,channeld_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature,
187# Ask channeld to send a error message. Used in forgetting channel case.
188msgtype,channeld_send_error,1008
189msgdata,channeld_send_error,reason,wirestring,
190# Tell master channeld has sent the error message.
191msgtype,channeld_send_error_reply,1108
192# Tell lightningd we got a onion message (for us, or to fwd)
193msgtype,got_onionmsg_to_us,1142
194msgdata,got_onionmsg_to_us,reply_blinding,?pubkey,
195msgdata,got_onionmsg_to_us,reply_path_len,u16,
196msgdata,got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len
197msgtype,got_onionmsg_forward,1143
198msgdata,got_onionmsg_forward,next_scid,?short_channel_id,
199msgdata,got_onionmsg_forward,next_node_id,?node_id,
200msgdata,got_onionmsg_forward,next_blinding,?pubkey,
201msgdata,got_onionmsg_forward,next_onion,u8,1366
202# Lightningd tells us to send a onion message.
203msgtype,send_onionmsg,1040
204msgdata,send_onionmsg,onion,u8,1366
205msgdata,send_onionmsg,blinding,?pubkey,