2017-08-28 18:05:01 +02:00
|
|
|
#include <common/cryptomsg.h>
|
|
|
|
#include <common/channel_config.h>
|
2018-07-09 13:17:59 +02:00
|
|
|
#include <common/derive_basepoints.h>
|
2017-03-07 02:26:12 +01:00
|
|
|
|
2017-06-20 07:55:03 +02:00
|
|
|
# Begin! (passes gossipd-client fd)
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_init,1000
|
2017-12-18 07:44:10 +01:00
|
|
|
channel_init,,chain_hash,struct bitcoin_blkid
|
2017-12-18 07:41:52 +01:00
|
|
|
channel_init,,funding_txid,struct bitcoin_txid
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_init,,funding_txout,u16
|
2019-02-21 04:45:55 +01:00
|
|
|
channel_init,,funding_satoshi,struct amount_sat
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_init,,our_config,struct channel_config
|
|
|
|
channel_init,,their_config,struct channel_config
|
2017-11-21 04:44:35 +01:00
|
|
|
# FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here.
|
|
|
|
channel_init,,feerate_per_kw,2*u32
|
2017-11-21 06:26:59 +01:00
|
|
|
channel_init,,feerate_min,u32
|
|
|
|
channel_init,,feerate_max,u32
|
2018-12-03 00:15:06 +01:00
|
|
|
channel_init,,first_commit_sig,struct bitcoin_signature
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_init,,crypto_state,struct crypto_state
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_init,,remote_fundingkey,struct pubkey
|
2018-07-09 13:17:59 +02:00
|
|
|
channel_init,,remote_basepoints,struct basepoints
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_init,,remote_per_commit,struct pubkey
|
|
|
|
channel_init,,old_remote_per_commit,struct pubkey
|
2017-07-04 02:45:28 +02:00
|
|
|
channel_init,,funder,enum side
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_init,,fee_base,u32
|
|
|
|
channel_init,,fee_proportional,u32
|
2019-02-21 04:45:55 +01:00
|
|
|
channel_init,,local_msatoshi,struct amount_msat
|
2018-07-23 04:23:03 +02:00
|
|
|
channel_init,,our_basepoints,struct basepoints
|
|
|
|
channel_init,,our_funding_pubkey,struct pubkey
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_init,,local_node_id,struct pubkey
|
|
|
|
channel_init,,remote_node_id,struct pubkey
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_init,,commit_msec,u32
|
2017-10-11 06:32:15 +02:00
|
|
|
channel_init,,cltv_delta,u16
|
2017-06-20 08:03:03 +02:00
|
|
|
channel_init,,last_was_revoke,bool
|
|
|
|
channel_init,,num_last_sent_commit,u16
|
|
|
|
channel_init,,last_sent_commit,num_last_sent_commit*struct changed_htlc
|
2017-06-27 04:55:06 +02:00
|
|
|
channel_init,,next_index_local,u64
|
|
|
|
channel_init,,next_index_remote,u64
|
2017-06-20 08:04:03 +02:00
|
|
|
channel_init,,revocations_received,u64
|
|
|
|
channel_init,,next_htlc_id,u64
|
|
|
|
channel_init,,num_htlcs,u16
|
|
|
|
channel_init,,htlcs,num_htlcs*struct added_htlc
|
|
|
|
channel_init,,htlc_states,num_htlcs*enum htlc_state
|
2017-06-20 08:06:03 +02:00
|
|
|
channel_init,,num_fulfilled,u16
|
|
|
|
channel_init,,fulfilled,num_fulfilled*struct fulfilled_htlc
|
|
|
|
channel_init,,fulfilled_sides,num_fulfilled*enum side
|
|
|
|
channel_init,,num_failed,u16
|
|
|
|
channel_init,,failed,num_failed*struct failed_htlc
|
|
|
|
channel_init,,failed_sides,num_failed*enum side
|
2017-06-20 08:11:03 +02:00
|
|
|
channel_init,,local_funding_locked,bool
|
|
|
|
channel_init,,remote_funding_locked,bool
|
|
|
|
channel_init,,funding_short_id,struct short_channel_id
|
|
|
|
channel_init,,reestablish,bool
|
2018-03-07 01:06:07 +01:00
|
|
|
channel_init,,send_shutdown,bool
|
2017-07-04 02:47:32 +02:00
|
|
|
channel_init,,remote_shutdown_received,bool
|
2018-03-07 01:06:07 +01:00
|
|
|
channel_init,,final_scriptpubkey_len,u16
|
|
|
|
channel_init,,final_scriptpubkey,final_scriptpubkey_len*u8
|
2017-06-29 16:02:37 +02:00
|
|
|
channel_init,,flags,u8
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_init,,init_peer_pkt_len,u16
|
|
|
|
channel_init,,init_peer_pkt,init_peer_pkt_len*u8
|
2018-04-26 06:51:02 +02:00
|
|
|
channel_init,,reached_announce_depth,bool
|
2018-08-17 06:16:34 +02:00
|
|
|
channel_init,,last_remote_secret,struct secret
|
2018-12-10 02:03:42 +01:00
|
|
|
channel_init,,lflen,u16
|
|
|
|
channel_init,,localfeatures,lflen*u8
|
2017-03-07 02:26:12 +01:00
|
|
|
|
2018-05-17 07:08:11 +02:00
|
|
|
# master->channeld funding hit new depth >= lock depth
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_funding_locked,1002
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_funding_locked,,short_channel_id,struct short_channel_id
|
2018-05-17 07:08:11 +02:00
|
|
|
channel_funding_locked,,depth,u32
|
2017-03-29 13:01:15 +02:00
|
|
|
|
|
|
|
# Tell channel to offer this htlc
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_offer_htlc,1004
|
2019-02-21 04:45:55 +01:00
|
|
|
channel_offer_htlc,,amount_msat,struct amount_msat
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_offer_htlc,,cltv_expiry,u32
|
|
|
|
channel_offer_htlc,,payment_hash,struct sha256
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_offer_htlc,,onion_routing_packet,1366*u8
|
2017-03-29 13:01:15 +02:00
|
|
|
|
|
|
|
# Reply; synchronous since IDs have to increment.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_offer_htlc_reply,1104
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_offer_htlc_reply,,id,u64
|
2017-03-29 13:01:15 +02:00
|
|
|
# Zero failure code means success.
|
2017-09-28 05:41:19 +02:00
|
|
|
channel_offer_htlc_reply,,failure_code,u16
|
|
|
|
channel_offer_htlc_reply,,failurestrlen,u16
|
2017-05-25 04:16:04 +02:00
|
|
|
channel_offer_htlc_reply,,failurestr,failurestrlen*u8
|
2017-03-29 13:01:15 +02:00
|
|
|
|
2018-02-08 22:43:01 +01:00
|
|
|
# Main daemon found out the preimage for an HTLC
|
2017-03-29 13:01:15 +02:00
|
|
|
#include <bitcoin/preimage.h>
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_fulfill_htlc,1005
|
2018-07-26 23:26:37 +02:00
|
|
|
channel_fulfill_htlc,,fulfilled_htlc,struct fulfilled_htlc
|
2017-03-29 13:01:15 +02:00
|
|
|
|
|
|
|
# Main daemon says HTLC failed
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_fail_htlc,1006
|
2018-07-26 23:26:37 +02:00
|
|
|
channel_fail_htlc,,failed_htlc,struct failed_htlc
|
2017-03-29 13:01:15 +02:00
|
|
|
|
2017-06-20 07:55:03 +02:00
|
|
|
# When we receive funding_locked.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_funding_locked,1019
|
2017-06-20 07:55:03 +02:00
|
|
|
channel_got_funding_locked,,next_per_commit_point,struct pubkey
|
|
|
|
|
2017-06-20 07:50:03 +02:00
|
|
|
# When we send a commitment_signed message, tell master.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_sending_commitsig,1020
|
2017-06-20 07:50:03 +02:00
|
|
|
channel_sending_commitsig,,commitnum,u64
|
2017-11-21 06:26:59 +01:00
|
|
|
channel_sending_commitsig,,feerate,u32
|
2017-06-20 07:50:03 +02:00
|
|
|
# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
|
|
|
|
channel_sending_commitsig,,num_changed,u16
|
|
|
|
channel_sending_commitsig,,changed,num_changed*struct changed_htlc
|
2018-12-03 00:15:06 +01:00
|
|
|
channel_sending_commitsig,,commit_sig,struct bitcoin_signature
|
2017-06-20 08:08:03 +02:00
|
|
|
channel_sending_commitsig,,num_htlc_sigs,u16
|
|
|
|
channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature
|
2017-06-20 07:50:03 +02:00
|
|
|
|
|
|
|
# Wait for reply, to make sure it's on disk before we send commit.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_sending_commitsig_reply,1120
|
2017-06-20 07:50:03 +02:00
|
|
|
|
|
|
|
# When we have a commitment_signed message, tell master to remember.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_commitsig,1021
|
2017-06-20 07:50:03 +02:00
|
|
|
channel_got_commitsig,,commitnum,u64
|
2017-11-21 06:26:59 +01:00
|
|
|
channel_got_commitsig,,feerate,u32
|
2018-12-03 00:15:06 +01:00
|
|
|
channel_got_commitsig,,signature,struct bitcoin_signature
|
2017-06-20 07:50:03 +02:00
|
|
|
channel_got_commitsig,,num_htlcs,u16
|
|
|
|
channel_got_commitsig,,htlc_signature,num_htlcs*secp256k1_ecdsa_signature
|
|
|
|
# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
|
|
|
|
channel_got_commitsig,,num_added,u16
|
|
|
|
channel_got_commitsig,,added,num_added*struct added_htlc
|
2017-06-20 07:54:03 +02:00
|
|
|
channel_got_commitsig,,shared_secret,num_added*struct secret
|
2017-06-20 07:50:03 +02:00
|
|
|
# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
|
|
|
|
channel_got_commitsig,,num_fulfilled,u16
|
|
|
|
channel_got_commitsig,,fulfilled,num_fulfilled*struct fulfilled_htlc
|
|
|
|
channel_got_commitsig,,num_failed,u16
|
|
|
|
channel_got_commitsig,,failed,num_failed*struct failed_htlc
|
|
|
|
# RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT
|
|
|
|
channel_got_commitsig,,num_changed,u16
|
|
|
|
channel_got_commitsig,,changed,num_changed*struct changed_htlc
|
2017-08-18 06:43:52 +02:00
|
|
|
channel_got_commitsig,,tx,struct bitcoin_tx
|
2017-06-20 07:50:03 +02:00
|
|
|
|
|
|
|
# Wait for reply, to make sure it's on disk before we send revocation.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_commitsig_reply,1121
|
2017-06-20 07:50:03 +02:00
|
|
|
|
2017-08-28 18:05:01 +02:00
|
|
|
#include <common/htlc_wire.h>
|
2017-06-20 07:50:03 +02:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_revoke,1022
|
2017-06-20 07:50:03 +02:00
|
|
|
channel_got_revoke,,revokenum,u64
|
2018-07-09 13:17:58 +02:00
|
|
|
channel_got_revoke,,per_commitment_secret,struct secret
|
2017-06-20 07:55:03 +02:00
|
|
|
channel_got_revoke,,next_per_commit_point,struct pubkey
|
2017-06-20 07:54:03 +02:00
|
|
|
# RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION
|
2018-08-22 02:09:57 +02:00
|
|
|
channel_got_revoke,,feerate,u32
|
2017-06-20 07:50:03 +02:00
|
|
|
channel_got_revoke,,num_changed,u16
|
|
|
|
channel_got_revoke,,changed,num_changed*struct changed_htlc
|
|
|
|
# Wait for reply, to make sure it's on disk before we continue
|
|
|
|
# (eg. if we sent another commitment_signed, that would implicitly ack).
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_revoke_reply,1122
|
2017-06-26 03:16:43 +02:00
|
|
|
|
2018-03-07 01:06:07 +01:00
|
|
|
# Tell peer to shut down channel.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_send_shutdown,1023
|
2017-06-26 03:16:43 +02:00
|
|
|
|
|
|
|
# Peer told us that channel is shutting down
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_got_shutdown,1024
|
2017-06-26 03:16:43 +02:00
|
|
|
channel_got_shutdown,,scriptpubkey_len,u16
|
|
|
|
channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8
|
2017-07-04 02:47:32 +02:00
|
|
|
|
|
|
|
# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_shutdown_complete,1025
|
2017-07-04 02:47:32 +02:00
|
|
|
channel_shutdown_complete,,crypto_state,struct crypto_state
|
2017-09-26 06:57:31 +02:00
|
|
|
|
|
|
|
# Re-enable commit timer.
|
2017-09-26 23:02:48 +02:00
|
|
|
channel_dev_reenable_commit,1026
|
|
|
|
channel_dev_reenable_commit_reply,1126
|
2017-11-21 06:26:59 +01:00
|
|
|
|
|
|
|
channel_feerates,1027
|
|
|
|
channel_feerates,,feerate,u32
|
|
|
|
channel_feerates,,min_feerate,u32
|
|
|
|
channel_feerates,,max_feerate,u32
|
2018-08-17 07:06:35 +02:00
|
|
|
|
2018-11-22 03:17:29 +01:00
|
|
|
# master -> channeld: do you have a memleak?
|
|
|
|
channel_dev_memleak,1033
|
|
|
|
|
|
|
|
channel_dev_memleak_reply,1133
|
|
|
|
channel_dev_memleak_reply,,leak,bool
|
|
|
|
|
2018-08-17 07:06:35 +02:00
|
|
|
# Peer presented proof it was from the future.
|
|
|
|
channel_fail_fallen_behind,1028
|
|
|
|
channel_fail_fallen_behind,,remote_per_commitment_point,struct pubkey
|
|
|
|
|