From 32eaae0cb92ec84e0667df052d4dd3fca3f9cd58 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 23 Jul 2019 17:51:11 -0500 Subject: [PATCH] wire-gen: move in-house wire delcarations to new format tidying things up! --- Makefile | 2 +- channeld/Makefile | 4 +- channeld/channel_wire.csv | 280 ++++++++++---------- closingd/Makefile | 4 +- closingd/closing_wire.csv | 66 ++--- common/Makefile | 8 +- common/peer_status_wire.csv | 12 +- common/status_wire.csv | 30 +-- connectd/Makefile | 8 +- connectd/connect_gossip_wire.csv | 24 +- connectd/connect_wire.csv | 84 +++--- gossipd/Makefile | 12 +- gossipd/gossip_peerd_wire.csv | 38 +-- gossipd/gossip_store.csv | 10 +- gossipd/gossip_wire.csv | 210 +++++++-------- hsmd/Makefile | 4 +- hsmd/hsm_wire.csv | 277 +++++++++---------- lightningd/test/run-invoice-select-inchan.c | 2 +- onchaind/Makefile | 4 +- onchaind/onchain_wire.csv | 134 +++++----- openingd/Makefile | 4 +- openingd/opening_wire.csv | 194 +++++++------- tools/generate-bolts.py | 4 + 23 files changed, 710 insertions(+), 705 deletions(-) diff --git a/Makefile b/Makefile index 81ade2012..d750dbfd1 100644 --- a/Makefile +++ b/Makefile @@ -184,8 +184,8 @@ ALL_GEN_HEADERS += gen_version.h CDUMP_OBJS := ccan-cdump.o ccan-strmap.o -WIRE_GEN := tools/generate-wire.py BOLT_GEN := tools/generate-bolts.py +WIRE_GEN := $(BOLT_GEN) BOLT_DEPS := $(BOLT_GEN) ALL_PROGRAMS = diff --git a/channeld/Makefile b/channeld/Makefile index 6e3583c90..57e516fa9 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -103,10 +103,10 @@ channeld/gen_full_channel_error_names.h: channeld/full_channel_error.h ccan/ccan $(LIGHTNINGD_CHANNEL_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_GOSSIP_CONTROL_HEADERS) channeld/gen_channel_wire.h: $(WIRE_GEN) channeld/channel_wire.csv - $(WIRE_GEN) --header $@ channel_wire_type < channeld/channel_wire.csv > $@ + $(WIRE_GEN) --page header $@ channel_wire_type < channeld/channel_wire.csv > $@ channeld/gen_channel_wire.c: $(WIRE_GEN) channeld/channel_wire.csv - $(WIRE_GEN) ${@:.c=.h} channel_wire_type < channeld/channel_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} channel_wire_type < channeld/channel_wire.csv > $@ LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o) diff --git a/channeld/channel_wire.csv b/channeld/channel_wire.csv index 94c638e8c..3f9a3cbeb 100644 --- a/channeld/channel_wire.csv +++ b/channeld/channel_wire.csv @@ -4,192 +4,192 @@ #include # Begin! (passes gossipd-client fd) -channel_init,1000 -channel_init,,chain_hash,struct bitcoin_blkid -channel_init,,funding_txid,struct bitcoin_txid -channel_init,,funding_txout,u16 -channel_init,,funding_satoshi,struct amount_sat -channel_init,,minimum_depth,u32 -channel_init,,our_config,struct channel_config -channel_init,,their_config,struct channel_config -# FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here. -channel_init,,feerate_per_kw,2*u32 -channel_init,,feerate_min,u32 -channel_init,,feerate_max,u32 -channel_init,,first_commit_sig,struct bitcoin_signature -channel_init,,per_peer_state,struct per_peer_state -channel_init,,remote_fundingkey,struct pubkey -channel_init,,remote_basepoints,struct basepoints -channel_init,,remote_per_commit,struct pubkey -channel_init,,old_remote_per_commit,struct pubkey -channel_init,,funder,enum side -channel_init,,fee_base,u32 -channel_init,,fee_proportional,u32 -channel_init,,local_msatoshi,struct amount_msat -channel_init,,our_basepoints,struct basepoints -channel_init,,our_funding_pubkey,struct pubkey -channel_init,,local_node_id,struct node_id -channel_init,,remote_node_id,struct node_id -channel_init,,commit_msec,u32 -channel_init,,cltv_delta,u16 -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 -channel_init,,next_index_local,u64 -channel_init,,next_index_remote,u64 -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 -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 -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 -channel_init,,send_shutdown,bool -channel_init,,remote_shutdown_received,bool -channel_init,,final_scriptpubkey_len,u16 -channel_init,,final_scriptpubkey,final_scriptpubkey_len*u8 -channel_init,,flags,u8 -channel_init,,init_peer_pkt_len,u16 -channel_init,,init_peer_pkt,init_peer_pkt_len*u8 -channel_init,,reached_announce_depth,bool -channel_init,,last_remote_secret,struct secret -channel_init,,lflen,u16 -channel_init,,localfeatures,lflen*u8 -channel_init,,upfront_shutdown_script_len,u16 -channel_init,,upfront_shutdown_script,upfront_shutdown_script_len*u8 -channel_init,,remote_ann_node_sig,?secp256k1_ecdsa_signature -channel_init,,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature +msgtype,channel_init,1000 +msgdata,channel_init,chain_hash,bitcoin_blkid, +msgdata,channel_init,funding_txid,bitcoin_txid, +msgdata,channel_init,funding_txout,u16, +msgdata,channel_init,funding_satoshi,amount_sat, +msgdata,channel_init,minimum_depth,u32, +msgdata,channel_init,our_config,channel_config, +msgdata,channel_init,their_config,channel_config, +# FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here., +msgdata,channel_init,feerate_per_kw,u32,2 +msgdata,channel_init,feerate_min,u32, +msgdata,channel_init,feerate_max,u32, +msgdata,channel_init,first_commit_sig,bitcoin_signature, +msgdata,channel_init,per_peer_state,per_peer_state, +msgdata,channel_init,remote_fundingkey,pubkey, +msgdata,channel_init,remote_basepoints,basepoints, +msgdata,channel_init,remote_per_commit,pubkey, +msgdata,channel_init,old_remote_per_commit,pubkey, +msgdata,channel_init,funder,e:side, +msgdata,channel_init,fee_base,u32, +msgdata,channel_init,fee_proportional,u32, +msgdata,channel_init,local_msatoshi,amount_msat, +msgdata,channel_init,our_basepoints,basepoints, +msgdata,channel_init,our_funding_pubkey,pubkey, +msgdata,channel_init,local_node_id,node_id, +msgdata,channel_init,remote_node_id,node_id, +msgdata,channel_init,commit_msec,u32, +msgdata,channel_init,cltv_delta,u16, +msgdata,channel_init,last_was_revoke,bool, +msgdata,channel_init,num_last_sent_commit,u16, +msgdata,channel_init,last_sent_commit,changed_htlc,num_last_sent_commit +msgdata,channel_init,next_index_local,u64, +msgdata,channel_init,next_index_remote,u64, +msgdata,channel_init,revocations_received,u64, +msgdata,channel_init,next_htlc_id,u64, +msgdata,channel_init,num_htlcs,u16, +msgdata,channel_init,htlcs,added_htlc,num_htlcs +msgdata,channel_init,htlc_states,e:htlc_state,num_htlcs +msgdata,channel_init,num_fulfilled,u16, +msgdata,channel_init,fulfilled,fulfilled_htlc,num_fulfilled +msgdata,channel_init,fulfilled_sides,e:side,num_fulfilled +msgdata,channel_init,num_failed,u16, +msgdata,channel_init,failed,failed_htlc,num_failed +msgdata,channel_init,failed_sides,e:side,num_failed +msgdata,channel_init,local_funding_locked,bool, +msgdata,channel_init,remote_funding_locked,bool, +msgdata,channel_init,funding_short_id,short_channel_id, +msgdata,channel_init,reestablish,bool, +msgdata,channel_init,send_shutdown,bool, +msgdata,channel_init,remote_shutdown_received,bool, +msgdata,channel_init,final_scriptpubkey_len,u16, +msgdata,channel_init,final_scriptpubkey,u8,final_scriptpubkey_len +msgdata,channel_init,flags,u8, +msgdata,channel_init,init_peer_pkt_len,u16, +msgdata,channel_init,init_peer_pkt,u8,init_peer_pkt_len +msgdata,channel_init,reached_announce_depth,bool, +msgdata,channel_init,last_remote_secret,secret, +msgdata,channel_init,lflen,u16, +msgdata,channel_init,localfeatures,u8,lflen +msgdata,channel_init,upfront_shutdown_script_len,u16, +msgdata,channel_init,upfront_shutdown_script,u8,upfront_shutdown_script_len +msgdata,channel_init,remote_ann_node_sig,?secp256k1_ecdsa_signature, +msgdata,channel_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature, # master->channeld funding hit new depth(funding locked if >= lock depth) -channel_funding_depth,1002 -channel_funding_depth,,short_channel_id,?struct short_channel_id -channel_funding_depth,,depth,u32 +msgtype,channel_funding_depth,1002 +msgdata,channel_funding_depth,short_channel_id,?short_channel_id, +msgdata,channel_funding_depth,depth,u32, # Tell channel to offer this htlc -channel_offer_htlc,1004 -channel_offer_htlc,,amount_msat,struct amount_msat -channel_offer_htlc,,cltv_expiry,u32 -channel_offer_htlc,,payment_hash,struct sha256 -channel_offer_htlc,,onion_routing_packet,1366*u8 +msgtype,channel_offer_htlc,1004 +msgdata,channel_offer_htlc,amount_msat,amount_msat, +msgdata,channel_offer_htlc,cltv_expiry,u32, +msgdata,channel_offer_htlc,payment_hash,sha256, +msgdata,channel_offer_htlc,onion_routing_packet,u8,1366 # Reply; synchronous since IDs have to increment. -channel_offer_htlc_reply,1104 -channel_offer_htlc_reply,,id,u64 -# Zero failure code means success. -channel_offer_htlc_reply,,failure_code,u16 -channel_offer_htlc_reply,,failurestrlen,u16 -channel_offer_htlc_reply,,failurestr,failurestrlen*u8 +msgtype,channel_offer_htlc_reply,1104 +msgdata,channel_offer_htlc_reply,id,u64, +# Zero failure code means success., +msgdata,channel_offer_htlc_reply,failure_code,u16, +msgdata,channel_offer_htlc_reply,failurestrlen,u16, +msgdata,channel_offer_htlc_reply,failurestr,u8,failurestrlen # Main daemon found out the preimage for an HTLC #include -channel_fulfill_htlc,1005 -channel_fulfill_htlc,,fulfilled_htlc,struct fulfilled_htlc +msgtype,channel_fulfill_htlc,1005 +msgdata,channel_fulfill_htlc,fulfilled_htlc,fulfilled_htlc, # Main daemon says HTLC failed -channel_fail_htlc,1006 -channel_fail_htlc,,failed_htlc,struct failed_htlc +msgtype,channel_fail_htlc,1006 +msgdata,channel_fail_htlc,failed_htlc,failed_htlc, # When we receive funding_locked. -channel_got_funding_locked,1019 -channel_got_funding_locked,,next_per_commit_point,struct pubkey +msgtype,channel_got_funding_locked,1019 +msgdata,channel_got_funding_locked,next_per_commit_point,pubkey, # When we send a commitment_signed message, tell master. -channel_sending_commitsig,1020 -channel_sending_commitsig,,commitnum,u64 -channel_sending_commitsig,,feerate,u32 +msgtype,channel_sending_commitsig,1020 +msgdata,channel_sending_commitsig,commitnum,u64, +msgdata,channel_sending_commitsig,feerate,u32, # 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 -channel_sending_commitsig,,commit_sig,struct bitcoin_signature -channel_sending_commitsig,,num_htlc_sigs,u16 -channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature +msgdata,channel_sending_commitsig,num_changed,u16, +msgdata,channel_sending_commitsig,changed,changed_htlc,num_changed +msgdata,channel_sending_commitsig,commit_sig,bitcoin_signature, +msgdata,channel_sending_commitsig,num_htlc_sigs,u16, +msgdata,channel_sending_commitsig,htlc_sigs,secp256k1_ecdsa_signature,num_htlc_sigs # Wait for reply, to make sure it's on disk before we send commit. -channel_sending_commitsig_reply,1120 +msgtype,channel_sending_commitsig_reply,1120 # When we have a commitment_signed message, tell master to remember. -channel_got_commitsig,1021 -channel_got_commitsig,,commitnum,u64 -channel_got_commitsig,,feerate,u32 -channel_got_commitsig,,signature,struct bitcoin_signature -channel_got_commitsig,,num_htlcs,u16 -channel_got_commitsig,,htlc_signature,num_htlcs*secp256k1_ecdsa_signature +msgtype,channel_got_commitsig,1021 +msgdata,channel_got_commitsig,commitnum,u64, +msgdata,channel_got_commitsig,feerate,u32, +msgdata,channel_got_commitsig,signature,bitcoin_signature, +msgdata,channel_got_commitsig,num_htlcs,u16, +msgdata,channel_got_commitsig,htlc_signature,secp256k1_ecdsa_signature,num_htlcs # 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 -channel_got_commitsig,,shared_secret,num_added*struct secret +msgdata,channel_got_commitsig,num_added,u16, +msgdata,channel_got_commitsig,added,added_htlc,num_added +msgdata,channel_got_commitsig,shared_secret,secret,num_added # 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 +msgdata,channel_got_commitsig,num_fulfilled,u16, +msgdata,channel_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled +msgdata,channel_got_commitsig,num_failed,u16, +msgdata,channel_got_commitsig,failed,failed_htlc,num_failed # RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT -channel_got_commitsig,,num_changed,u16 -channel_got_commitsig,,changed,num_changed*struct changed_htlc -channel_got_commitsig,,tx,struct bitcoin_tx +msgdata,channel_got_commitsig,num_changed,u16, +msgdata,channel_got_commitsig,changed,changed_htlc,num_changed +msgdata,channel_got_commitsig,tx,bitcoin_tx, # Wait for reply, to make sure it's on disk before we send revocation. -channel_got_commitsig_reply,1121 +msgtype,channel_got_commitsig_reply,1121 #include -channel_got_revoke,1022 -channel_got_revoke,,revokenum,u64 -channel_got_revoke,,per_commitment_secret,struct secret -channel_got_revoke,,next_per_commit_point,struct pubkey +msgtype,channel_got_revoke,1022 +msgdata,channel_got_revoke,revokenum,u64, +msgdata,channel_got_revoke,per_commitment_secret,secret, +msgdata,channel_got_revoke,next_per_commit_point,pubkey, # RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION -channel_got_revoke,,feerate,u32 -channel_got_revoke,,num_changed,u16 -channel_got_revoke,,changed,num_changed*struct changed_htlc +msgdata,channel_got_revoke,feerate,u32, +msgdata,channel_got_revoke,num_changed,u16, +msgdata,channel_got_revoke,changed,changed_htlc,num_changed # Wait for reply, to make sure it's on disk before we continue # (eg. if we sent another commitment_signed, that would implicitly ack). -channel_got_revoke_reply,1122 +msgtype,channel_got_revoke_reply,1122 # Tell peer to shut down channel. -channel_send_shutdown,1023 +msgtype,channel_send_shutdown,1023 # Peer told us that channel is shutting down -channel_got_shutdown,1024 -channel_got_shutdown,,scriptpubkey_len,u16 -channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8 +msgtype,channel_got_shutdown,1024 +msgdata,channel_got_shutdown,scriptpubkey_len,u16, +msgdata,channel_got_shutdown,scriptpubkey,u8,scriptpubkey_len # Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd. -channel_shutdown_complete,1025 -channel_shutdown_complete,,per_peer_state,struct per_peer_state +msgtype,channel_shutdown_complete,1025 +msgdata,channel_shutdown_complete,per_peer_state,per_peer_state, # Re-enable commit timer. -channel_dev_reenable_commit,1026 -channel_dev_reenable_commit_reply,1126 +msgtype,channel_dev_reenable_commit,1026 +msgtype,channel_dev_reenable_commit_reply,1126, -channel_feerates,1027 -channel_feerates,,feerate,u32 -channel_feerates,,min_feerate,u32 -channel_feerates,,max_feerate,u32 +msgtype,channel_feerates,1027 +msgdata,channel_feerates,feerate,u32, +msgdata,channel_feerates,min_feerate,u32, +msgdata,channel_feerates,max_feerate,u32, # master -> channeld: do you have a memleak? -channel_dev_memleak,1033 +msgtype,channel_dev_memleak,1033 -channel_dev_memleak_reply,1133 -channel_dev_memleak_reply,,leak,bool +msgtype,channel_dev_memleak_reply,1133 +msgdata,channel_dev_memleak_reply,leak,bool, # Peer presented proof it was from the future. -channel_fail_fallen_behind,1028 -channel_fail_fallen_behind,,remote_per_commitment_point,struct pubkey +msgtype,channel_fail_fallen_behind,1028 +msgdata,channel_fail_fallen_behind,remote_per_commitment_point,pubkey, # Handle a channel specific feerate base ppm configuration -channel_specific_feerates,1029 -channel_specific_feerates,,feerate_base,u32 -channel_specific_feerates,,feerate_ppm,u32 +msgtype,channel_specific_feerates,1029 +msgdata,channel_specific_feerates,feerate_base,u32, +msgdata,channel_specific_feerates,feerate_ppm,u32, # When we receive announcement_signatures for channel announce -channel_got_announcement,1017 -channel_got_announcement,,remote_ann_node_sig,secp256k1_ecdsa_signature -channel_got_announcement,,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature +msgtype,channel_got_announcement,1017 +msgdata,channel_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature, +msgdata,channel_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature, diff --git a/closingd/Makefile b/closingd/Makefile index 56a296c84..02b27fa3f 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -80,10 +80,10 @@ CLOSINGD_COMMON_OBJS := \ hsmd/gen_hsm_wire.o closingd/gen_closing_wire.h: $(WIRE_GEN) closingd/closing_wire.csv - $(WIRE_GEN) --header $@ closing_wire_type < closingd/closing_wire.csv > $@ + $(WIRE_GEN) --page header $@ closing_wire_type < closingd/closing_wire.csv > $@ closingd/gen_closing_wire.c: $(WIRE_GEN) closingd/closing_wire.csv - $(WIRE_GEN) ${@:.c=.h} closing_wire_type < closingd/closing_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} closing_wire_type < closingd/closing_wire.csv > $@ LIGHTNINGD_CLOSING_OBJS := $(LIGHTNINGD_CLOSING_SRC:.c=.o) $(LIGHTNINGD_CLOSING_GEN_SRC:.c=.o) diff --git a/closingd/closing_wire.csv b/closingd/closing_wire.csv index 040b600d0..2f181776c 100644 --- a/closingd/closing_wire.csv +++ b/closingd/closing_wire.csv @@ -2,41 +2,41 @@ #include #include # Begin! (passes peer fd, gossipd-client fd) -closing_init,2001 -closing_init,,pps,struct per_peer_state -closing_init,,funding_txid,struct bitcoin_txid -closing_init,,funding_txout,u16 -closing_init,,funding_satoshi,struct amount_sat -closing_init,,local_fundingkey,struct pubkey -closing_init,,remote_fundingkey,struct pubkey -closing_init,,funder,enum side -closing_init,,local_sat,struct amount_sat -closing_init,,remote_sat,struct amount_sat -closing_init,,our_dust_limit,struct amount_sat -closing_init,,min_fee_satoshi,struct amount_sat -closing_init,,fee_limit_satoshi,struct amount_sat -closing_init,,initial_fee_satoshi,struct amount_sat -closing_init,,local_scriptpubkey_len,u16 -closing_init,,local_scriptpubkey,local_scriptpubkey_len*u8 -closing_init,,remote_scriptpubkey_len,u16 -closing_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8 -closing_init,,reconnected,bool -closing_init,,next_index_local,u64 -closing_init,,next_index_remote,u64 -closing_init,,revocations_received,u64 -closing_init,,channel_reestablish_len,u16 -closing_init,,channel_reestablish,channel_reestablish_len*u8 -closing_init,,final_scriptpubkey_len,u16 -closing_init,,final_scriptpubkey,final_scriptpubkey_len*u8 -closing_init,,last_remote_secret,struct secret +msgtype,closing_init,2001 +msgdata,closing_init,pps,per_peer_state, +msgdata,closing_init,funding_txid,bitcoin_txid, +msgdata,closing_init,funding_txout,u16, +msgdata,closing_init,funding_satoshi,amount_sat, +msgdata,closing_init,local_fundingkey,pubkey, +msgdata,closing_init,remote_fundingkey,pubkey, +msgdata,closing_init,funder,e:side, +msgdata,closing_init,local_sat,amount_sat, +msgdata,closing_init,remote_sat,amount_sat, +msgdata,closing_init,our_dust_limit,amount_sat, +msgdata,closing_init,min_fee_satoshi,amount_sat, +msgdata,closing_init,fee_limit_satoshi,amount_sat, +msgdata,closing_init,initial_fee_satoshi,amount_sat, +msgdata,closing_init,local_scriptpubkey_len,u16, +msgdata,closing_init,local_scriptpubkey,u8,local_scriptpubkey_len +msgdata,closing_init,remote_scriptpubkey_len,u16, +msgdata,closing_init,remote_scriptpubkey,u8,remote_scriptpubkey_len +msgdata,closing_init,reconnected,bool, +msgdata,closing_init,next_index_local,u64, +msgdata,closing_init,next_index_remote,u64, +msgdata,closing_init,revocations_received,u64, +msgdata,closing_init,channel_reestablish_len,u16, +msgdata,closing_init,channel_reestablish,u8,channel_reestablish_len +msgdata,closing_init,final_scriptpubkey_len,u16, +msgdata,closing_init,final_scriptpubkey,u8,final_scriptpubkey_len +msgdata,closing_init,last_remote_secret,secret, # We received an offer, save signature. -closing_received_signature,2002 -closing_received_signature,,signature,struct bitcoin_signature -closing_received_signature,,tx,struct bitcoin_tx +msgtype,closing_received_signature,2002 +msgdata,closing_received_signature,signature,bitcoin_signature, +msgdata,closing_received_signature,tx,bitcoin_tx, -closing_received_signature_reply,2102 -closing_received_signature_reply,,closing_txid,struct bitcoin_txid +msgtype,closing_received_signature_reply,2102 +msgdata,closing_received_signature_reply,closing_txid,bitcoin_txid, # Negotiations complete, we're exiting. -closing_complete,2004 +msgtype,closing_complete,2004 diff --git a/common/Makefile b/common/Makefile index b783b2f4d..232f92e77 100644 --- a/common/Makefile +++ b/common/Makefile @@ -80,16 +80,16 @@ common/gen_htlc_state_names.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-e ccan/ccan/cdump/tools/cdump-enumstr common/htlc_state.h > $@ common/gen_status_wire.h: $(WIRE_GEN) common/status_wire.csv - $(WIRE_GEN) --header $@ status < common/status_wire.csv > $@ + $(WIRE_GEN) --page header $@ status < common/status_wire.csv > $@ common/gen_status_wire.c: $(WIRE_GEN) common/status_wire.csv - $(WIRE_GEN) ${@:.c=.h} status < common/status_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} status < common/status_wire.csv > $@ common/gen_peer_status_wire.h: $(WIRE_GEN) common/peer_status_wire.csv - $(WIRE_GEN) --header $@ peer_status < common/peer_status_wire.csv > $@ + $(WIRE_GEN) --page header $@ peer_status < common/peer_status_wire.csv > $@ common/gen_peer_status_wire.c: $(WIRE_GEN) common/peer_status_wire.csv - $(WIRE_GEN) ${@:.c=.h} peer_status < common/peer_status_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} peer_status < common/peer_status_wire.csv > $@ check-makefile: check-common-makefile diff --git a/common/peer_status_wire.csv b/common/peer_status_wire.csv index 4134df089..19af5ef9d 100644 --- a/common/peer_status_wire.csv +++ b/common/peer_status_wire.csv @@ -1,10 +1,10 @@ #include # An error occurred: if error_for_them, that to go to them. -status_peer_error,0xFFF4 +msgtype,status_peer_error,0xFFF4 # This is implied if error_for_them, but master tries not to parse packets. -status_peer_error,,channel,struct channel_id -status_peer_error,,desc,wirestring -status_peer_error,,pps,struct per_peer_state -status_peer_error,,len,u16 -status_peer_error,,error_for_them,len*u8 +msgdata,status_peer_error,channel,channel_id, +msgdata,status_peer_error,desc,wirestring, +msgdata,status_peer_error,pps,per_peer_state, +msgdata,status_peer_error,len,u16, +msgdata,status_peer_error,error_for_them,u8,len diff --git a/common/status_wire.csv b/common/status_wire.csv index 33c9eb677..f10c0078d 100644 --- a/common/status_wire.csv +++ b/common/status_wire.csv @@ -1,23 +1,23 @@ #include #include -status_log,0xFFF0 -status_log,,level,enum log_level -status_log,,entry,wirestring +msgtype,status_log,0xFFF0 +msgdata,status_log,level,e:log_level, +msgdata,status_log,entry,wirestring, -status_io,0xFFF1 -status_io,,iodir,enum log_level -status_io,,who,wirestring -status_io,,len,u16 -status_io,,data,len*u8 +msgtype,status_io,0xFFF1 +msgdata,status_io,iodir,e:log_level, +msgdata,status_io,who,wirestring, +msgdata,status_io,len,u16, +msgdata,status_io,data,u8,len -status_fail,0xFFF2 -status_fail,,failreason,enum status_failreason -status_fail,,desc,wirestring +msgtype,status_fail,0xFFF2 +msgdata,status_fail,failreason,e:status_failreason, +msgdata,status_fail,desc,wirestring, -status_peer_connection_lost,0xFFF3 +msgtype,status_peer_connection_lost,0xFFF3 -status_peer_billboard,0xFFF5 -status_peer_billboard,,perm,bool -status_peer_billboard,,happenings,wirestring +msgtype,status_peer_billboard,0xFFF5 +msgdata,status_peer_billboard,perm,bool, +msgdata,status_peer_billboard,happenings,wirestring, # Note: 0xFFFF is reserved for MSG_PASS_FD! diff --git a/connectd/Makefile b/connectd/Makefile index e1e4c7dfb..e543f6a64 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -80,16 +80,16 @@ connectd-all: lightningd/lightning_connectd lightningd/lightning_connectd: $(LIGHTNINGD_CONNECT_OBJS) $(CONNECTD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) connectd/gen_connect_wire.h: $(WIRE_GEN) connectd/connect_wire.csv - $(WIRE_GEN) --header $@ connect_wire_type < connectd/connect_wire.csv > $@ + $(WIRE_GEN) --page header $@ connect_wire_type < connectd/connect_wire.csv > $@ connectd/gen_connect_wire.c: $(WIRE_GEN) connectd/connect_wire.csv - $(WIRE_GEN) ${@:.c=.h} connect_wire_type < connectd/connect_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} connect_wire_type < connectd/connect_wire.csv > $@ connectd/gen_connect_gossip_wire.h: $(WIRE_GEN) connectd/connect_gossip_wire.csv - $(WIRE_GEN) --header $@ connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@ + $(WIRE_GEN) --page header $@ connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@ connectd/gen_connect_gossip_wire.c: $(WIRE_GEN) connectd/connect_gossip_wire.csv - $(WIRE_GEN) ${@:.c=.h} connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@ check-source: $(LIGHTNINGD_CONNECT_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_CONNECT_ALLHEADERS_NOGEN:%=check-hdr-include-order/%) check-source-bolt: $(LIGHTNINGD_CONNECT_SRC:%=bolt-check/%) $(LIGHTNINGD_CONNECT_HEADERS:%=bolt-check/%) diff --git a/connectd/connect_gossip_wire.csv b/connectd/connect_gossip_wire.csv index ead76038e..4fdfeeea0 100644 --- a/connectd/connect_gossip_wire.csv +++ b/connectd/connect_gossip_wire.csv @@ -2,22 +2,22 @@ #include # Communication between gossipd and connectd. -gossip_new_peer,4000 -gossip_new_peer,,id,struct node_id +msgtype,gossip_new_peer,4000 +msgdata,gossip_new_peer,id,node_id, # Did we negotiate LOCAL_GOSSIP_QUERIES? -gossip_new_peer,,gossip_queries_feature,bool +msgdata,gossip_new_peer,gossip_queries_feature,bool, # Did they offer LOCAL_INITIAL_ROUTING_SYNC? -gossip_new_peer,,initial_routing_sync,bool +msgdata,gossip_new_peer,initial_routing_sync,bool, # if success: + gossip fd and gossip_store fd -gossip_new_peer_reply,4100 -gossip_new_peer_reply,,success,bool -gossip_new_peer_reply,,gs,?struct gossip_state +msgtype,gossip_new_peer_reply,4100 +msgdata,gossip_new_peer_reply,success,bool, +msgdata,gossip_new_peer_reply,gs,?gossip_state, # Connectd asks gossipd for any known addresses for that node. -gossip_get_addrs,4001 -gossip_get_addrs,,id,struct node_id +msgtype,gossip_get_addrs,4001 +msgdata,gossip_get_addrs,id,node_id, -gossip_get_addrs_reply,4101 -gossip_get_addrs_reply,,num,u16 -gossip_get_addrs_reply,,addrs,num*struct wireaddr +msgtype,gossip_get_addrs_reply,4101 +msgdata,gossip_get_addrs_reply,num,u16, +msgdata,gossip_get_addrs_reply,addrs,wireaddr,num diff --git a/connectd/connect_wire.csv b/connectd/connect_wire.csv index 26b0053c9..a20511719 100644 --- a/connectd/connect_wire.csv +++ b/connectd/connect_wire.csv @@ -3,65 +3,65 @@ #include #include -connectctl_init,2000 -connectctl_init,,id,struct node_id -connectctl_init,,num_wireaddrs,u16 -connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal -connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce -connectctl_init,,tor_proxyaddr,?struct wireaddr -connectctl_init,,use_tor_proxy_always,bool -connectctl_init,,dev_allow_localhost,bool -connectctl_init,,use_dns,bool -connectctl_init,,tor_password,wirestring +msgtype,connectctl_init,2000 +msgdata,connectctl_init,id,node_id, +msgdata,connectctl_init,num_wireaddrs,u16, +msgdata,connectctl_init,wireaddrs,wireaddr_internal,num_wireaddrs +msgdata,connectctl_init,listen_announce,e:addr_listen_announce,num_wireaddrs +msgdata,connectctl_init,tor_proxyaddr,?wireaddr, +msgdata,connectctl_init,use_tor_proxy_always,bool, +msgdata,connectctl_init,dev_allow_localhost,bool, +msgdata,connectctl_init,use_dns,bool, +msgdata,connectctl_init,tor_password,wirestring, # Connectd->master, here are the addresses I bound, can announce. -connectctl_init_reply,2100 -connectctl_init_reply,,num_bindings,u16 -connectctl_init_reply,,bindings,num_bindings*struct wireaddr_internal -connectctl_init_reply,,num_announcable,u16 -connectctl_init_reply,,announcable,num_announcable*struct wireaddr +msgtype,connectctl_init_reply,2100 +msgdata,connectctl_init_reply,num_bindings,u16, +msgdata,connectctl_init_reply,bindings,wireaddr_internal,num_bindings +msgdata,connectctl_init_reply,num_announcable,u16, +msgdata,connectctl_init_reply,announcable,wireaddr,num_announcable # Activate the connect daemon, so others can connect. -connectctl_activate,2025 +msgtype,connectctl_activate,2025 # Do we listen? -connectctl_activate,,listen,bool +msgdata,connectctl_activate,listen,bool, # Connectd->master, I am ready. -connectctl_activate_reply,2125 +msgtype,connectctl_activate_reply,2125 # connectd->master: disconnect this peer please (due to reconnect). -connect_reconnected,2112 -connect_reconnected,,id,struct node_id +msgtype,connect_reconnected,2112 +msgdata,connect_reconnected,id,node_id, # Master -> connectd: connect to a peer. -connectctl_connect_to_peer,2001 -connectctl_connect_to_peer,,id,struct node_id -connectctl_connect_to_peer,,seconds_waited,u32 -connectctl_connect_to_peer,,addrhint,?struct wireaddr_internal +msgtype,connectctl_connect_to_peer,2001 +msgdata,connectctl_connect_to_peer,id,node_id, +msgdata,connectctl_connect_to_peer,seconds_waited,u32, +msgdata,connectctl_connect_to_peer,addrhint,?wireaddr_internal, # Connectd->master: connect failed. -connectctl_connect_failed,2020 -connectctl_connect_failed,,id,struct node_id -connectctl_connect_failed,,failreason,wirestring -connectctl_connect_failed,,seconds_to_delay,u32 -connectctl_connect_failed,,addrhint,?struct wireaddr_internal +msgtype,connectctl_connect_failed,2020 +msgdata,connectctl_connect_failed,id,node_id, +msgdata,connectctl_connect_failed,failreason,wirestring, +msgdata,connectctl_connect_failed,seconds_to_delay,u32, +msgdata,connectctl_connect_failed,addrhint,?wireaddr_internal, # Connectd -> master: we got a peer. Three fds: peer, gossip and gossip_store -connect_peer_connected,2002 -connect_peer_connected,,id,struct node_id -connect_peer_connected,,addr,struct wireaddr_internal -connect_peer_connected,,pps,struct per_peer_state -connect_peer_connected,,gflen,u16 -connect_peer_connected,,globalfeatures,gflen*u8 -connect_peer_connected,,lflen,u16 -connect_peer_connected,,localfeatures,lflen*u8 +msgtype,connect_peer_connected,2002 +msgdata,connect_peer_connected,id,node_id, +msgdata,connect_peer_connected,addr,wireaddr_internal, +msgdata,connect_peer_connected,pps,per_peer_state, +msgdata,connect_peer_connected,gflen,u16, +msgdata,connect_peer_connected,globalfeatures,u8,gflen +msgdata,connect_peer_connected,lflen,u16, +msgdata,connect_peer_connected,localfeatures,u8,lflen # master -> connectd: peer has disconnected. -connectctl_peer_disconnected,2015 -connectctl_peer_disconnected,,id,struct node_id +msgtype,connectctl_peer_disconnected,2015 +msgdata,connectctl_peer_disconnected,id,node_id, # master -> connectd: do you have a memleak? -connect_dev_memleak,2033 +msgtype,connect_dev_memleak,2033 -connect_dev_memleak_reply,2133 -connect_dev_memleak_reply,,leak,bool +msgtype,connect_dev_memleak_reply,2133 +msgdata,connect_dev_memleak_reply,leak,bool, diff --git a/gossipd/Makefile b/gossipd/Makefile index b3f0461d6..5884a863b 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -81,22 +81,22 @@ gossipd-all: lightningd/lightning_gossipd $(LIGHTNINGD_GOSSIP_CLIENT_OBJS) lightningd/lightning_gossipd: $(LIGHTNINGD_GOSSIP_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS) gossipd/gen_gossip_wire.h: $(WIRE_GEN) gossipd/gossip_wire.csv - $(WIRE_GEN) --header $@ gossip_wire_type < gossipd/gossip_wire.csv > $@ + $(WIRE_GEN) --page header $@ gossip_wire_type < gossipd/gossip_wire.csv > $@ gossipd/gen_gossip_wire.c: $(WIRE_GEN) gossipd/gossip_wire.csv - $(WIRE_GEN) ${@:.c=.h} gossip_wire_type < gossipd/gossip_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} gossip_wire_type < gossipd/gossip_wire.csv > $@ gossipd/gen_gossip_peerd_wire.h: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv - $(WIRE_GEN) --header $@ gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ + $(WIRE_GEN) --page header $@ gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ gossipd/gen_gossip_peerd_wire.c: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv - $(WIRE_GEN) ${@:.c=.h} gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ gossipd/gen_gossip_store.h: $(WIRE_GEN) gossipd/gossip_store.csv - $(WIRE_GEN) --header $@ gossip_store_type < gossipd/gossip_store.csv > $@ + $(WIRE_GEN) --page header $@ gossip_store_type < gossipd/gossip_store.csv > $@ gossipd/gen_gossip_store.c: $(WIRE_GEN) gossipd/gossip_store.csv - $(WIRE_GEN) ${@:.c=.h} gossip_store_type < gossipd/gossip_store.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} gossip_store_type < gossipd/gossip_store.csv > $@ check-source: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN:%=check-hdr-include-order/%) diff --git a/gossipd/gossip_peerd_wire.csv b/gossipd/gossip_peerd_wire.csv index 30529e4df..774d3dcd4 100644 --- a/gossipd/gossip_peerd_wire.csv +++ b/gossipd/gossip_peerd_wire.csv @@ -1,33 +1,33 @@ # These must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs! # Channel daemon can ask for updates for a specific channel, for sending # errors. -gossipd_get_update,3501 -gossipd_get_update,,short_channel_id,struct short_channel_id +msgtype,gossipd_get_update,3501 +msgdata,gossipd_get_update,short_channel_id,short_channel_id, # If channel isn't known, update will be empty. -gossipd_get_update_reply,3601 -gossipd_get_update_reply,,len,u16 -gossipd_get_update_reply,,update,len*u8 +msgtype,gossipd_get_update_reply,3601 +msgdata,gossipd_get_update_reply,len,u16, +msgdata,gossipd_get_update_reply,update,u8,len # Both sides have seen the funding tx being locked, but we have not # yet reached the announcement depth. So we add the channel locally so # we (and peer) can update it already. -gossipd_local_add_channel,3503 -gossipd_local_add_channel,,short_channel_id,struct short_channel_id -gossipd_local_add_channel,,remote_node_id,struct node_id -gossipd_local_add_channel,,satoshis,struct amount_sat +msgtype,gossipd_local_add_channel,3503 +msgdata,gossipd_local_add_channel,short_channel_id,short_channel_id, +msgdata,gossipd_local_add_channel,remote_node_id,node_id, +msgdata,gossipd_local_add_channel,satoshis,amount_sat, # Send this channel_update. -gossipd_local_channel_update,3504 -gossipd_local_channel_update,,short_channel_id,struct short_channel_id -gossipd_local_channel_update,,disable,bool -gossipd_local_channel_update,,cltv_expiry_delta,u16 -gossipd_local_channel_update,,htlc_minimum_msat,struct amount_msat -gossipd_local_channel_update,,fee_base_msat,u32 -gossipd_local_channel_update,,fee_proportional_millionths,u32 -gossipd_local_channel_update,,htlc_maximum_msat,struct amount_msat +msgtype,gossipd_local_channel_update,3504 +msgdata,gossipd_local_channel_update,short_channel_id,short_channel_id, +msgdata,gossipd_local_channel_update,disable,bool, +msgdata,gossipd_local_channel_update,cltv_expiry_delta,u16, +msgdata,gossipd_local_channel_update,htlc_minimum_msat,amount_msat, +msgdata,gossipd_local_channel_update,fee_base_msat,u32, +msgdata,gossipd_local_channel_update,fee_proportional_millionths,u32, +msgdata,gossipd_local_channel_update,htlc_maximum_msat,amount_msat, # Update your gossip_store fd: + gossip_store_fd -gossipd_new_store_fd,3505 +msgtype,gossipd_new_store_fd,3505 # How much shorter the new store is, so you can offset streaming. -gossipd_new_store_fd,,offset_shorter,u64 +msgdata,gossipd_new_store_fd,offset_shorter,u64, diff --git a/gossipd/gossip_store.csv b/gossipd/gossip_store.csv index 3fd6e2a4c..ea61dafdc 100644 --- a/gossipd/gossip_store.csv +++ b/gossipd/gossip_store.csv @@ -3,9 +3,9 @@ # 256/257/258 or gossipd_local_add_channel (3503) # This always follows the channel_announce. -gossip_store_channel_amount,4101 -gossip_store_channel_amount,,satoshis,struct amount_sat +msgtype,gossip_store_channel_amount,4101 +msgdata,gossip_store_channel_amount,satoshis,amount_sat, -gossip_store_private_update,4102 -gossip_store_private_update,,len,u16 -gossip_store_private_update,,update,len*u8 +msgtype,gossip_store_private_update,4102 +msgdata,gossip_store_private_update,len,u16, +msgdata,gossip_store_private_update,update,u8,len diff --git a/gossipd/gossip_wire.csv b/gossipd/gossip_wire.csv index ac740ce09..63392d87b 100644 --- a/gossipd/gossip_wire.csv +++ b/gossipd/gossip_wire.csv @@ -3,160 +3,160 @@ #include # Initialize the gossip daemon. -gossipctl_init,3000 -gossipctl_init,,chain_hash,struct bitcoin_blkid -gossipctl_init,,id,struct node_id -gossipctl_init,,gflen,u16 -gossipctl_init,,globalfeatures,gflen*u8 -gossipctl_init,,rgb,3*u8 -gossipctl_init,,alias,32*u8 -gossipctl_init,,update_channel_interval,u32 -gossipctl_init,,num_announcable,u16 -gossipctl_init,,announcable,num_announcable*struct wireaddr -gossipctl_init,,dev_gossip_time,?u32 +msgtype,gossipctl_init,3000 +msgdata,gossipctl_init,chain_hash,bitcoin_blkid, +msgdata,gossipctl_init,id,node_id, +msgdata,gossipctl_init,gflen,u16, +msgdata,gossipctl_init,globalfeatures,u8,gflen +msgdata,gossipctl_init,rgb,u8,3 +msgdata,gossipctl_init,alias,u8,32 +msgdata,gossipctl_init,update_channel_interval,u32, +msgdata,gossipctl_init,num_announcable,u16, +msgdata,gossipctl_init,announcable,wireaddr,num_announcable +msgdata,gossipctl_init,dev_gossip_time,?u32, # Pass JSON-RPC getnodes call through -gossip_getnodes_request,3005 -gossip_getnodes_request,,id,?struct node_id +msgtype,gossip_getnodes_request,3005 +msgdata,gossip_getnodes_request,id,?node_id, #include -gossip_getnodes_reply,3105 -gossip_getnodes_reply,,num_nodes,u32 -gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry +msgtype,gossip_getnodes_reply,3105 +msgdata,gossip_getnodes_reply,num_nodes,u32, +msgdata,gossip_getnodes_reply,nodes,gossip_getnodes_entry,num_nodes # Pass JSON-RPC getroute call through -gossip_getroute_request,3006 +msgtype,gossip_getroute_request,3006 # Source defaults to "us", and means we don't consider first-hop channel fees -gossip_getroute_request,,source,?struct node_id -gossip_getroute_request,,destination,struct node_id -gossip_getroute_request,,msatoshi,struct amount_msat -# We don't pass doubles, so pass riskfactor * 1000000. -gossip_getroute_request,,riskfactor_by_million,u64 -gossip_getroute_request,,final_cltv,u32 -gossip_getroute_request,,fuzz,double -gossip_getroute_request,,num_excluded,u16 -gossip_getroute_request,,excluded,num_excluded*struct short_channel_id_dir -gossip_getroute_request,,max_hops,u32 - -gossip_getroute_reply,3106 -gossip_getroute_reply,,num_hops,u16 -gossip_getroute_reply,,hops,num_hops*struct route_hop - -gossip_getchannels_request,3007 -gossip_getchannels_request,,short_channel_id,?struct short_channel_id -gossip_getchannels_request,,source,?struct node_id -gossip_getchannels_request,,prev,?struct short_channel_id - -gossip_getchannels_reply,3107 -gossip_getchannels_reply,,complete,bool -gossip_getchannels_reply,,num_channels,u32 -gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry +msgdata,gossip_getroute_request,source,?node_id, +msgdata,gossip_getroute_request,destination,node_id, +msgdata,gossip_getroute_request,msatoshi,amount_msat, +# We don't pass doubles, so pass riskfactor 1000000. +msgdata,gossip_getroute_request,riskfactor_by_million,u64, +msgdata,gossip_getroute_request,final_cltv,u32, +msgdata,gossip_getroute_request,fuzz,double, +msgdata,gossip_getroute_request,num_excluded,u16, +msgdata,gossip_getroute_request,excluded,short_channel_id_dir,num_excluded +msgdata,gossip_getroute_request,max_hops,u32, + +msgtype,gossip_getroute_reply,3106 +msgdata,gossip_getroute_reply,num_hops,u16, +msgdata,gossip_getroute_reply,hops,route_hop,num_hops + +msgtype,gossip_getchannels_request,3007 +msgdata,gossip_getchannels_request,short_channel_id,?short_channel_id, +msgdata,gossip_getchannels_request,source,?node_id, +msgdata,gossip_getchannels_request,prev,?short_channel_id, + +msgtype,gossip_getchannels_reply,3107 +msgdata,gossip_getchannels_reply,complete,bool, +msgdata,gossip_getchannels_reply,num_channels,u32, +msgdata,gossip_getchannels_reply,nodes,gossip_getchannels_entry,num_channels # Ping/pong test. Waits for a reply if it expects one. -gossip_ping,3008 -gossip_ping,,id,struct node_id -gossip_ping,,num_pong_bytes,u16 -gossip_ping,,len,u16 +msgtype,gossip_ping,3008 +msgdata,gossip_ping,id,node_id, +msgdata,gossip_ping,num_pong_bytes,u16, +msgdata,gossip_ping,len,u16, -gossip_ping_reply,3108 -gossip_ping_reply,,id,struct node_id +msgtype,gossip_ping_reply,3108 +msgdata,gossip_ping_reply,id,node_id, # False if id in gossip_ping was unknown. -gossip_ping_reply,,sent,bool +msgdata,gossip_ping_reply,sent,bool, # 0 == no pong expected -gossip_ping_reply,,totlen,u16 +msgdata,gossip_ping_reply,totlen,u16, # Test of query_short_channel_ids. Master->gossipd -gossip_query_scids,3031 -gossip_query_scids,,id,struct node_id -gossip_query_scids,,num_ids,u16 -gossip_query_scids,,ids,num_ids*struct short_channel_id +msgtype,gossip_query_scids,3031 +msgdata,gossip_query_scids,id,node_id, +msgdata,gossip_query_scids,num_ids,u16, +msgdata,gossip_query_scids,ids,short_channel_id,num_ids # Gossipd -> master -gossip_scids_reply,3131 -gossip_scids_reply,,ok,bool -gossip_scids_reply,,complete,bool +msgtype,gossip_scids_reply,3131 +msgdata,gossip_scids_reply,ok,bool, +msgdata,gossip_scids_reply,complete,bool, # Test gossip timestamp filtering. -gossip_send_timestamp_filter,3028 -gossip_send_timestamp_filter,,id,struct node_id -gossip_send_timestamp_filter,,first_timestamp,u32 -gossip_send_timestamp_filter,,timestamp_range,u32 +msgtype,gossip_send_timestamp_filter,3028 +msgdata,gossip_send_timestamp_filter,id,node_id, +msgdata,gossip_send_timestamp_filter,first_timestamp,u32, +msgdata,gossip_send_timestamp_filter,timestamp_range,u32, # Test of query_channel_range. Master->gossipd -gossip_query_channel_range,3029 -gossip_query_channel_range,,id,struct node_id -gossip_query_channel_range,,first_blocknum,u32 -gossip_query_channel_range,,number_of_blocks,u32 +msgtype,gossip_query_channel_range,3029 +msgdata,gossip_query_channel_range,id,node_id, +msgdata,gossip_query_channel_range,first_blocknum,u32, +msgdata,gossip_query_channel_range,number_of_blocks,u32, # Gossipd -> master -gossip_query_channel_range_reply,3129 -gossip_query_channel_range_reply,,final_first_block,u32 -gossip_query_channel_range_reply,,final_num_blocks,u32 -gossip_query_channel_range_reply,,final_complete,bool -gossip_query_channel_range_reply,,num,u16 -gossip_query_channel_range_reply,,scids,num*struct short_channel_id +msgtype,gossip_query_channel_range_reply,3129 +msgdata,gossip_query_channel_range_reply,final_first_block,u32, +msgdata,gossip_query_channel_range_reply,final_num_blocks,u32, +msgdata,gossip_query_channel_range_reply,final_complete,bool, +msgdata,gossip_query_channel_range_reply,num,u16, +msgdata,gossip_query_channel_range_reply,scids,short_channel_id,num # Set artificial maximum reply_channel_range size. Master->gossipd -gossip_dev_set_max_scids_encode_size,3030 -gossip_dev_set_max_scids_encode_size,,max,u32 +msgtype,gossip_dev_set_max_scids_encode_size,3030 +msgdata,gossip_dev_set_max_scids_encode_size,max,u32, # Given a short_channel_id, return the other endpoint (or none if DNE) -gossip_get_channel_peer,3009 -gossip_get_channel_peer,,channel_id,struct short_channel_id +msgtype,gossip_get_channel_peer,3009 +msgdata,gossip_get_channel_peer,channel_id,short_channel_id, -gossip_get_channel_peer_reply,3109 -gossip_get_channel_peer_reply,,peer_id,?struct node_id +msgtype,gossip_get_channel_peer_reply,3109 +msgdata,gossip_get_channel_peer_reply,peer_id,?node_id, # gossipd->master: we're closing this channel. -gossip_local_channel_close,3027 -gossip_local_channel_close,,short_channel_id,struct short_channel_id +msgtype,gossip_local_channel_close,3027 +msgdata,gossip_local_channel_close,short_channel_id,short_channel_id, # Gossipd->master get this tx output please. -gossip_get_txout,3018 -gossip_get_txout,,short_channel_id,struct short_channel_id +msgtype,gossip_get_txout,3018 +msgdata,gossip_get_txout,short_channel_id,short_channel_id, # master->gossipd here is the output, or empty if none. -gossip_get_txout_reply,3118 -gossip_get_txout_reply,,short_channel_id,struct short_channel_id -gossip_get_txout_reply,,satoshis,struct amount_sat -gossip_get_txout_reply,,len,u16 -gossip_get_txout_reply,,outscript,len*u8 +msgtype,gossip_get_txout_reply,3118 +msgdata,gossip_get_txout_reply,short_channel_id,short_channel_id, +msgdata,gossip_get_txout_reply,satoshis,amount_sat, +msgdata,gossip_get_txout_reply,len,u16, +msgdata,gossip_get_txout_reply,outscript,u8,len # master->gossipd an htlc failed with this onion error. -gossip_payment_failure,3021 -gossip_payment_failure,,erring_node,struct node_id -gossip_payment_failure,,erring_channel,struct short_channel_id -gossip_payment_failure,,erring_channel_direction,u8 -gossip_payment_failure,,len,u16 -gossip_payment_failure,,error,len*u8 +msgtype,gossip_payment_failure,3021 +msgdata,gossip_payment_failure,erring_node,node_id, +msgdata,gossip_payment_failure,erring_channel,short_channel_id, +msgdata,gossip_payment_failure,erring_channel_direction,u8, +msgdata,gossip_payment_failure,len,u16, +msgdata,gossip_payment_failure,error,u8,len # master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel -gossip_outpoint_spent,3024 -gossip_outpoint_spent,,short_channel_id,struct short_channel_id +msgtype,gossip_outpoint_spent,3024 +msgdata,gossip_outpoint_spent,short_channel_id,short_channel_id, # master -> gossipd: stop gossip timers. -gossip_dev_suppress,3032 +msgtype,gossip_dev_suppress,3032 # master -> gossipd: do you have a memleak? -gossip_dev_memleak,3033 +msgtype,gossip_dev_memleak,3033 -gossip_dev_memleak_reply,3133 -gossip_dev_memleak_reply,,leak,bool +msgtype,gossip_dev_memleak_reply,3133 +msgdata,gossip_dev_memleak_reply,leak,bool, # master -> gossipd: please rewrite the gossip_store -gossip_dev_compact_store,3034 +msgtype,gossip_dev_compact_store,3034 # gossipd -> master: ok -gossip_dev_compact_store_reply,3134 -gossip_dev_compact_store_reply,,success,bool +msgtype,gossip_dev_compact_store_reply,3134 +msgdata,gossip_dev_compact_store_reply,success,bool, #include # master -> gossipd: get route_info for our incoming channels -gossip_get_incoming_channels,3025 -gossip_get_incoming_channels,,private_too,?bool +msgtype,gossip_get_incoming_channels,3025 +msgdata,gossip_get_incoming_channels,private_too,?bool, # gossipd -> master: here they are. -gossip_get_incoming_channels_reply,3125 -gossip_get_incoming_channels_reply,,num,u16 -gossip_get_incoming_channels_reply,,route_info,num*struct route_info +msgtype,gossip_get_incoming_channels_reply,3125 +msgdata,gossip_get_incoming_channels_reply,num,u16, +msgdata,gossip_get_incoming_channels_reply,route_info,route_info,num diff --git a/hsmd/Makefile b/hsmd/Makefile index 8a5472c91..7e2ceed27 100644 --- a/hsmd/Makefile +++ b/hsmd/Makefile @@ -51,10 +51,10 @@ hsmd-all: lightningd/lightning_hsmd lightningd/lightning_hsmd: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) hsmd/gen_hsm_wire.h: $(WIRE_GEN) hsmd/hsm_wire.csv - $(WIRE_GEN) --header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@ + $(WIRE_GEN) --page header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@ hsmd/gen_hsm_wire.c: $(WIRE_GEN) hsmd/hsm_wire.csv - $(WIRE_GEN) ${@:.c=.h} hsm_wire_type < hsmd/hsm_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} hsm_wire_type < hsmd/hsm_wire.csv > $@ check-source: $(LIGHTNINGD_HSM_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_HSM_ALLHEADERS_NOGEN:%=check-hdr-include-order/%) check-source-bolt: $(LIGHTNINGD_HSM_SRC:%=bolt-check/%) diff --git a/hsmd/hsm_wire.csv b/hsmd/hsm_wire.csv index ecc56d604..5f1a2487f 100644 --- a/hsmd/hsm_wire.csv +++ b/hsmd/hsm_wire.csv @@ -1,197 +1,198 @@ # Clients should not give a bad request but not the HSM's decision to crash. -hsmstatus_client_bad_request,1000 -hsmstatus_client_bad_request,,id,struct node_id -hsmstatus_client_bad_request,,description,wirestring -hsmstatus_client_bad_request,,len,u16 -hsmstatus_client_bad_request,,msg,len*u8 +msgtype,hsmstatus_client_bad_request,1000 +msgdata,hsmstatus_client_bad_request,id,node_id, +msgdata,hsmstatus_client_bad_request,description,wirestring, +msgdata,hsmstatus_client_bad_request,len,u16, +msgdata,hsmstatus_client_bad_request,msg,u8,len #include # Start the HSM. -hsm_init,11 -hsm_init,,bip32_key_version,struct bip32_key_version -hsm_init,,dev_force_privkey,?struct privkey -hsm_init,,dev_force_bip32_seed,?struct secret -hsm_init,,dev_force_channel_secrets,?struct secrets -hsm_init,,dev_force_channel_secrets_shaseed,?struct sha256 +msgtype,hsm_init,11 +msgdata,hsm_init,bip32_key_version,bip32_key_version, +msgdata,hsm_init,dev_force_privkey,?privkey, +msgdata,hsm_init,dev_force_bip32_seed,?secret, +msgdata,hsm_init,dev_force_channel_secrets,?secrets, +msgdata,hsm_init,dev_force_channel_secrets_shaseed,?sha256, #include -hsm_init_reply,111 -hsm_init_reply,,node_id,struct node_id -hsm_init_reply,,bip32,struct ext_key +msgtype,hsm_init_reply,111 +msgdata,hsm_init_reply,node_id,node_id, +msgdata,hsm_init_reply,bip32,ext_key, # Get a new HSM FD, with the specified capabilities -hsm_client_hsmfd,9 -hsm_client_hsmfd,,id,struct node_id # Which identity to use for requests +msgtype,hsm_client_hsmfd,9 +# Which identity to use for requests +msgdata,hsm_client_hsmfd,id,node_id, # Database id for this client, if any. -hsm_client_hsmfd,,dbid,u64 -hsm_client_hsmfd,,capabilities,u64 +msgdata,hsm_client_hsmfd,dbid,u64, +msgdata,hsm_client_hsmfd,capabilities,u64, # No content, just an fd. -hsm_client_hsmfd_reply,109 +msgtype,hsm_client_hsmfd_reply,109 #include # Get the basepoints and funding key for this specific channel. -hsm_get_channel_basepoints,10 -hsm_get_channel_basepoints,,peerid,struct node_id -hsm_get_channel_basepoints,,dbid,u64 +msgtype,hsm_get_channel_basepoints,10 +msgdata,hsm_get_channel_basepoints,peerid,node_id, +msgdata,hsm_get_channel_basepoints,dbid,u64, -hsm_get_channel_basepoints_reply,110 -hsm_get_channel_basepoints_reply,,basepoints,struct basepoints -hsm_get_channel_basepoints_reply,,funding_pubkey,struct pubkey +msgtype,hsm_get_channel_basepoints_reply,110 +msgdata,hsm_get_channel_basepoints_reply,basepoints,basepoints, +msgdata,hsm_get_channel_basepoints_reply,funding_pubkey,pubkey, # Return signature for a funding tx. #include # FIXME: This should also take their commit sig & details, to verify. -hsm_sign_funding,4 -hsm_sign_funding,,satoshi_out,struct amount_sat -hsm_sign_funding,,change_out,struct amount_sat -hsm_sign_funding,,change_keyindex,u32 -hsm_sign_funding,,our_pubkey,struct pubkey -hsm_sign_funding,,their_pubkey,struct pubkey -hsm_sign_funding,,num_inputs,u16 -hsm_sign_funding,,inputs,num_inputs*struct utxo - -hsm_sign_funding_reply,104 -hsm_sign_funding_reply,,tx,struct bitcoin_tx +msgtype,hsm_sign_funding,4 +msgdata,hsm_sign_funding,satoshi_out,amount_sat, +msgdata,hsm_sign_funding,change_out,amount_sat, +msgdata,hsm_sign_funding,change_keyindex,u32, +msgdata,hsm_sign_funding,our_pubkey,pubkey, +msgdata,hsm_sign_funding,their_pubkey,pubkey, +msgdata,hsm_sign_funding,num_inputs,u16, +msgdata,hsm_sign_funding,inputs,utxo,num_inputs + +msgtype,hsm_sign_funding_reply,104 +msgdata,hsm_sign_funding_reply,tx,bitcoin_tx, # Master asks the HSM to sign a node_announcement -hsm_node_announcement_sig_req,6 -hsm_node_announcement_sig_req,,annlen,u16 -hsm_node_announcement_sig_req,,announcement,annlen*u8 +msgtype,hsm_node_announcement_sig_req,6 +msgdata,hsm_node_announcement_sig_req,annlen,u16, +msgdata,hsm_node_announcement_sig_req,announcement,u8,annlen -hsm_node_announcement_sig_reply,106 -hsm_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature +msgtype,hsm_node_announcement_sig_reply,106 +msgdata,hsm_node_announcement_sig_reply,signature,secp256k1_ecdsa_signature, # Sign a withdrawal request -hsm_sign_withdrawal,7 -hsm_sign_withdrawal,,satoshi_out,struct amount_sat -hsm_sign_withdrawal,,change_out,struct amount_sat -hsm_sign_withdrawal,,change_keyindex,u32 -hsm_sign_withdrawal,,scriptpubkey_len,u16 -hsm_sign_withdrawal,,scriptpubkey,scriptpubkey_len*u8 -hsm_sign_withdrawal,,num_inputs,u16 -hsm_sign_withdrawal,,inputs,num_inputs*struct utxo - -hsm_sign_withdrawal_reply,107 -hsm_sign_withdrawal_reply,,tx,struct bitcoin_tx +msgtype,hsm_sign_withdrawal,7 +msgdata,hsm_sign_withdrawal,satoshi_out,amount_sat, +msgdata,hsm_sign_withdrawal,change_out,amount_sat, +msgdata,hsm_sign_withdrawal,change_keyindex,u32, +msgdata,hsm_sign_withdrawal,scriptpubkey_len,u16, +msgdata,hsm_sign_withdrawal,scriptpubkey,u8,scriptpubkey_len +msgdata,hsm_sign_withdrawal,num_inputs,u16, +msgdata,hsm_sign_withdrawal,inputs,utxo,num_inputs + +msgtype,hsm_sign_withdrawal_reply,107 +msgdata,hsm_sign_withdrawal_reply,tx,bitcoin_tx, # Sign an invoice -hsm_sign_invoice,8 -hsm_sign_invoice,,len,u16 -hsm_sign_invoice,,u5bytes,len*u8 -hsm_sign_invoice,,hrplen,u16 -hsm_sign_invoice,,hrp,hrplen*u8 +msgtype,hsm_sign_invoice,8 +msgdata,hsm_sign_invoice,len,u16, +msgdata,hsm_sign_invoice,u5bytes,u8,len +msgdata,hsm_sign_invoice,hrplen,u16, +msgdata,hsm_sign_invoice,hrp,u8,hrplen -hsm_sign_invoice_reply,108 -hsm_sign_invoice_reply,,sig,secp256k1_ecdsa_recoverable_signature +msgtype,hsm_sign_invoice_reply,108 +msgdata,hsm_sign_invoice_reply,sig,secp256k1_ecdsa_recoverable_signature, # Give me ECDH(node-id-secret,point) -hsm_ecdh_req,1 -hsm_ecdh_req,,point,struct pubkey -hsm_ecdh_resp,100 -hsm_ecdh_resp,,ss,struct secret +msgtype,hsm_ecdh_req,1 +msgdata,hsm_ecdh_req,point,pubkey, +msgtype,hsm_ecdh_resp,100 +msgdata,hsm_ecdh_resp,ss,secret, -hsm_cannouncement_sig_req,2 -hsm_cannouncement_sig_req,,calen,u16 -hsm_cannouncement_sig_req,,ca,calen*u8 +msgtype,hsm_cannouncement_sig_req,2 +msgdata,hsm_cannouncement_sig_req,calen,u16, +msgdata,hsm_cannouncement_sig_req,ca,u8,calen -hsm_cannouncement_sig_reply,102 -hsm_cannouncement_sig_reply,,node_signature,secp256k1_ecdsa_signature -hsm_cannouncement_sig_reply,,bitcoin_signature,secp256k1_ecdsa_signature +msgtype,hsm_cannouncement_sig_reply,102 +msgdata,hsm_cannouncement_sig_reply,node_signature,secp256k1_ecdsa_signature, +msgdata,hsm_cannouncement_sig_reply,bitcoin_signature,secp256k1_ecdsa_signature, -hsm_cupdate_sig_req,3 -hsm_cupdate_sig_req,,culen,u16 -hsm_cupdate_sig_req,,cu,culen*u8 +msgtype,hsm_cupdate_sig_req,3 +msgdata,hsm_cupdate_sig_req,culen,u16, +msgdata,hsm_cupdate_sig_req,cu,u8,culen -hsm_cupdate_sig_reply,103 -hsm_cupdate_sig_reply,,culen,u16 -hsm_cupdate_sig_reply,,cu,culen*u8 +msgtype,hsm_cupdate_sig_reply,103 +msgdata,hsm_cupdate_sig_reply,culen,u16, +msgdata,hsm_cupdate_sig_reply,cu,u8,culen # Master asks HSM to sign a commitment transaction. -hsm_sign_commitment_tx,5 -hsm_sign_commitment_tx,,peer_id,struct node_id -hsm_sign_commitment_tx,,channel_dbid,u64 -hsm_sign_commitment_tx,,tx,struct bitcoin_tx -hsm_sign_commitment_tx,,remote_funding_key,struct pubkey -hsm_sign_commitment_tx,,funding_amount,struct amount_sat +msgtype,hsm_sign_commitment_tx,5 +msgdata,hsm_sign_commitment_tx,peer_id,node_id, +msgdata,hsm_sign_commitment_tx,channel_dbid,u64, +msgdata,hsm_sign_commitment_tx,tx,bitcoin_tx, +msgdata,hsm_sign_commitment_tx,remote_funding_key,pubkey, +msgdata,hsm_sign_commitment_tx,funding_amount,amount_sat, -hsm_sign_commitment_tx_reply,105 -hsm_sign_commitment_tx_reply,,sig,struct bitcoin_signature +msgtype,hsm_sign_commitment_tx_reply,105 +msgdata,hsm_sign_commitment_tx_reply,sig,bitcoin_signature, # Onchaind asks HSM to sign a spend to-us. Four variants, since each set # of keys is derived differently... # FIXME: Have master tell hsmd the keyindex, so it can validate output! -hsm_sign_delayed_payment_to_us,12 -hsm_sign_delayed_payment_to_us,,commit_num,u64 -hsm_sign_delayed_payment_to_us,,tx,struct bitcoin_tx -hsm_sign_delayed_payment_to_us,,wscript_len,u16 -hsm_sign_delayed_payment_to_us,,wscript,wscript_len*u8 -hsm_sign_delayed_payment_to_us,,input_amount,struct amount_sat - -hsm_sign_remote_htlc_to_us,13 -hsm_sign_remote_htlc_to_us,,remote_per_commitment_point,struct pubkey -hsm_sign_remote_htlc_to_us,,tx,struct bitcoin_tx -hsm_sign_remote_htlc_to_us,,wscript_len,u16 -hsm_sign_remote_htlc_to_us,,wscript,wscript_len*u8 -hsm_sign_remote_htlc_to_us,,input_amount,struct amount_sat - -hsm_sign_penalty_to_us,14 -hsm_sign_penalty_to_us,,revocation_secret,struct secret -hsm_sign_penalty_to_us,,tx,struct bitcoin_tx -hsm_sign_penalty_to_us,,wscript_len,u16 -hsm_sign_penalty_to_us,,wscript,wscript_len*u8 -hsm_sign_penalty_to_us,,input_amount,struct amount_sat +msgtype,hsm_sign_delayed_payment_to_us,12 +msgdata,hsm_sign_delayed_payment_to_us,commit_num,u64, +msgdata,hsm_sign_delayed_payment_to_us,tx,bitcoin_tx, +msgdata,hsm_sign_delayed_payment_to_us,wscript_len,u16, +msgdata,hsm_sign_delayed_payment_to_us,wscript,u8,wscript_len +msgdata,hsm_sign_delayed_payment_to_us,input_amount,amount_sat, + +msgtype,hsm_sign_remote_htlc_to_us,13 +msgdata,hsm_sign_remote_htlc_to_us,remote_per_commitment_point,pubkey, +msgdata,hsm_sign_remote_htlc_to_us,tx,bitcoin_tx, +msgdata,hsm_sign_remote_htlc_to_us,wscript_len,u16, +msgdata,hsm_sign_remote_htlc_to_us,wscript,u8,wscript_len +msgdata,hsm_sign_remote_htlc_to_us,input_amount,amount_sat, + +msgtype,hsm_sign_penalty_to_us,14 +msgdata,hsm_sign_penalty_to_us,revocation_secret,secret, +msgdata,hsm_sign_penalty_to_us,tx,bitcoin_tx, +msgdata,hsm_sign_penalty_to_us,wscript_len,u16, +msgdata,hsm_sign_penalty_to_us,wscript,u8,wscript_len +msgdata,hsm_sign_penalty_to_us,input_amount,amount_sat, # Onchaind asks HSM to sign a local HTLC success or HTLC timeout tx. -hsm_sign_local_htlc_tx,16 -hsm_sign_local_htlc_tx,,commit_num,u64 -hsm_sign_local_htlc_tx,,tx,struct bitcoin_tx -hsm_sign_local_htlc_tx,,wscript_len,u16 -hsm_sign_local_htlc_tx,,wscript,wscript_len*u8 -hsm_sign_local_htlc_tx,,input_amount,struct amount_sat +msgtype,hsm_sign_local_htlc_tx,16 +msgdata,hsm_sign_local_htlc_tx,commit_num,u64, +msgdata,hsm_sign_local_htlc_tx,tx,bitcoin_tx, +msgdata,hsm_sign_local_htlc_tx,wscript_len,u16, +msgdata,hsm_sign_local_htlc_tx,wscript,u8,wscript_len +msgdata,hsm_sign_local_htlc_tx,input_amount,amount_sat, # Openingd/channeld asks HSM to sign the other sides' commitment tx. -hsm_sign_remote_commitment_tx,19 -hsm_sign_remote_commitment_tx,,tx,struct bitcoin_tx -hsm_sign_remote_commitment_tx,,remote_funding_key,struct pubkey -hsm_sign_remote_commitment_tx,,funding_amount,struct amount_sat +msgtype,hsm_sign_remote_commitment_tx,19 +msgdata,hsm_sign_remote_commitment_tx,tx,bitcoin_tx, +msgdata,hsm_sign_remote_commitment_tx,remote_funding_key,pubkey, +msgdata,hsm_sign_remote_commitment_tx,funding_amount,amount_sat, # channeld asks HSM to sign remote HTLC tx. -hsm_sign_remote_htlc_tx,20 -hsm_sign_remote_htlc_tx,,tx,struct bitcoin_tx -hsm_sign_remote_htlc_tx,,len,u16 -hsm_sign_remote_htlc_tx,,wscript,len*u8 -hsm_sign_remote_htlc_tx,,amounts_satoshi,struct amount_sat -hsm_sign_remote_htlc_tx,,remote_per_commit_point,struct pubkey +msgtype,hsm_sign_remote_htlc_tx,20 +msgdata,hsm_sign_remote_htlc_tx,tx,bitcoin_tx, +msgdata,hsm_sign_remote_htlc_tx,len,u16, +msgdata,hsm_sign_remote_htlc_tx,wscript,u8,len +msgdata,hsm_sign_remote_htlc_tx,amounts_satoshi,amount_sat, +msgdata,hsm_sign_remote_htlc_tx,remote_per_commit_point,pubkey, # closingd asks HSM to sign mutual close tx. -hsm_sign_mutual_close_tx,21 -hsm_sign_mutual_close_tx,,tx,struct bitcoin_tx -hsm_sign_mutual_close_tx,,remote_funding_key,struct pubkey -hsm_sign_mutual_close_tx,,funding,struct amount_sat +msgtype,hsm_sign_mutual_close_tx,21 +msgdata,hsm_sign_mutual_close_tx,tx,bitcoin_tx, +msgdata,hsm_sign_mutual_close_tx,remote_funding_key,pubkey, +msgdata,hsm_sign_mutual_close_tx,funding,amount_sat, # Reply for all the above requests. -hsm_sign_tx_reply,112 -hsm_sign_tx_reply,,sig,struct bitcoin_signature +msgtype,hsm_sign_tx_reply,112 +msgdata,hsm_sign_tx_reply,sig,bitcoin_signature, # Openingd/channeld/onchaind asks for Nth per_commitment_point, if > 2, gets N-2 secret. -hsm_get_per_commitment_point,18 -hsm_get_per_commitment_point,,n,u64 +msgtype,hsm_get_per_commitment_point,18 +msgdata,hsm_get_per_commitment_point,n,u64, -hsm_get_per_commitment_point_reply,118 -hsm_get_per_commitment_point_reply,,per_commitment_point,struct pubkey -hsm_get_per_commitment_point_reply,,old_commitment_secret,?struct secret +msgtype,hsm_get_per_commitment_point_reply,118 +msgdata,hsm_get_per_commitment_point_reply,per_commitment_point,pubkey, +msgdata,hsm_get_per_commitment_point_reply,old_commitment_secret,?secret, # master -> hsmd: do you have a memleak? -hsm_dev_memleak,33 +msgtype,hsm_dev_memleak,33 -hsm_dev_memleak_reply,133 -hsm_dev_memleak_reply,,leak,bool +msgtype,hsm_dev_memleak_reply,133 +msgdata,hsm_dev_memleak_reply,leak,bool, # channeld asks to check if claimed future commitment_secret is correct. -hsm_check_future_secret,22 -hsm_check_future_secret,,n,u64 -hsm_check_future_secret,,commitment_secret,struct secret +msgtype,hsm_check_future_secret,22 +msgdata,hsm_check_future_secret,n,u64, +msgdata,hsm_check_future_secret,commitment_secret,secret, -hsm_check_future_secret_reply,122 -hsm_check_future_secret_reply,,correct,bool +msgtype,hsm_check_future_secret_reply,122 +msgdata,hsm_check_future_secret_reply,correct,bool, diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 50a7e3e1e..1ddf8dd26 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -441,7 +441,7 @@ u8 *towire_errorfmt(const tal_t *ctx UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "towire_errorfmt called!\n"); abort(); } /* Generated stub for towire_gossip_get_incoming_channels */ -u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED, const bool *private_too UNNEEDED) +u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED, bool *private_too UNNEEDED) { fprintf(stderr, "towire_gossip_get_incoming_channels called!\n"); abort(); } /* Generated stub for towire_hsm_get_channel_basepoints */ u8 *towire_hsm_get_channel_basepoints(const tal_t *ctx UNNEEDED, const struct node_id *peerid UNNEEDED, u64 dbid UNNEEDED) diff --git a/onchaind/Makefile b/onchaind/Makefile index 4d180b537..0738fd42e 100644 --- a/onchaind/Makefile +++ b/onchaind/Makefile @@ -74,10 +74,10 @@ ONCHAIND_COMMON_OBJS := \ hsmd/gen_hsm_wire.o onchaind/gen_onchain_wire.h: $(WIRE_GEN) onchaind/onchain_wire.csv - $(WIRE_GEN) --header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@ + $(WIRE_GEN) --page header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@ onchaind/gen_onchain_wire.c: $(WIRE_GEN) onchaind/onchain_wire.csv - $(WIRE_GEN) ${@:.c=.h} onchain_wire_type < onchaind/onchain_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} onchain_wire_type < onchaind/onchain_wire.csv > $@ LIGHTNINGD_ONCHAIN_OBJS := $(LIGHTNINGD_ONCHAIN_SRC:.c=.o) $(LIGHTNINGD_ONCHAIN_GEN_SRC:.c=.o) diff --git a/onchaind/onchain_wire.csv b/onchaind/onchain_wire.csv index c226616e4..6043af623 100644 --- a/onchaind/onchain_wire.csv +++ b/onchaind/onchain_wire.csv @@ -3,107 +3,107 @@ #include # Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs. -onchain_init,5001 -onchain_init,,shachain,struct shachain -onchain_init,,funding_amount_satoshi,struct amount_sat +msgtype,onchain_init,5001 +msgdata,onchain_init,shachain,shachain, +msgdata,onchain_init,funding_amount_satoshi,amount_sat, # Remote per commit point for committed tx. -onchain_init,,old_remote_per_commitment_point,struct pubkey +msgdata,onchain_init,old_remote_per_commitment_point,pubkey, # Remote per commit point for current tx (needed if we haven't got revoke_and_ack yet). -onchain_init,,remote_per_commitment_point,struct pubkey -onchain_init,,local_to_self_delay,u32 -onchain_init,,remote_to_self_delay,u32 -onchain_init,,feerate_per_kw,u32 -onchain_init,,local_dust_limit_satoshi,struct amount_sat +msgdata,onchain_init,remote_per_commitment_point,pubkey, +msgdata,onchain_init,local_to_self_delay,u32, +msgdata,onchain_init,remote_to_self_delay,u32, +msgdata,onchain_init,feerate_per_kw,u32, +msgdata,onchain_init,local_dust_limit_satoshi,amount_sat, # Gives an easy way to tell if it's our unilateral close or theirs... -onchain_init,,our_broadcast_txid,struct bitcoin_txid -onchain_init,,local_scriptpubkey_len,u16 -onchain_init,,local_scriptpubkey,local_scriptpubkey_len*u8 -onchain_init,,remote_scriptpubkey_len,u16 -onchain_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8 -onchain_init,,ourwallet_pubkey,struct pubkey +msgdata,onchain_init,our_broadcast_txid,bitcoin_txid, +msgdata,onchain_init,local_scriptpubkey_len,u16, +msgdata,onchain_init,local_scriptpubkey,u8,local_scriptpubkey_len +msgdata,onchain_init,remote_scriptpubkey_len,u16, +msgdata,onchain_init,remote_scriptpubkey,u8,remote_scriptpubkey_len +msgdata,onchain_init,ourwallet_pubkey,pubkey, # We need these two for commit number obscurer -onchain_init,,funder,enum side -onchain_init,,local_basepoints,struct basepoints -onchain_init,,remote_basepoints,struct basepoints -onchain_init,,tx,struct bitcoin_tx -onchain_init,,tx_blockheight,u32 -onchain_init,,reasonable_depth,u32 -onchain_init,,num_htlc_sigs,u16 -onchain_init,,htlc_signature,num_htlc_sigs*secp256k1_ecdsa_signature -onchain_init,,num_htlcs,u64 -onchain_init,,min_possible_feerate,u32 -onchain_init,,max_possible_feerate,u32 -onchain_init,,possible_remote_per_commit_point,?struct pubkey +msgdata,onchain_init,funder,e:side, +msgdata,onchain_init,local_basepoints,basepoints, +msgdata,onchain_init,remote_basepoints,basepoints, +msgdata,onchain_init,tx,bitcoin_tx, +msgdata,onchain_init,tx_blockheight,u32, +msgdata,onchain_init,reasonable_depth,u32, +msgdata,onchain_init,num_htlc_sigs,u16, +msgdata,onchain_init,htlc_signature,secp256k1_ecdsa_signature,num_htlc_sigs +msgdata,onchain_init,num_htlcs,u64, +msgdata,onchain_init,min_possible_feerate,u32, +msgdata,onchain_init,max_possible_feerate,u32, +msgdata,onchain_init,possible_remote_per_commit_point,?pubkey, #include # This is all the HTLCs: one per message -onchain_htlc,5002 -onchain_htlc,,htlc,struct htlc_stub +msgtype,onchain_htlc,5002 +msgdata,onchain_htlc,htlc,htlc_stub, # If it's not in the commitment tx, tell us (immediately or htlc_missing_depth) -onchain_htlc,,tell_if_missing,bool -onchain_htlc,,tell_immediately,bool +msgdata,onchain_htlc,tell_if_missing,bool, +msgdata,onchain_htlc,tell_immediately,bool, # This says we're ready; give us preimages. -onchain_init_reply,5101 +msgtype,onchain_init_reply,5101 # onchaind->master: Send out a tx. -onchain_broadcast_tx,5003 -onchain_broadcast_tx,,tx,struct bitcoin_tx -onchain_broadcast_tx,,type,enum wallet_tx_type +msgtype,onchain_broadcast_tx,5003 +msgdata,onchain_broadcast_tx,tx,bitcoin_tx, +msgdata,onchain_broadcast_tx,type,e:wallet_tx_type, # master->onchaind: Notifier that an output has been spent by input_num of tx. -onchain_spent,5004 -onchain_spent,,tx,struct bitcoin_tx -onchain_spent,,input_num,u32 -onchain_spent,,blockheight,u32 +msgtype,onchain_spent,5004 +msgdata,onchain_spent,tx,bitcoin_tx, +msgdata,onchain_spent,input_num,u32, +msgdata,onchain_spent,blockheight,u32, # master->onchaind: We will receive more than one of these, as depth changes. -onchain_depth,5005 -onchain_depth,,txid,struct bitcoin_txid -onchain_depth,,depth,u32 +msgtype,onchain_depth,5005 +msgdata,onchain_depth,txid,bitcoin_txid, +msgdata,onchain_depth,depth,u32, # onchaind->master: We don't want to watch this tx, or its outputs -onchain_unwatch_tx,5006 -onchain_unwatch_tx,,txid,struct bitcoin_txid +msgtype,onchain_unwatch_tx,5006 +msgdata,onchain_unwatch_tx,txid,bitcoin_txid, # master->onchaind: We know HTLC preimage -onchain_known_preimage,5007 -onchain_known_preimage,,preimage,struct preimage +msgtype,onchain_known_preimage,5007 +msgdata,onchain_known_preimage,preimage,preimage, # onchaind->master: We discovered HTLC preimage -onchain_extracted_preimage,5008 -onchain_extracted_preimage,,preimage,struct preimage +msgtype,onchain_extracted_preimage,5008 +msgdata,onchain_extracted_preimage,preimage,preimage, # onchaind->master: this HTLC was missing from commit tx. -onchain_missing_htlc_output,5009 -onchain_missing_htlc_output,,htlc,struct htlc_stub +msgtype,onchain_missing_htlc_output,5009 +msgdata,onchain_missing_htlc_output,htlc,htlc_stub, # onchaind->master: this HTLC has timed out (after reasonable_depth) -onchain_htlc_timeout,5010 -onchain_htlc_timeout,,htlc,struct htlc_stub +msgtype,onchain_htlc_timeout,5010 +msgdata,onchain_htlc_timeout,htlc,htlc_stub, # onchaind->master: this peer can be forgotten -onchain_all_irrevocably_resolved,5011 +msgtype,onchain_all_irrevocably_resolved,5011 # onchaind->master: hey, I identified an UTXO you'll want to track -onchain_add_utxo,5012 -onchain_add_utxo,,prev_out_tx,struct bitcoin_txid -onchain_add_utxo,,prev_out_index,u32 -onchain_add_utxo,,per_commit_point,struct pubkey -onchain_add_utxo,,value,struct amount_sat -onchain_add_utxo,,blockheight,u32 -onchain_add_utxo,,len,u16 -onchain_add_utxo,,scriptpubkey,len*u8 +msgtype,onchain_add_utxo,5012 +msgdata,onchain_add_utxo,prev_out_tx,bitcoin_txid, +msgdata,onchain_add_utxo,prev_out_index,u32, +msgdata,onchain_add_utxo,per_commit_point,pubkey, +msgdata,onchain_add_utxo,value,amount_sat, +msgdata,onchain_add_utxo,blockheight,u32, +msgdata,onchain_add_utxo,len,u16, +msgdata,onchain_add_utxo,scriptpubkey,u8,len # master -> onchaind: do you have a memleak? -onchain_dev_memleak,5033 +msgtype,onchain_dev_memleak,5033 -onchain_dev_memleak_reply,5133 -onchain_dev_memleak_reply,,leak,bool +msgtype,onchain_dev_memleak_reply,5133 +msgdata,onchain_dev_memleak_reply,leak,bool, # Tell the main daemon what we've been watching, mainly used for transactions # that we tracked automatically but only onchaind knows how to classify their # transactions. -onchain_transaction_annotate,5034 -onchain_transaction_annotate,,txid,struct bitcoin_txid -onchain_transaction_annotate,,type,enum wallet_tx_type +msgtype,onchain_transaction_annotate,5034 +msgdata,onchain_transaction_annotate,txid,bitcoin_txid, +msgdata,onchain_transaction_annotate,type,e:wallet_tx_type, diff --git a/openingd/Makefile b/openingd/Makefile index fbd762fc4..a214df5a8 100644 --- a/openingd/Makefile +++ b/openingd/Makefile @@ -80,10 +80,10 @@ OPENINGD_COMMON_OBJS := \ $(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS) openingd/gen_opening_wire.h: $(WIRE_GEN) openingd/opening_wire.csv - $(WIRE_GEN) --header $@ opening_wire_type < openingd/opening_wire.csv > $@ + $(WIRE_GEN) --page header $@ opening_wire_type < openingd/opening_wire.csv > $@ openingd/gen_opening_wire.c: $(WIRE_GEN) openingd/opening_wire.csv - $(WIRE_GEN) ${@:.c=.h} opening_wire_type < openingd/opening_wire.csv > $@ + $(WIRE_GEN) --page impl ${@:.c=.h} opening_wire_type < openingd/opening_wire.csv > $@ LIGHTNINGD_OPENING_OBJS := $(LIGHTNINGD_OPENING_SRC:.c=.o) $(LIGHTNINGD_OPENING_GEN_SRC:.c=.o) diff --git a/openingd/opening_wire.csv b/openingd/opening_wire.csv index e8881be94..810435118 100644 --- a/openingd/opening_wire.csv +++ b/openingd/opening_wire.csv @@ -3,136 +3,136 @@ #include #include -opening_init,6000 +msgtype,opening_init,6000 # Which network are we configured for? -opening_init,,chain_hash,struct bitcoin_blkid +msgdata,opening_init,chain_hash,bitcoin_blkid, # Base configuration we'll offer (channel reserve will vary with amount) -opening_init,,our_config,struct channel_config +msgdata,opening_init,our_config,channel_config, # Minimum/maximum configuration values we'll accept -opening_init,,max_to_self_delay,u32 -opening_init,,min_effective_htlc_capacity_msat,struct amount_msat -opening_init,,pps,struct per_peer_state -opening_init,,our_basepoints,struct basepoints -opening_init,,our_funding_pubkey,struct pubkey +msgdata,opening_init,max_to_self_delay,u32, +msgdata,opening_init,min_effective_htlc_capacity_msat,amount_msat, +msgdata,opening_init,pps,per_peer_state, +msgdata,opening_init,our_basepoints,basepoints, +msgdata,opening_init,our_funding_pubkey,pubkey, # Constraints in case the other end tries to open a channel. -opening_init,,minimum_depth,u32 -opening_init,,min_feerate,u32 -opening_init,,max_feerate,u32 -opening_init,,lfeatures_len,u16 -opening_init,,lfeatures,lfeatures_len*u8 +msgdata,opening_init,minimum_depth,u32, +msgdata,opening_init,min_feerate,u32, +msgdata,opening_init,max_feerate,u32, +msgdata,opening_init,lfeatures_len,u16, +msgdata,opening_init,lfeatures,u8,lfeatures_len # Optional msg to send. -opening_init,,len,u16 -opening_init,,msg,len*u8 +msgdata,opening_init,len,u16, +msgdata,opening_init,msg,u8,len # Openingd->master: they offered channel, should we continue? -opening_got_offer,6005 -opening_got_offer,,funding_satoshis,struct amount_sat -opening_got_offer,,push_msat,struct amount_msat -opening_got_offer,,dust_limit_satoshis,struct amount_sat -opening_got_offer,,max_htlc_value_in_flight_msat,struct amount_msat -opening_got_offer,,channel_reserve_satoshis,struct amount_sat -opening_got_offer,,htlc_minimum_msat,struct amount_msat -opening_got_offer,,feerate_per_kw,u32 -opening_got_offer,,to_self_delay,u16 -opening_got_offer,,max_accepted_htlcs,u16 -opening_got_offer,,channel_flags,u8 -opening_got_offer,,shutdown_len,u16 -opening_got_offer,,shutdown_scriptpubkey,shutdown_len*u8 +msgtype,opening_got_offer,6005 +msgdata,opening_got_offer,funding_satoshis,amount_sat, +msgdata,opening_got_offer,push_msat,amount_msat, +msgdata,opening_got_offer,dust_limit_satoshis,amount_sat, +msgdata,opening_got_offer,max_htlc_value_in_flight_msat,amount_msat, +msgdata,opening_got_offer,channel_reserve_satoshis,amount_sat, +msgdata,opening_got_offer,htlc_minimum_msat,amount_msat, +msgdata,opening_got_offer,feerate_per_kw,u32, +msgdata,opening_got_offer,to_self_delay,u16, +msgdata,opening_got_offer,max_accepted_htlcs,u16, +msgdata,opening_got_offer,channel_flags,u8, +msgdata,opening_got_offer,shutdown_len,u16, +msgdata,opening_got_offer,shutdown_scriptpubkey,u8,shutdown_len # master->openingd: optional rejection message -opening_got_offer_reply,6105 -opening_got_offer_reply,,rejection,?wirestring +msgtype,opening_got_offer_reply,6105 +msgdata,opening_got_offer_reply,rejection,?wirestring, #include #include # Master->openingd: please fund a channel. -opening_funder,6001 -opening_funder,,funding_satoshis,struct amount_sat -opening_funder,,push_msat,struct amount_msat -opening_funder,,feerate_per_kw,u32 -opening_funder,,change_satoshis,struct amount_sat -opening_funder,,change_keyindex,u32 -opening_funder,,channel_flags,u8 +msgtype,opening_funder,6001 +msgdata,opening_funder,funding_satoshis,amount_sat, +msgdata,opening_funder,push_msat,amount_msat, +msgdata,opening_funder,feerate_per_kw,u32, +msgdata,opening_funder,change_satoshis,amount_sat, +msgdata,opening_funder,change_keyindex,u32, +msgdata,opening_funder,channel_flags,u8, #include -opening_funder,,num_inputs,u16 -opening_funder,,inputs,num_inputs*struct utxo -opening_funder,,bip32,struct ext_key +msgdata,opening_funder,num_inputs,u16, +msgdata,opening_funder,inputs,utxo,num_inputs +msgdata,opening_funder,bip32,ext_key, # Openingd->master: we've successfully offered channel. # This gives their sig, means we can broadcast tx: we're done. -opening_funder_reply,6101 -opening_funder_reply,,their_config,struct channel_config -opening_funder_reply,,first_commit,struct bitcoin_tx -opening_funder_reply,,first_commit_sig,struct bitcoin_signature -opening_funder_reply,,pps,struct per_peer_state -opening_funder_reply,,revocation_basepoint,struct pubkey -opening_funder_reply,,payment_basepoint,struct pubkey -opening_funder_reply,,htlc_basepoint,struct pubkey -opening_funder_reply,,delayed_payment_basepoint,struct pubkey -opening_funder_reply,,their_per_commit_point,struct pubkey -opening_funder_reply,,minimum_depth,u32 -opening_funder_reply,,remote_fundingkey,struct pubkey -opening_funder_reply,,funding_txid,struct bitcoin_txid -opening_funder_reply,,funding_txout,u16 -opening_funder_reply,,feerate_per_kw,u32 -opening_funder_reply,,our_channel_reserve_satoshis,struct amount_sat -opening_funder_reply,,shutdown_len,u16 -opening_funder_reply,,shutdown_scriptpubkey,shutdown_len*u8 +msgtype,opening_funder_reply,6101 +msgdata,opening_funder_reply,their_config,channel_config, +msgdata,opening_funder_reply,first_commit,bitcoin_tx, +msgdata,opening_funder_reply,first_commit_sig,bitcoin_signature, +msgdata,opening_funder_reply,pps,per_peer_state, +msgdata,opening_funder_reply,revocation_basepoint,pubkey, +msgdata,opening_funder_reply,payment_basepoint,pubkey, +msgdata,opening_funder_reply,htlc_basepoint,pubkey, +msgdata,opening_funder_reply,delayed_payment_basepoint,pubkey, +msgdata,opening_funder_reply,their_per_commit_point,pubkey, +msgdata,opening_funder_reply,minimum_depth,u32, +msgdata,opening_funder_reply,remote_fundingkey,pubkey, +msgdata,opening_funder_reply,funding_txid,bitcoin_txid, +msgdata,opening_funder_reply,funding_txout,u16, +msgdata,opening_funder_reply,feerate_per_kw,u32, +msgdata,opening_funder_reply,our_channel_reserve_satoshis,amount_sat, +msgdata,opening_funder_reply,shutdown_len,u16, +msgdata,opening_funder_reply,shutdown_scriptpubkey,u8,shutdown_len # master->openingd: start channel establishment for a funding # tx that will be paid for by an external wallet -opening_funder_start,6002 -opening_funder_start,,funding_satoshis,struct amount_sat -opening_funder_start,,push_msat,struct amount_msat -opening_funder_start,,feerate_per_kw,u32 -opening_funder_start,,channel_flags,u8 +msgtype,opening_funder_start,6002 +msgdata,opening_funder_start,funding_satoshis,amount_sat, +msgdata,opening_funder_start,push_msat,amount_msat, +msgdata,opening_funder_start,feerate_per_kw,u32, +msgdata,opening_funder_start,channel_flags,u8, # openingd->master: send back output script for 2-of-2 funding output -opening_funder_start_reply,6102 -opening_funder_start_reply,,script_len,u8 -opening_funder_start_reply,,scriptpubkey,script_len*u8 +msgtype,opening_funder_start_reply,6102 +msgdata,opening_funder_start_reply,script_len,u8, +msgdata,opening_funder_start_reply,scriptpubkey,u8,script_len # master->openingd: complete channel establishment for a funding # tx that will be paid for by an external wallet # response to this is a normal `opening_funder_reply` ?? -opening_funder_complete,6012 -opening_funder_complete,,funding_txid,struct bitcoin_txid -opening_funder_complete,,funding_txout,u16 +msgtype,opening_funder_complete,6012 +msgdata,opening_funder_complete,funding_txid,bitcoin_txid, +msgdata,opening_funder_complete,funding_txout,u16, #master->openingd: cancel channel establishment for a funding -opening_funder_cancel,6013 +msgtype,opening_funder_cancel,6013 # Openingd->master: we failed to negotiation channel -opening_funder_failed,6004 -opening_funder_failed,,reason,wirestring +msgtype,opening_funder_failed,6004 +msgdata,opening_funder_failed,reason,wirestring, # Openingd->master: they offered channel. # This gives their txid and info, means we can send funding_signed: we're done. -opening_fundee,6003 -opening_fundee,,their_config,struct channel_config -opening_fundee,,first_commit,struct bitcoin_tx -opening_fundee,,first_commit_sig,struct bitcoin_signature -opening_fundee,,pps,struct per_peer_state -opening_fundee,,revocation_basepoint,struct pubkey -opening_fundee,,payment_basepoint,struct pubkey -opening_fundee,,htlc_basepoint,struct pubkey -opening_fundee,,delayed_payment_basepoint,struct pubkey -opening_fundee,,their_per_commit_point,struct pubkey -opening_fundee,,remote_fundingkey,struct pubkey -opening_fundee,,funding_txid,struct bitcoin_txid -opening_fundee,,funding_txout,u16 -opening_fundee,,funding_satoshis,struct amount_sat -opening_fundee,,push_msat,struct amount_msat -opening_fundee,,channel_flags,u8 -opening_fundee,,feerate_per_kw,u32 +msgtype,opening_fundee,6003 +msgdata,opening_fundee,their_config,channel_config, +msgdata,opening_fundee,first_commit,bitcoin_tx, +msgdata,opening_fundee,first_commit_sig,bitcoin_signature, +msgdata,opening_fundee,pps,per_peer_state, +msgdata,opening_fundee,revocation_basepoint,pubkey, +msgdata,opening_fundee,payment_basepoint,pubkey, +msgdata,opening_fundee,htlc_basepoint,pubkey, +msgdata,opening_fundee,delayed_payment_basepoint,pubkey, +msgdata,opening_fundee,their_per_commit_point,pubkey, +msgdata,opening_fundee,remote_fundingkey,pubkey, +msgdata,opening_fundee,funding_txid,bitcoin_txid, +msgdata,opening_fundee,funding_txout,u16, +msgdata,opening_fundee,funding_satoshis,amount_sat, +msgdata,opening_fundee,push_msat,amount_msat, +msgdata,opening_fundee,channel_flags,u8, +msgdata,opening_fundee,feerate_per_kw,u32, # The funding signed message: send this and we're committed. -opening_fundee,,msglen,u16 -opening_fundee,,funding_signed_msg,msglen*u8 -opening_fundee,,our_channel_reserve_satoshis,struct amount_sat -opening_fundee,,shutdown_len,u16 -opening_fundee,,shutdown_scriptpubkey,shutdown_len*u8 +msgdata,opening_fundee,msglen,u16, +msgdata,opening_fundee,funding_signed_msg,u8,msglen +msgdata,opening_fundee,our_channel_reserve_satoshis,amount_sat, +msgdata,opening_fundee,shutdown_len,u16, +msgdata,opening_fundee,shutdown_scriptpubkey,u8,shutdown_len # master -> openingd: do you have a memleak? -opening_dev_memleak,6033 +msgtype,opening_dev_memleak,6033 -opening_dev_memleak_reply,6133 -opening_dev_memleak_reply,,leak,bool +msgtype,opening_dev_memleak_reply,6133 +msgdata,opening_dev_memleak_reply,leak,bool, diff --git a/tools/generate-bolts.py b/tools/generate-bolts.py index 26db8519c..b0e003454 100755 --- a/tools/generate-bolts.py +++ b/tools/generate-bolts.py @@ -169,6 +169,9 @@ class Type(FieldSet): 'u64', 'bool', 'secp256k1_ecdsa_signature', + 'secp256k1_ecdsa_recoverable_signature', + 'wirestring', + 'double', ] truncated_typedefs = [ @@ -576,6 +579,7 @@ def main(options, args=None, output=sys.stdout, lines=None): msg.add_data_field(tokens[2], type_obj, count, comments=list(comment_set), optional=optional) + comment_set = [] elif token_type.startswith('#include'): master.add_include(token_type)