Files
palladum-lightning/channeld/channeld_wire.csv
Dusty Daemon 2bd39f270e splice: Add locked field to inflight db
This is needed to remember if a splice was locked and reconnect occurs mid `splice_locked` attempted so it can be resumed in reestablish.
2025-05-13 14:52:15 +09:30

15 KiB

1#include <bitcoin/psbt.h>
2#include <bitcoin/tx.h>
3#include <channeld/inflight.h>
4#include <common/bip32.h>
5#include <common/blockheight_states.h>
6#include <common/cryptomsg.h>
7#include <common/channel_config.h>
8#include <common/channel_id.h>
9#include <common/channel_type.h>
10#include <common/derive_basepoints.h>
11#include <common/features.h>
12#include <common/fee_states.h>
13#include <wire/peer_wire.h>
14# Begin! (passes gossipd-client fd)
15msgtypechanneld_init1000
16msgdatachanneld_initchainparamschainparams
17msgdatachanneld_initour_featuresfeature_set
18msgdatachanneld_initnum_hsm_capabilitiesu16
19msgdatachanneld_inithsm_capabilitiesu32num_hsm_capabilities
20msgdatachanneld_initchannel_idchannel_id
21msgdatachanneld_initfundingbitcoin_outpoint
22msgdatachanneld_initfunding_satoshiamount_sat
23msgdatachanneld_initminimum_depthu32
24msgdatachanneld_initour_blockheightu32
25msgdatachanneld_initblockheight_statesheight_states
26msgdatachanneld_initlease_expiryu32
27msgdatachanneld_initour_configchannel_config
28msgdatachanneld_inittheir_configchannel_config
29msgdatachanneld_initfee_statesfee_states
30msgdatachanneld_initfeerate_minu32
31msgdatachanneld_initfeerate_maxu32
32msgdatachanneld_initfeerate_penaltyu32
33msgdatachanneld_initfirst_commit_sigbitcoin_signature
34msgdatachanneld_initremote_fundingkeypubkey
35msgdatachanneld_initremote_basepointsbasepoints
36msgdatachanneld_initremote_per_commitpubkey
37msgdatachanneld_initold_remote_per_commitpubkey
38msgdatachanneld_initopenerenum side
39msgdatachanneld_initlocal_msatoshiamount_msat
40msgdatachanneld_initour_basepointsbasepoints
41msgdatachanneld_initour_funding_pubkeypubkey
42msgdatachanneld_initcommit_msecu32
43msgdatachanneld_initlast_was_revokebool
44msgdatachanneld_initnum_last_sent_commitu16
45msgdatachanneld_initlast_sent_commitchanged_htlcnum_last_sent_commit
46msgdatachanneld_initnext_index_localu64
47msgdatachanneld_initnext_index_remoteu64
48msgdatachanneld_initrevocations_receivedu64
49msgdatachanneld_initnext_htlc_idu64
50msgdatachanneld_initnum_existing_htlcsu16
51msgdatachanneld_inithtlcsexisting_htlcnum_existing_htlcs
52msgdatachanneld_initlocal_channel_readybool
53msgdatachanneld_initremote_channel_readybool
54msgdatachanneld_initfunding_short_idshort_channel_id
55msgdatachanneld_initreestablishbool
56msgdatachanneld_initsend_shutdownbool
57msgdatachanneld_initremote_shutdown_receivedbool
58msgdatachanneld_initfinal_indexu32
59msgdatachanneld_initfinal_ext_keyext_key
60msgdatachanneld_initfinal_scriptpubkey_lenu16
61msgdatachanneld_initfinal_scriptpubkeyu8final_scriptpubkey_len
62msgdatachanneld_initflagsu8
63msgdatachanneld_initinit_peer_pkt_lenu16
64msgdatachanneld_initinit_peer_pktu8init_peer_pkt_len
65msgdatachanneld_initlast_remote_secretsecret
66msgdatachanneld_initflenu16
67msgdatachanneld_inittheir_featuresu8flen
68msgdatachanneld_initupfront_shutdown_script_lenu16
69msgdatachanneld_initupfront_shutdown_scriptu8upfront_shutdown_script_len
70msgdatachanneld_initdesired_typechannel_type
71msgdatachanneld_initdev_disable_commit?u32
72msgdatachanneld_initnum_penalty_basesu32
73msgdatachanneld_initpbasespenalty_basenum_penalty_bases
74msgdatachanneld_initexperimental_upgradebool
75msgdatachanneld_initnum_inflightsu16
76msgdatachanneld_initinflightsinflightnum_inflights
77msgdatachanneld_initscid_aliasshort_channel_id
78# channeld->lightningd: successfully negotated reestablishment.
79msgtypechanneld_reestablished1101
80# master->channeld funding hit new depth(funding locked if >= lock depth)
81# short_channel_id != NULL once we have 3+ confirmations
82msgtypechanneld_funding_depth1002
83msgdatachanneld_funding_depthshort_channel_id?short_channel_id
84msgdatachanneld_funding_depthdepthu32
85msgdatachanneld_funding_depthsplicingbool
86msgdatachanneld_funding_depthtxidbitcoin_txid
87# Tell channel to offer this htlc
88msgtypechanneld_offer_htlc1004
89msgdatachanneld_offer_htlcamount_msatamount_msat
90msgdatachanneld_offer_htlccltv_expiryu32
91msgdatachanneld_offer_htlcpayment_hashsha256
92msgdatachanneld_offer_htlconion_routing_packetu81366
93msgdatachanneld_offer_htlcpath_key?pubkey
94# Reply; synchronous since IDs have to increment.
95msgtypechanneld_offer_htlc_reply1104
96msgdatachanneld_offer_htlc_replyidu64
97# Empty failure message means success.
98msgdatachanneld_offer_htlc_replylenu16
99msgdatachanneld_offer_htlc_replyfailuremsgu8len
100msgdatachanneld_offer_htlc_replyfailurestrwirestring
101# Main daemon found out the preimage for an HTLC
102#include <bitcoin/preimage.h>
103msgtypechanneld_fulfill_htlc1005
104msgdatachanneld_fulfill_htlcfulfilled_htlcfulfilled_htlc
105# Main daemon says HTLC failed
106msgtypechanneld_fail_htlc1006
107msgdatachanneld_fail_htlcfailed_htlcfailed_htlc
108# When we receive channel_ready.
109msgtypechanneld_got_channel_ready1019
110msgdatachanneld_got_channel_readynext_per_commit_pointpubkey
111msgdatachanneld_got_channel_readyalias?short_channel_id
112# When we receive funding_locked.
113msgtypechanneld_got_splice_locked1119
114msgdatachanneld_got_splice_lockedfunding_satsamount_sat
115msgdatachanneld_got_splice_lockedsplice_amnts64
116msgdatachanneld_got_splice_lockedlocked_txidbitcoin_txid
117#include <common/penalty_base.h>
118subtypelocal_anchor_info
119subtypedatalocal_anchor_infocommitment_weightu32
120subtypedatalocal_anchor_infocommitment_feeamount_sat
121subtypedatalocal_anchor_infoanchor_pointbitcoin_outpoint
122# lightningd needs to track our anchor outputs on remote txs.
123# This includes splicesso there could be more than one!
124msgtypechanneld_local_anchor_info1003
125msgdatachanneld_local_anchor_inforemote_commitnumu64
126msgdatachanneld_local_anchor_infonum_anchorsu16
127msgdatachanneld_local_anchor_infoanchorslocal_anchor_infonum_anchors
128# When we send a commitment_signed messagetell master.
129msgtypechanneld_sending_commitsig1020
130msgdatachanneld_sending_commitsigcommitnumu64
131msgdatachanneld_sending_commitsigpbase?penalty_base
132msgdatachanneld_sending_commitsigfee_statesfee_states
133msgdatachanneld_sending_commitsigblockheight_statesheight_states
134# SENT_ADD_COMMITSENT_REMOVE_ACK_COMMITSENT_ADD_ACK_COMMITSENT_REMOVE_COMMIT
135msgdatachanneld_sending_commitsignum_changedu16
136msgdatachanneld_sending_commitsigchangedchanged_htlcnum_changed
137# Wait for replyto make sure it's on disk before we send commit.
138msgtypechanneld_sending_commitsig_reply1120
139# When we have a commitment_signed messagetell master to remember.
140msgtypechanneld_got_commitsig1021
141msgdatachanneld_got_commitsigcommitnumu64
142msgdatachanneld_got_commitsigfee_statesfee_states
143msgdatachanneld_got_commitsigblockheight_statesheight_states
144msgdatachanneld_got_commitsigsignaturebitcoin_signature
145msgdatachanneld_got_commitsignum_htlcsu16
146msgdatachanneld_got_commitsightlc_signaturebitcoin_signaturenum_htlcs
147# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
148msgdatachanneld_got_commitsignum_addedu16
149msgdatachanneld_got_commitsigaddedadded_htlcnum_added
150# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
151msgdatachanneld_got_commitsignum_fulfilledu16
152msgdatachanneld_got_commitsigfulfilledfulfilled_htlcnum_fulfilled
153msgdatachanneld_got_commitsignum_failedu16
154msgdatachanneld_got_commitsigfailedfailed_htlcnum_failed
155# RCVD_ADD_ACK_COMMITRCVD_REMOVE_ACK_COMMIT
156msgdatachanneld_got_commitsignum_changedu16
157msgdatachanneld_got_commitsigchangedchanged_htlcnum_changed
158msgdatachanneld_got_commitsigtxbitcoin_tx
159# Inflight splice commitments
160msgdatachanneld_got_commitsignum_inflight_commitsigsu16
161msgdatachanneld_got_commitsiginflight_commitsigscommitsignum_inflight_commitsigs
162subtypecommitsig
163subtypedatacommitsigtxbitcoin_tx
164subtypedatacommitsigcommit_signaturebitcoin_signature
165subtypedatacommitsignum_htlcsu16
166subtypedatacommitsightlc_signaturesbitcoin_signaturenum_htlcs
167# Wait for replyto make sure it's on disk before we send revocation.
168msgtypechanneld_got_commitsig_reply1121
169#include <common/htlc_wire.h>
170msgtypechanneld_got_revoke1022
171msgdatachanneld_got_revokerevokenumu64
172msgdatachanneld_got_revokeper_commitment_secretsecret
173msgdatachanneld_got_revokenext_per_commit_pointpubkey
174# RCVD_ADD_ACK_REVOCATIONRCVD_REMOVE_ACK_REVOCATIONRCVD_ADD_REVOCATIONRCVD_REMOVE_REVOCATION
175msgdatachanneld_got_revokefee_statesfee_states
176msgdatachanneld_got_revokeblockheight_statesheight_states
177msgdatachanneld_got_revokenum_changedu16
178msgdatachanneld_got_revokechangedchanged_htlcnum_changed
179msgdatachanneld_got_revokepbase?penalty_base
180msgdatachanneld_got_revokepenalty_tx?bitcoin_tx
181# Wait for replyto make sure it's on disk before we continue
182# (eg. if we sent another commitment_signedthat would implicitly ack).
183msgtypechanneld_got_revoke_reply1122
184#include <wally_bip32.h>
185# master->channeld: helloI'd like to start a channel splice open
186msgtypechanneld_splice_init7204
187msgdatachanneld_splice_initpsbtwally_psbt
188msgdatachanneld_splice_initrelative_amounts64
189msgdatachanneld_splice_initfeerate_per_kwu32
190msgdatachanneld_splice_initforce_feeratebool
191msgdatachanneld_splice_initskip_stfubool
192# channeld->master: helloI started a channel splice open
193msgtypechanneld_splice_confirmed_init7205
194msgdatachanneld_splice_confirmed_initpsbtwally_psbt
195# master->channeld: Update an active splice
196msgtypechanneld_splice_update7206
197msgdatachanneld_splice_updatepsbtwally_psbt
198# channeld->master: Splice update complete
199msgtypechanneld_splice_confirmed_update7207
200msgdatachanneld_splice_confirmed_updatepsbtwally_psbt
201msgdatachanneld_splice_confirmed_updatecommitments_securedbool
202msgdatachanneld_splice_confirmed_updatesignatures_securedbool
203# channeld->master: Lookup a transaction
204msgtypechanneld_splice_lookup_tx7208
205msgdatachanneld_splice_lookup_txtxidbitcoin_txid
206# master->channeld: Retrieved transaction
207msgtypechanneld_splice_lookup_tx_result7209
208msgdatachanneld_splice_lookup_tx_resulttxbitcoin_tx
209# master->channeld: User has signed psbt and it's ready to complete
210msgtypechanneld_splice_signed7212
211msgdatachanneld_splice_signedpsbtwally_psbt
212msgdatachanneld_splice_signedforce_sign_firstbool
213# channeld->master: Signed psbt is completed
214msgtypechanneld_splice_confirmed_signed7213
215msgdatachanneld_splice_confirmed_signedtxbitcoin_tx
216msgdatachanneld_splice_confirmed_signedoutput_indexu32
217# channeld->master: Splice signatures are about to be sent
218msgtypechanneld_splice_sending_sigs7214
219msgdatachanneld_splice_sending_sigstxbitcoin_txid
220# channeld->master: A feerate error has occured
221msgtypechanneld_splice_feerate_error7215
222msgdatachanneld_splice_feerate_errorfeeamount_msat
223msgdatachanneld_splice_feerate_errortoo_highbool
224# channeld->master: Add an inflight to the DB
225msgtypechanneld_add_inflight7216
226msgdatachanneld_add_inflightremote_fundingpubkey
227msgdatachanneld_add_inflighttx_idbitcoin_txid
228msgdatachanneld_add_inflighttx_outnumu32
229msgdatachanneld_add_inflightfeerateu32
230msgdatachanneld_add_inflightsatoshisamount_sat
231msgdatachanneld_add_inflightsplice_amounts64
232msgdatachanneld_add_inflightpsbtwally_psbt
233msgdatachanneld_add_inflighti_am_initiatorbool
234msgdatachanneld_add_inflightforce_sign_firstbool
235# master->channeld: Inflight saved successfully
236msgtypechanneld_got_inflight7217
237# channeld->master: Update inflight with sigs
238msgtypechanneld_update_inflight7219
239msgdatachanneld_update_inflightpsbtwally_psbt
240msgdatachanneld_update_inflightlast_tx?bitcoin_tx
241msgdatachanneld_update_inflightlast_sig?bitcoin_signature
242msgdatachanneld_update_inflightlocked_scid?short_channel_id
243# channeld->master: A funding error has occured
244msgtypechanneld_splice_funding_error7220
245msgdatachanneld_splice_funding_errorfundingamount_msat
246msgdatachanneld_splice_funding_errorreq_fundingamount_msat
247msgdatachanneld_splice_funding_erroropener_errorbool
248# channeld->master: A splice state error has occured
249msgtypechanneld_splice_state_error7221
250msgdatachanneld_splice_state_errorstate_errorwirestring
251# channeld->master: Peer rejected our splice
252msgtypechanneld_splice_abort7223
253msgdatachanneld_splice_abortdid_i_initiatebool
254msgdatachanneld_splice_abortinflight_outpoint?bitcoin_outpoint
255msgdatachanneld_splice_abortreasonwirestring
256# master->channeld: Please enter stfu mode
257msgtypechanneld_stfu7224
258# channeld->master: Entered stfu result
259msgtypechanneld_confirmed_stfu7225
260msgdatachanneld_confirmed_stfuavailable_fundsamount_msat
261# master->channeld: Please enter perform tx_abort
262msgtypechanneld_abort7226
263# Tell peer to shut down channel.
264msgtypechanneld_send_shutdown1023
265msgdatachanneld_send_shutdownfinal_index?u32
266msgdatachanneld_send_shutdownfinal_ext_key?ext_key
267msgdatachanneld_send_shutdownshutdown_lenu16
268msgdatachanneld_send_shutdownshutdown_scriptpubkeyu8shutdown_len
269msgdatachanneld_send_shutdownwrong_funding?bitcoin_outpoint
270# Peer told us that channel is shutting down
271msgtypechanneld_got_shutdown1024
272msgdatachanneld_got_shutdownscriptpubkey_lenu16
273msgdatachanneld_got_shutdownscriptpubkeyu8scriptpubkey_len
274msgdatachanneld_got_shutdownwrong_funding?bitcoin_outpoint
275# Shutdown is completeready for closing negotiation. + peer_fd & gossip_fd.
276msgtypechanneld_shutdown_complete1025
277# Re-enable commit timer.
278msgtypechanneld_dev_reenable_commit1026
279msgtypechanneld_dev_reenable_commit_reply1126
280msgtypechanneld_feerates1027
281msgdatachanneld_feeratesfeerateu32
282msgdatachanneld_feeratesmin_feerateu32
283msgdatachanneld_feeratesmax_feerateu32
284msgdatachanneld_feeratespenalty_feerateu32
285# master -> channeld: do you have a memleak?
286msgtypechanneld_dev_memleak1033
287msgtypechanneld_dev_memleak_reply1133
288msgdatachanneld_dev_memleak_replyleakbool
289# Peer presented proof it was from the future.
290msgtypechanneld_fail_fallen_behind1028
291# When we receive announcement_signatures for channel announce
292msgtypechanneld_got_announcement1017
293msgdatachanneld_got_announcementscidshort_channel_id
294msgdatachanneld_got_announcementremote_ann_node_sigsecp256k1_ecdsa_signature
295msgdatachanneld_got_announcementremote_ann_bitcoin_sigsecp256k1_ecdsa_signature
296# Ask channeld to send a error message. Used in forgetting channel case.
297msgtypechanneld_send_error1008
298msgdatachanneld_send_errorreasonwirestring
299# Tell master channeld has sent the error message.
300msgtypechanneld_send_error_reply1108
301# Ask channeld to quiesce.
302msgtypechanneld_dev_quiesce1009
303msgtypechanneld_dev_quiesce_reply1109
304# Tell master we're upgrading the commitment tx.
305msgtypechanneld_upgraded1011
306msgdatachanneld_upgradednew_typechannel_type
307# Tell peer about our latest and greatest blockheight.
308msgtypechanneld_blockheight1012
309msgdatachanneld_blockheightblockheightu32
310# Tell channeld about peer's shachain seed.
311msgtypechanneld_dev_peer_shachain1013
312msgdatachanneld_dev_peer_shachainseedsha256