lightningd: remove unused offset field from CSV files.

The format we use to generate marshal/unmarshal code is from
the spec's tools/extract-formats.py which includes the offset:
we don't use it at all, so rather than having manually-calculated
(and thus probably wrong) values, or 0, emit it altogther.

Reported-by: Christian Decker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-05-25 11:46:04 +09:30
parent 06bc035f59
commit 693457a580
6 changed files with 189 additions and 189 deletions

View File

@ -19,103 +19,103 @@ channel_normal_operation,1001
# Begin! You're still waiting for the tx to be buried though (passes
# gossipd-client fd)
channel_init,1
channel_init,0,funding_txid,struct sha256_double
channel_init,32,funding_txout,2
channel_init,34,our_config,struct channel_config
channel_init,70,their_config,struct channel_config
channel_init,106,first_commit_sig,secp256k1_ecdsa_signature
channel_init,166,crypto_state,struct crypto_state
channel_init,310,remote_fundingkey,33
channel_init,343,revocation_basepoint,33
channel_init,376,payment_basepoint,33
channel_init,409,delayed_payment_basepoint,33
channel_init,442,their_per_commit_point,33
channel_init,475,am_funder,bool
channel_init,476,fee_base,4
channel_init,480,fee_proportional,4
channel_init,484,funding_satoshi,8
channel_init,492,push_msat,8
channel_init,500,seed,struct privkey
channel_init,533,local_node_id,struct pubkey
channel_init,566,remote_node_id,struct pubkey
channel_init,599,commit_msec,4
channel_init,603,cltv_delta,u16
channel_init,605,init_peer_pkt_len,u16
channel_init,607,init_peer_pkt,init_peer_pkt_len*u8
channel_init,,funding_txid,struct sha256_double
channel_init,,funding_txout,2
channel_init,,our_config,struct channel_config
channel_init,,their_config,struct channel_config
channel_init,,first_commit_sig,secp256k1_ecdsa_signature
channel_init,,crypto_state,struct crypto_state
channel_init,,remote_fundingkey,33
channel_init,,revocation_basepoint,33
channel_init,,payment_basepoint,33
channel_init,,delayed_payment_basepoint,33
channel_init,,their_per_commit_point,33
channel_init,,am_funder,bool
channel_init,,fee_base,4
channel_init,,fee_proportional,4
channel_init,,funding_satoshi,8
channel_init,,push_msat,8
channel_init,,seed,struct privkey
channel_init,,local_node_id,struct pubkey
channel_init,,remote_node_id,struct pubkey
channel_init,,commit_msec,4
channel_init,,cltv_delta,u16
channel_init,,init_peer_pkt_len,u16
channel_init,,init_peer_pkt,init_peer_pkt_len*u8
# Tx is deep enough, go!
channel_funding_locked,2
channel_funding_locked,0,short_channel_id,struct short_channel_id
channel_funding_locked,,short_channel_id,struct short_channel_id
# Tell the channel that we may announce the channel's existence
channel_funding_announce_depth,3
# Tell channel to offer this htlc
channel_offer_htlc,4
channel_offer_htlc,0,amount_msat,4
channel_offer_htlc,0,cltv_expiry,4
channel_offer_htlc,0,payment_hash,32
channel_offer_htlc,0,onion_routing_packet,1366*u8
channel_offer_htlc,,amount_msat,4
channel_offer_htlc,,cltv_expiry,4
channel_offer_htlc,,payment_hash,32
channel_offer_htlc,,onion_routing_packet,1366*u8
# Reply; synchronous since IDs have to increment.
channel_offer_htlc_reply,104
channel_offer_htlc_reply,0,id,8
channel_offer_htlc_reply,,id,8
# Zero failure code means success.
channel_offer_htlc_reply,0,failure_code,2
channel_offer_htlc_reply,0,failurestrlen,2
channel_offer_htlc_reply,0,failurestr,failurestrlen*u8
channel_offer_htlc_reply,,failure_code,2
channel_offer_htlc_reply,,failurestrlen,2
channel_offer_htlc_reply,,failurestr,failurestrlen*u8
# Main daemon found out the preimage for an htlc
#include <bitcoin/preimage.h>
channel_fulfill_htlc,5
channel_fulfill_htlc,0,id,8
channel_fulfill_htlc,0,payment_preimage,struct preimage
channel_fulfill_htlc,,id,8
channel_fulfill_htlc,,payment_preimage,struct preimage
# Main daemon says HTLC failed
channel_fail_htlc,6
channel_fail_htlc,0,id,8
channel_fail_htlc,0,len,2
channel_fail_htlc,0,error_pkt,len*u8
channel_fail_htlc,,id,8
channel_fail_htlc,,len,2
channel_fail_htlc,,error_pkt,len*u8
# Peer and I are irrevocably committed to this HTLC.
channel_accepted_htlc,7
channel_accepted_htlc,0,id,8
channel_accepted_htlc,0,amount_msat,4
channel_accepted_htlc,0,cltv_expiry,4
channel_accepted_htlc,0,payment_hash,32
channel_accepted_htlc,0,next_onion,1366*u8
channel_accepted_htlc,0,forward,bool
channel_accepted_htlc,0,amt_to_forward,u64
channel_accepted_htlc,0,outgoing_cltv_value,u32
channel_accepted_htlc,0,next_channel,struct short_channel_id
channel_accepted_htlc,0,shared_secret,struct secret
channel_accepted_htlc,,id,8
channel_accepted_htlc,,amount_msat,4
channel_accepted_htlc,,cltv_expiry,4
channel_accepted_htlc,,payment_hash,32
channel_accepted_htlc,,next_onion,1366*u8
channel_accepted_htlc,,forward,bool
channel_accepted_htlc,,amt_to_forward,u64
channel_accepted_htlc,,outgoing_cltv_value,u32
channel_accepted_htlc,,next_channel,struct short_channel_id
channel_accepted_htlc,,shared_secret,struct secret
# FIXME: Add code to commit current channel state!
# The HTLC preimage was given.
channel_fulfilled_htlc,8
channel_fulfilled_htlc,0,id,8
channel_fulfilled_htlc,0,payment_preimage,struct preimage
channel_fulfilled_htlc,,id,8
channel_fulfilled_htlc,,payment_preimage,struct preimage
# This HTLC failed
channel_failed_htlc,9
channel_failed_htlc,0,id,8
channel_failed_htlc,0,len,2
channel_failed_htlc,0,reason,len*u8
channel_failed_htlc,,id,8
channel_failed_htlc,,len,2
channel_failed_htlc,,reason,len*u8
# This HTLC was returned malformed
channel_malformed_htlc,10
channel_malformed_htlc,0,id,8
channel_malformed_htlc,0,sha256_of_onion,32
channel_malformed_htlc,0,failure_code,2
channel_malformed_htlc,,id,8
channel_malformed_htlc,,sha256_of_onion,32
channel_malformed_htlc,,failure_code,2
# Ping/pong test.
channel_ping,11
channel_ping,0,num_pong_bytes,u16
channel_ping,0,len,u16
channel_ping,,num_pong_bytes,u16
channel_ping,,len,u16
channel_ping_reply,111
channel_ping_reply,0,totlen,u16
channel_ping_reply,,totlen,u16
# Channeld tells the master that the channel has been announced
channel_announced,12

1 # Shouldn't happen
19 channel_init,32,funding_txout,2 channel_init,,funding_txout,2
20 channel_init,34,our_config,struct channel_config channel_init,,our_config,struct channel_config
21 channel_init,70,their_config,struct channel_config channel_init,,their_config,struct channel_config
22 channel_init,106,first_commit_sig,secp256k1_ecdsa_signature channel_init,,first_commit_sig,secp256k1_ecdsa_signature
23 channel_init,166,crypto_state,struct crypto_state channel_init,,crypto_state,struct crypto_state
24 channel_init,310,remote_fundingkey,33 channel_init,,remote_fundingkey,33
25 channel_init,343,revocation_basepoint,33 channel_init,,revocation_basepoint,33
26 channel_init,376,payment_basepoint,33 channel_init,,payment_basepoint,33
27 channel_init,409,delayed_payment_basepoint,33 channel_init,,delayed_payment_basepoint,33
28 channel_init,442,their_per_commit_point,33 channel_init,,their_per_commit_point,33
29 channel_init,475,am_funder,bool channel_init,,am_funder,bool
30 channel_init,476,fee_base,4 channel_init,,fee_base,4
31 channel_init,480,fee_proportional,4 channel_init,,fee_proportional,4
32 channel_init,484,funding_satoshi,8 channel_init,,funding_satoshi,8
33 channel_init,492,push_msat,8 channel_init,,push_msat,8
34 channel_init,500,seed,struct privkey channel_init,,seed,struct privkey
35 channel_init,533,local_node_id,struct pubkey channel_init,,local_node_id,struct pubkey
36 channel_init,566,remote_node_id,struct pubkey channel_init,,remote_node_id,struct pubkey
37 channel_init,599,commit_msec,4 channel_init,,commit_msec,4
38 channel_init,603,cltv_delta,u16 channel_init,,cltv_delta,u16
39 channel_init,605,init_peer_pkt_len,u16 channel_init,,init_peer_pkt_len,u16
40 channel_init,607,init_peer_pkt,init_peer_pkt_len*u8 channel_init,,init_peer_pkt,init_peer_pkt_len*u8
41 # Tx is deep enough, go!
42 channel_funding_locked,2
43 channel_funding_locked,0,short_channel_id,struct short_channel_id channel_funding_locked,,short_channel_id,struct short_channel_id
44 # Tell the channel that we may announce the channel's existence
45 channel_funding_announce_depth,3
46 # Tell channel to offer this htlc
47 channel_offer_htlc,4
48 channel_offer_htlc,0,amount_msat,4 channel_offer_htlc,,amount_msat,4
49 channel_offer_htlc,0,cltv_expiry,4 channel_offer_htlc,,cltv_expiry,4
50 channel_offer_htlc,0,payment_hash,32 channel_offer_htlc,,payment_hash,32
51 channel_offer_htlc,0,onion_routing_packet,1366*u8 channel_offer_htlc,,onion_routing_packet,1366*u8
52 # Reply; synchronous since IDs have to increment.
53 channel_offer_htlc_reply,104
54 channel_offer_htlc_reply,0,id,8 channel_offer_htlc_reply,,id,8
55 # Zero failure code means success.
56 channel_offer_htlc_reply,0,failure_code,2 channel_offer_htlc_reply,,failure_code,2
57 channel_offer_htlc_reply,0,failurestrlen,2 channel_offer_htlc_reply,,failurestrlen,2
58 channel_offer_htlc_reply,0,failurestr,failurestrlen*u8 channel_offer_htlc_reply,,failurestr,failurestrlen*u8
59 # Main daemon found out the preimage for an htlc
60 #include <bitcoin/preimage.h>
61 channel_fulfill_htlc,5
62 channel_fulfill_htlc,0,id,8 channel_fulfill_htlc,,id,8
63 channel_fulfill_htlc,0,payment_preimage,struct preimage channel_fulfill_htlc,,payment_preimage,struct preimage
64 # Main daemon says HTLC failed
65 channel_fail_htlc,6
66 channel_fail_htlc,0,id,8 channel_fail_htlc,,id,8
67 channel_fail_htlc,0,len,2 channel_fail_htlc,,len,2
68 channel_fail_htlc,0,error_pkt,len*u8 channel_fail_htlc,,error_pkt,len*u8
69 # Peer and I are irrevocably committed to this HTLC.
70 channel_accepted_htlc,7
71 channel_accepted_htlc,0,id,8 channel_accepted_htlc,,id,8
72 channel_accepted_htlc,0,amount_msat,4 channel_accepted_htlc,,amount_msat,4
73 channel_accepted_htlc,0,cltv_expiry,4 channel_accepted_htlc,,cltv_expiry,4
74 channel_accepted_htlc,0,payment_hash,32 channel_accepted_htlc,,payment_hash,32
75 channel_accepted_htlc,0,next_onion,1366*u8 channel_accepted_htlc,,next_onion,1366*u8
76 channel_accepted_htlc,0,forward,bool channel_accepted_htlc,,forward,bool
77 channel_accepted_htlc,0,amt_to_forward,u64 channel_accepted_htlc,,amt_to_forward,u64
78 channel_accepted_htlc,0,outgoing_cltv_value,u32 channel_accepted_htlc,,outgoing_cltv_value,u32
79 channel_accepted_htlc,0,next_channel,struct short_channel_id channel_accepted_htlc,,next_channel,struct short_channel_id
80 channel_accepted_htlc,0,shared_secret,struct secret channel_accepted_htlc,,shared_secret,struct secret
81 # FIXME: Add code to commit current channel state!
82 # The HTLC preimage was given.
83 channel_fulfilled_htlc,8
84 channel_fulfilled_htlc,0,id,8 channel_fulfilled_htlc,,id,8
85 channel_fulfilled_htlc,0,payment_preimage,struct preimage channel_fulfilled_htlc,,payment_preimage,struct preimage
86 # This HTLC failed
87 channel_failed_htlc,9
88 channel_failed_htlc,0,id,8 channel_failed_htlc,,id,8
89 channel_failed_htlc,0,len,2 channel_failed_htlc,,len,2
90 channel_failed_htlc,0,reason,len*u8 channel_failed_htlc,,reason,len*u8
91 # This HTLC was returned malformed
92 channel_malformed_htlc,10
93 channel_malformed_htlc,0,id,8 channel_malformed_htlc,,id,8
94 channel_malformed_htlc,0,sha256_of_onion,32 channel_malformed_htlc,,sha256_of_onion,32
95 channel_malformed_htlc,0,failure_code,2 channel_malformed_htlc,,failure_code,2
96 # Ping/pong test.
97 channel_ping,11
98 channel_ping,0,num_pong_bytes,u16 channel_ping,,num_pong_bytes,u16
99 channel_ping,0,len,u16 channel_ping,,len,u16
100 channel_ping_reply,111
101 channel_ping_reply,0,totlen,u16 channel_ping_reply,,totlen,u16
102 # Channeld tells the master that the channel has been announced
103 channel_announced,12
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

View File

@ -8,100 +8,100 @@ gossipstatus_fdpass_failed,0x8005
# Peers can give a bad message, we close their fd, but no harm done.
gossipstatus_peer_bad_msg,1000
gossipstatus_peer_bad_msg,0,unique_id,8
gossipstatus_peer_bad_msg,8,len,2
gossipstatus_peer_bad_msg,10,err,len*u8
gossipstatus_peer_bad_msg,,unique_id,8
gossipstatus_peer_bad_msg,,len,2
gossipstatus_peer_bad_msg,,err,len*u8
# Misc problems like opening control fd.
gossipstatus_peer_failed,1001
gossipstatus_peer_failed,0,unique_id,8
gossipstatus_peer_failed,8,len,2
gossipstatus_peer_failed,10,err,len*u8
gossipstatus_peer_failed,,unique_id,8
gossipstatus_peer_failed,,len,2
gossipstatus_peer_failed,,err,len*u8
#include <lightningd/cryptomsg.h>
# Initialize the gossip daemon
gossipctl_init,0
gossipctl_init,0,broadcast_interval,4
gossipctl_init,,broadcast_interval,4
# These take an fd, but have no response
# (if it is to move onto a channel, we get a status msg).
gossipctl_new_peer,1
gossipctl_new_peer,0,unique_id,8
gossipctl_new_peer,8,crypto_state,struct crypto_state
gossipctl_new_peer,,unique_id,8
gossipctl_new_peer,,crypto_state,struct crypto_state
# Tell it to release a peer which has initialized.
gossipctl_release_peer,2
gossipctl_release_peer,0,unique_id,8
gossipctl_release_peer,,unique_id,8
# This releases the peer and returns the cryptostate (followed two fds: peer and gossip)
gossipctl_release_peer_reply,102
gossipctl_release_peer_reply,0,unique_id,8
gossipctl_release_peer_reply,8,crypto_state,struct crypto_state
gossipctl_release_peer_reply,,unique_id,8
gossipctl_release_peer_reply,,crypto_state,struct crypto_state
# This is where we save a peer's features.
#gossipstatus_peer_features,1
#gossipstatus_peer_features,0,unique_id,8
#gossipstatus_peer_features,8,gflen,2
#gossipstatus_peer_features,10,globalfeatures,gflen
#gossipstatus_peer_features,10+gflen,lflen,2
#gossipstatus_peer_features,12+gflen,localfeatures,lflen
#gossipstatus_peer_features,,unique_id,8
#gossipstatus_peer_features,,gflen,2
#gossipstatus_peer_features,,globalfeatures,gflen
#gossipstatus_peer_features,,lflen,2
#gossipstatus_peer_features,,localfeatures,lflen
# Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip)
gossipstatus_peer_nongossip,4
gossipstatus_peer_nongossip,0,unique_id,8
gossipstatus_peer_nongossip,10,crypto_state,struct crypto_state
gossipstatus_peer_nongossip,154,len,2
gossipstatus_peer_nongossip,156,msg,len*u8
gossipstatus_peer_nongossip,,unique_id,8
gossipstatus_peer_nongossip,,crypto_state,struct crypto_state
gossipstatus_peer_nongossip,,len,2
gossipstatus_peer_nongossip,,msg,len*u8
# Pass JSON-RPC getnodes call through
gossip_getnodes_request,5
#include <lightningd/gossip_msg.h>
gossip_getnodes_reply,105
gossip_getnodes_reply,0,num_nodes,u16
gossip_getnodes_reply,2,nodes,num_nodes*struct gossip_getnodes_entry
gossip_getnodes_reply,,num_nodes,u16
gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry
# Pass JSON-RPC getroute call through
gossip_getroute_request,6
gossip_getroute_request,0,source,struct pubkey
gossip_getroute_request,33,destination,struct pubkey
gossip_getroute_request,66,msatoshi,u32
gossip_getroute_request,70,riskfactor,u16
gossip_getroute_request,,source,struct pubkey
gossip_getroute_request,,destination,struct pubkey
gossip_getroute_request,,msatoshi,u32
gossip_getroute_request,,riskfactor,u16
gossip_getroute_reply,106
gossip_getroute_reply,0,num_hops,u16
gossip_getroute_reply,2,hops,num_hops*struct route_hop
gossip_getroute_reply,,num_hops,u16
gossip_getroute_reply,,hops,num_hops*struct route_hop
gossip_getchannels_request,7
gossip_getchannels_reply,107
gossip_getchannels_reply,0,num_channels,u16
gossip_getchannels_reply,2,nodes,num_channels*struct gossip_getchannels_entry
gossip_getchannels_reply,,num_channels,u16
gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
# Ping/pong test.
gossip_ping,8
gossip_ping,0,unique_id,u64
gossip_ping,0,num_pong_bytes,u16
gossip_ping,0,len,u16
gossip_ping,,unique_id,u64
gossip_ping,,num_pong_bytes,u16
gossip_ping,,len,u16
gossip_ping_reply,108
gossip_ping_reply,0,totlen,u16
gossip_ping_reply,,totlen,u16
# Given a short_channel_id, return the endpoints
gossip_resolve_channel_request,9
gossip_resolve_channel_request,0,channel_id,struct short_channel_id
gossip_resolve_channel_request,,channel_id,struct short_channel_id
gossip_resolve_channel_reply,109
gossip_resolve_channel_reply,0,num_keys,u16
gossip_resolve_channel_reply,0,keys,num_keys*struct pubkey
gossip_resolve_channel_reply,,num_keys,u16
gossip_resolve_channel_reply,,keys,num_keys*struct pubkey
# The main daemon forward some gossip message to gossipd, allows injecting
# arbitrary gossip messages.
gossip_forwarded_msg,10
gossip_forwarded_msg,0,msglen,2
gossip_forwarded_msg,2,msg,msglen
gossip_forwarded_msg,,msglen,2
gossip_forwarded_msg,,msg,msglen
# If peer is still connected, fail it (master does this for reconnect)
gossipctl_fail_peer,11
gossipctl_fail_peer,0,unique_id,8
gossipctl_fail_peer,,unique_id,8

1 # These are fatal.
8 # Peers can give a bad message, we close their fd, but no harm done.
9 gossipstatus_peer_bad_msg,1000
10 gossipstatus_peer_bad_msg,0,unique_id,8 gossipstatus_peer_bad_msg,,unique_id,8
11 gossipstatus_peer_bad_msg,8,len,2 gossipstatus_peer_bad_msg,,len,2
12 gossipstatus_peer_bad_msg,10,err,len*u8 gossipstatus_peer_bad_msg,,err,len*u8
13 # Misc problems like opening control fd.
14 gossipstatus_peer_failed,1001
15 gossipstatus_peer_failed,0,unique_id,8 gossipstatus_peer_failed,,unique_id,8
16 gossipstatus_peer_failed,8,len,2 gossipstatus_peer_failed,,len,2
17 gossipstatus_peer_failed,10,err,len*u8 gossipstatus_peer_failed,,err,len*u8
18 #include <lightningd/cryptomsg.h>
19 # Initialize the gossip daemon
20 gossipctl_init,0
21 gossipctl_init,0,broadcast_interval,4 gossipctl_init,,broadcast_interval,4
22 # These take an fd, but have no response
23 # (if it is to move onto a channel, we get a status msg).
24 gossipctl_new_peer,1
25 gossipctl_new_peer,0,unique_id,8 gossipctl_new_peer,,unique_id,8
26 gossipctl_new_peer,8,crypto_state,struct crypto_state gossipctl_new_peer,,crypto_state,struct crypto_state
27 # Tell it to release a peer which has initialized.
28 gossipctl_release_peer,2
29 gossipctl_release_peer,0,unique_id,8 gossipctl_release_peer,,unique_id,8
30 # This releases the peer and returns the cryptostate (followed two fds: peer and gossip)
31 gossipctl_release_peer_reply,102
32 gossipctl_release_peer_reply,0,unique_id,8 gossipctl_release_peer_reply,,unique_id,8
33 gossipctl_release_peer_reply,8,crypto_state,struct crypto_state gossipctl_release_peer_reply,,crypto_state,struct crypto_state
34 # This is where we save a peer's features.
35 #gossipstatus_peer_features,1
36 #gossipstatus_peer_features,0,unique_id,8 #gossipstatus_peer_features,,unique_id,8
37 #gossipstatus_peer_features,8,gflen,2 #gossipstatus_peer_features,,gflen,2
38 #gossipstatus_peer_features,10,globalfeatures,gflen #gossipstatus_peer_features,,globalfeatures,gflen
39 #gossipstatus_peer_features,10+gflen,lflen,2 #gossipstatus_peer_features,,lflen,2
40 #gossipstatus_peer_features,12+gflen,localfeatures,lflen #gossipstatus_peer_features,,localfeatures,lflen
41 # Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip)
42 gossipstatus_peer_nongossip,4
43 gossipstatus_peer_nongossip,0,unique_id,8 gossipstatus_peer_nongossip,,unique_id,8
44 gossipstatus_peer_nongossip,10,crypto_state,struct crypto_state gossipstatus_peer_nongossip,,crypto_state,struct crypto_state
45 gossipstatus_peer_nongossip,154,len,2 gossipstatus_peer_nongossip,,len,2
46 gossipstatus_peer_nongossip,156,msg,len*u8 gossipstatus_peer_nongossip,,msg,len*u8
47 # Pass JSON-RPC getnodes call through
48 gossip_getnodes_request,5
49 #include <lightningd/gossip_msg.h>
50 gossip_getnodes_reply,105
51 gossip_getnodes_reply,0,num_nodes,u16 gossip_getnodes_reply,,num_nodes,u16
52 gossip_getnodes_reply,2,nodes,num_nodes*struct gossip_getnodes_entry gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry
53 # Pass JSON-RPC getroute call through
54 gossip_getroute_request,6
55 gossip_getroute_request,0,source,struct pubkey gossip_getroute_request,,source,struct pubkey
56 gossip_getroute_request,33,destination,struct pubkey gossip_getroute_request,,destination,struct pubkey
57 gossip_getroute_request,66,msatoshi,u32 gossip_getroute_request,,msatoshi,u32
58 gossip_getroute_request,70,riskfactor,u16 gossip_getroute_request,,riskfactor,u16
59 gossip_getroute_reply,106
60 gossip_getroute_reply,0,num_hops,u16 gossip_getroute_reply,,num_hops,u16
61 gossip_getroute_reply,2,hops,num_hops*struct route_hop gossip_getroute_reply,,hops,num_hops*struct route_hop
62 gossip_getchannels_request,7
63 gossip_getchannels_reply,107
64 gossip_getchannels_reply,0,num_channels,u16 gossip_getchannels_reply,,num_channels,u16
65 gossip_getchannels_reply,2,nodes,num_channels*struct gossip_getchannels_entry gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
66 # Ping/pong test.
67 gossip_ping,8
68 gossip_ping,0,unique_id,u64 gossip_ping,,unique_id,u64
69 gossip_ping,0,num_pong_bytes,u16 gossip_ping,,num_pong_bytes,u16
70 gossip_ping,0,len,u16 gossip_ping,,len,u16
71 gossip_ping_reply,108
72 gossip_ping_reply,0,totlen,u16 gossip_ping_reply,,totlen,u16
73 # Given a short_channel_id, return the endpoints
74 gossip_resolve_channel_request,9
75 gossip_resolve_channel_request,0,channel_id,struct short_channel_id gossip_resolve_channel_request,,channel_id,struct short_channel_id
76 gossip_resolve_channel_reply,109
77 gossip_resolve_channel_reply,0,num_keys,u16 gossip_resolve_channel_reply,,num_keys,u16
78 gossip_resolve_channel_reply,0,keys,num_keys*struct pubkey gossip_resolve_channel_reply,,keys,num_keys*struct pubkey
79 # The main daemon forward some gossip message to gossipd, allows injecting
80 # arbitrary gossip messages.
81 gossip_forwarded_msg,10
82 gossip_forwarded_msg,0,msglen,2 gossip_forwarded_msg,,msglen,2
83 gossip_forwarded_msg,2,msg,msglen gossip_forwarded_msg,,msg,msglen
84 # If peer is still connected, fail it (master does this for reconnect)
85 gossipctl_fail_peer,11
86 gossipctl_fail_peer,0,unique_id,8 gossipctl_fail_peer,,unique_id,8
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

View File

@ -35,22 +35,22 @@ respr_act_three,1013
success,0
handshake_responder,1
handshake_responder,1,my_id,33
handshake_responder,,my_id,33
handshake_responder_reply,101
handshake_responder_reply,0,initiator_id,33
handshake_responder_reply,33,cs,struct crypto_state
handshake_responder_reply,0,gflen,2
handshake_responder_reply,0,globalfeatures,gflen
handshake_responder_reply,0,lflen,2
handshake_responder_reply,0,localfeatures,lflen
handshake_responder_reply,,initiator_id,33
handshake_responder_reply,,cs,struct crypto_state
handshake_responder_reply,,gflen,2
handshake_responder_reply,,globalfeatures,gflen
handshake_responder_reply,,lflen,2
handshake_responder_reply,,localfeatures,lflen
handshake_initiator,2
handshake_initiator,0,my_id,33
handshake_initiator,33,responder_id,33
handshake_initiator,,my_id,33
handshake_initiator,,responder_id,33
handshake_initiator_reply,102
handshake_initiator_reply,0,cs,struct crypto_state
handshake_initiator_reply,0,gflen,2
handshake_initiator_reply,0,globalfeatures,gflen
handshake_initiator_reply,0,lflen,2
handshake_initiator_reply,0,localfeatures,lflen
handshake_initiator_reply,,cs,struct crypto_state
handshake_initiator_reply,,gflen,2
handshake_initiator_reply,,globalfeatures,gflen
handshake_initiator_reply,,lflen,2
handshake_initiator_reply,,localfeatures,lflen

1 #include <lightningd/cryptomsg.h>
35 handshake_responder,1
36 handshake_responder,1,my_id,33 handshake_responder,,my_id,33
37 handshake_responder_reply,101
38 handshake_responder_reply,0,initiator_id,33 handshake_responder_reply,,initiator_id,33
39 handshake_responder_reply,33,cs,struct crypto_state handshake_responder_reply,,cs,struct crypto_state
40 handshake_responder_reply,0,gflen,2 handshake_responder_reply,,gflen,2
41 handshake_responder_reply,0,globalfeatures,gflen handshake_responder_reply,,globalfeatures,gflen
42 handshake_responder_reply,0,lflen,2 handshake_responder_reply,,lflen,2
43 handshake_responder_reply,0,localfeatures,lflen handshake_responder_reply,,localfeatures,lflen
44 handshake_initiator,2
45 handshake_initiator,0,my_id,33 handshake_initiator,,my_id,33
46 handshake_initiator,33,responder_id,33 handshake_initiator,,responder_id,33
47 handshake_initiator_reply,102
48 handshake_initiator_reply,0,cs,struct crypto_state handshake_initiator_reply,,cs,struct crypto_state
49 handshake_initiator_reply,0,gflen,2 handshake_initiator_reply,,gflen,2
50 handshake_initiator_reply,0,globalfeatures,gflen handshake_initiator_reply,,globalfeatures,gflen
51 handshake_initiator_reply,0,lflen,2 handshake_initiator_reply,,lflen,2
52 handshake_initiator_reply,0,localfeatures,lflen handshake_initiator_reply,,localfeatures,lflen
53
54
55
56

View File

@ -1,21 +1,21 @@
# Give me ECDH(node-id-secret,point)
hsm_ecdh_req,1
hsm_ecdh_req,0,point,struct pubkey
hsm_ecdh_req,,point,struct pubkey
hsm_ecdh_resp,100
hsm_ecdh_resp,0,ss,struct secret
hsm_ecdh_resp,,ss,struct secret
hsm_cannouncement_sig_req,2
hsm_cannouncement_sig_req,0,bitcoin_id,struct pubkey
hsm_cannouncement_sig_req,33,calen,u16
hsm_cannouncement_sig_req,35,ca,calen
hsm_cannouncement_sig_req,,bitcoin_id,struct pubkey
hsm_cannouncement_sig_req,,calen,u16
hsm_cannouncement_sig_req,,ca,calen
hsm_cannouncement_sig_reply,102
hsm_cannouncement_sig_reply,0,node_signature,64
hsm_cannouncement_sig_reply,,node_signature,64
hsm_cupdate_sig_req,3
hsm_cupdate_sig_req,0,culen,u16
hsm_cupdate_sig_req,2,cu,culen
hsm_cupdate_sig_req,,culen,u16
hsm_cupdate_sig_req,,cu,culen
hsm_cupdate_sig_reply,103
hsm_cupdate_sig_reply,0,culen,u16
hsm_cupdate_sig_reply,2,cu,culen
hsm_cupdate_sig_reply,,culen,u16
hsm_cupdate_sig_reply,,cu,culen

View File

@ -7,23 +7,23 @@ hsmstatus_key_failed,0x8004
# Clients should not give a bad request but not the HSM's decision to crash.
hsmstatus_client_bad_request,1000
hsmstatus_client_bad_request,0,unique_id,8
hsmstatus_client_bad_request,8,len,2
hsmstatus_client_bad_request,10,msg,len*u8
hsmstatus_client_bad_request,,unique_id,8
hsmstatus_client_bad_request,,len,2
hsmstatus_client_bad_request,,msg,len*u8
# Start the HSM.
hsmctl_init,1
hsmctl_init,0,new,bool
hsmctl_init,,new,bool
hsmctl_init_reply,101
hsmctl_init_reply,0,node_id,33
hsmctl_init_reply,33,peer_seed,struct secret
hsmctl_init_reply,65,bip32_len,2
hsmctl_init_reply,67,bip32_seed,bip32_len*u8
hsmctl_init_reply,,node_id,33
hsmctl_init_reply,,peer_seed,struct secret
hsmctl_init_reply,,bip32_len,2
hsmctl_init_reply,,bip32_seed,bip32_len*u8
# ECDH returns an fd.
hsmctl_hsmfd_ecdh,3
hsmctl_hsmfd_ecdh,0,unique_id,8
hsmctl_hsmfd_ecdh,,unique_id,8
# No contents, just an fd.
hsmctl_hsmfd_ecdh_fd_reply,103
@ -32,29 +32,29 @@ hsmctl_hsmfd_ecdh_fd_reply,103
#include <lightningd/utxo.h>
# FIXME: This should also take their commit sig & details, to verify.
hsmctl_sign_funding,4
hsmctl_sign_funding,0,satoshi_out,8
hsmctl_sign_funding,8,change_out,8
hsmctl_sign_funding,16,change_keyindex,4
hsmctl_sign_funding,20,our_pubkey,33
hsmctl_sign_funding,52,their_pubkey,33
hsmctl_sign_funding,85,num_inputs,2
hsmctl_sign_funding,87,inputs,num_inputs*struct utxo
hsmctl_sign_funding,,satoshi_out,8
hsmctl_sign_funding,,change_out,8
hsmctl_sign_funding,,change_keyindex,4
hsmctl_sign_funding,,our_pubkey,33
hsmctl_sign_funding,,their_pubkey,33
hsmctl_sign_funding,,num_inputs,2
hsmctl_sign_funding,,inputs,num_inputs*struct utxo
hsmctl_sign_funding_reply,104
hsmctl_sign_funding_reply,0,num_sigs,2
hsmctl_sign_funding_reply,0,sig,num_sigs*secp256k1_ecdsa_signature
hsmctl_sign_funding_reply,,num_sigs,2
hsmctl_sign_funding_reply,,sig,num_sigs*secp256k1_ecdsa_signature
# Request a client socket for a `channeld`, allows signing announcements
hsmctl_hsmfd_channeld,5
hsmctl_hsmfd_channeld,0,unique_id,8
hsmctl_hsmfd_channeld,,unique_id,8
# Empty reply, just an fd
hsmctl_hsmfd_channeld_reply,105
# Master asks the HSM to sign a node_announcement
hsmctl_node_announcement_sig_req,6
hsmctl_node_announcement_sig_req,0,annlen,2
hsmctl_node_announcement_sig_req,2,announcement,annlen*u8
hsmctl_node_announcement_sig_req,,annlen,2
hsmctl_node_announcement_sig_req,,announcement,annlen*u8
hsmctl_node_announcement_sig_reply,106
hsmctl_node_announcement_sig_reply,0,signature,secp256k1_ecdsa_signature
hsmctl_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature

1 # These are fatal.
7 # Clients should not give a bad request but not the HSM's decision to crash.
8 hsmstatus_client_bad_request,1000
9 hsmstatus_client_bad_request,0,unique_id,8 hsmstatus_client_bad_request,,unique_id,8
10 hsmstatus_client_bad_request,8,len,2 hsmstatus_client_bad_request,,len,2
11 hsmstatus_client_bad_request,10,msg,len*u8 hsmstatus_client_bad_request,,msg,len*u8
12 # Start the HSM.
13 hsmctl_init,1
14 hsmctl_init,0,new,bool hsmctl_init,,new,bool
15 hsmctl_init_reply,101
16 hsmctl_init_reply,0,node_id,33 hsmctl_init_reply,,node_id,33
17 hsmctl_init_reply,33,peer_seed,struct secret hsmctl_init_reply,,peer_seed,struct secret
18 hsmctl_init_reply,65,bip32_len,2 hsmctl_init_reply,,bip32_len,2
19 hsmctl_init_reply,67,bip32_seed,bip32_len*u8 hsmctl_init_reply,,bip32_seed,bip32_len*u8
20 # ECDH returns an fd.
21 hsmctl_hsmfd_ecdh,3
22 hsmctl_hsmfd_ecdh,0,unique_id,8 hsmctl_hsmfd_ecdh,,unique_id,8
23 # No contents, just an fd.
24 hsmctl_hsmfd_ecdh_fd_reply,103
25 # Return signature for a funding tx.
26 #include <lightningd/utxo.h>
27 # FIXME: This should also take their commit sig & details, to verify.
28 hsmctl_sign_funding,4
29 hsmctl_sign_funding,0,satoshi_out,8 hsmctl_sign_funding,,satoshi_out,8
32 hsmctl_sign_funding,20,our_pubkey,33 hsmctl_sign_funding,,our_pubkey,33
33 hsmctl_sign_funding,52,their_pubkey,33 hsmctl_sign_funding,,their_pubkey,33
34 hsmctl_sign_funding,85,num_inputs,2 hsmctl_sign_funding,,num_inputs,2
35 hsmctl_sign_funding,87,inputs,num_inputs*struct utxo hsmctl_sign_funding,,inputs,num_inputs*struct utxo
36 hsmctl_sign_funding_reply,104
37 hsmctl_sign_funding_reply,0,num_sigs,2 hsmctl_sign_funding_reply,,num_sigs,2
38 hsmctl_sign_funding_reply,0,sig,num_sigs*secp256k1_ecdsa_signature hsmctl_sign_funding_reply,,sig,num_sigs*secp256k1_ecdsa_signature
39 # Request a client socket for a `channeld`, allows signing announcements
40 hsmctl_hsmfd_channeld,5
41 hsmctl_hsmfd_channeld,0,unique_id,8 hsmctl_hsmfd_channeld,,unique_id,8
42 # Empty reply, just an fd
43 hsmctl_hsmfd_channeld_reply,105
44 # Master asks the HSM to sign a node_announcement
45 hsmctl_node_announcement_sig_req,6
46 hsmctl_node_announcement_sig_req,0,annlen,2 hsmctl_node_announcement_sig_req,,annlen,2
47 hsmctl_node_announcement_sig_req,2,announcement,annlen*u8 hsmctl_node_announcement_sig_req,,announcement,annlen*u8
48 hsmctl_node_announcement_sig_reply,106
49 hsmctl_node_announcement_sig_reply,0,signature,secp256k1_ecdsa_signature hsmctl_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature
50
51
52
53
54
55
56
57
58
59
60

View File

@ -15,63 +15,63 @@ opening_peer_bad_initial_message,0x8014
#include <lightningd/channel_config.h>
opening_init,0
# Base configuration we'll offer (channel reserve will vary with amount)
opening_init,0,our_config,struct channel_config
opening_init,,our_config,struct channel_config
# Minimum/maximum configuration values we'll accept
opening_init,36,max_to_self_delay,4
opening_init,40,min_effective_htlc_capacity_msat,8
opening_init,48,crypto_state,struct crypto_state
opening_init,,max_to_self_delay,4
opening_init,,min_effective_htlc_capacity_msat,8
opening_init,,crypto_state,struct crypto_state
# Seed to generate all the keys from
opening_init,196,seed,struct privkey
opening_init,,seed,struct privkey
# This means we offer the open.
opening_funder,1
opening_funder,0,funding_satoshis,8
opening_funder,8,push_msat,8
opening_funder,16,feerate_per_kw,4
opening_funder,20,max_minimum_depth,4
opening_funder,24,change_satoshis,u64
opening_funder,32,change_keyindex,u32
opening_funder,,funding_satoshis,8
opening_funder,,push_msat,8
opening_funder,,feerate_per_kw,4
opening_funder,,max_minimum_depth,4
opening_funder,,change_satoshis,u64
opening_funder,,change_keyindex,u32
#include <lightningd/utxo.h>
opening_funder,0,num_inputs,u16
opening_funder,0,inputs,num_inputs*struct utxo
opening_funder,0,bip32_len,u16
opening_funder,0,bip32_seed,bip32_len*u8
opening_funder,,num_inputs,u16
opening_funder,,inputs,num_inputs*struct utxo
opening_funder,,bip32_len,u16
opening_funder,,bip32_seed,bip32_len*u8
# This gives their sig, means we can broadcast tx: we're done.
opening_funder_reply,101
opening_funder_reply,0,their_config,struct channel_config
opening_funder_reply,36,first_commit_sig,secp256k1_ecdsa_signature
opening_funder_reply,100,crypto_state,struct crypto_state
opening_funder_reply,244,revocation_basepoint,33
opening_funder_reply,277,payment_basepoint,33
opening_funder_reply,310,delayed_payment_basepoint,33
opening_funder_reply,343,their_per_commit_point,33
opening_funder_reply,376,minimum_depth,4
opening_funder_reply,0,remote_fundingkey,33
opening_funder_reply,0,funding_txid,struct sha256_double
opening_funder_reply,,their_config,struct channel_config
opening_funder_reply,,first_commit_sig,secp256k1_ecdsa_signature
opening_funder_reply,,crypto_state,struct crypto_state
opening_funder_reply,,revocation_basepoint,33
opening_funder_reply,,payment_basepoint,33
opening_funder_reply,,delayed_payment_basepoint,33
opening_funder_reply,,their_per_commit_point,33
opening_funder_reply,,minimum_depth,4
opening_funder_reply,,remote_fundingkey,33
opening_funder_reply,,funding_txid,struct sha256_double
# This means they offer the open (contains their offer packet)
opening_fundee,3
opening_fundee,0,minimum_depth,4
opening_fundee,0,min_feerate,4
opening_fundee,4,max_feerate,4
opening_fundee,8,len,2
opening_fundee,10,msg,len*u8
opening_fundee,,minimum_depth,4
opening_fundee,,min_feerate,4
opening_fundee,,max_feerate,4
opening_fundee,,len,2
opening_fundee,,msg,len*u8
# This gives their txid and info, means we can send funding_signed: we're done.
opening_fundee_reply,103
opening_fundee_reply,0,their_config,struct channel_config
opening_fundee_reply,36,first_commit_sig,secp256k1_ecdsa_signature
opening_fundee_reply,100,crypto_state,struct crypto_state
opening_fundee_reply,244,revocation_basepoint,33
opening_fundee_reply,277,payment_basepoint,33
opening_fundee_reply,310,delayed_payment_basepoint,33
opening_fundee_reply,343,their_per_commit_point,33
opening_fundee_reply,0,remote_fundingkey,33
opening_fundee_reply,0,funding_txid,struct sha256_double
opening_fundee_reply,0,funding_txout,u16
opening_fundee_reply,0,funding_satoshis,8
opening_fundee_reply,0,push_msat,8
opening_fundee_reply,,their_config,struct channel_config
opening_fundee_reply,,first_commit_sig,secp256k1_ecdsa_signature
opening_fundee_reply,,crypto_state,struct crypto_state
opening_fundee_reply,,revocation_basepoint,33
opening_fundee_reply,,payment_basepoint,33
opening_fundee_reply,,delayed_payment_basepoint,33
opening_fundee_reply,,their_per_commit_point,33
opening_fundee_reply,,remote_fundingkey,33
opening_fundee_reply,,funding_txid,struct sha256_double
opening_fundee_reply,,funding_txout,u16
opening_fundee_reply,,funding_satoshis,8
opening_fundee_reply,,push_msat,8
# The (encrypted) funding signed message: send this and we're committed.
opening_fundee_reply,0,msglen,u16
opening_fundee_reply,0,funding_signed_msg,msglen*u8
opening_fundee_reply,,msglen,u16
opening_fundee_reply,,funding_signed_msg,msglen*u8

1 # These shouldn't happen
15 # Base configuration we'll offer (channel reserve will vary with amount)
16 opening_init,0,our_config,struct channel_config opening_init,,our_config,struct channel_config
17 # Minimum/maximum configuration values we'll accept
18 opening_init,36,max_to_self_delay,4 opening_init,,max_to_self_delay,4
19 opening_init,40,min_effective_htlc_capacity_msat,8 opening_init,,min_effective_htlc_capacity_msat,8
20 opening_init,48,crypto_state,struct crypto_state opening_init,,crypto_state,struct crypto_state
21 # Seed to generate all the keys from
22 opening_init,196,seed,struct privkey opening_init,,seed,struct privkey
23 # This means we offer the open.
24 opening_funder,1
25 opening_funder,0,funding_satoshis,8 opening_funder,,funding_satoshis,8
26 opening_funder,8,push_msat,8 opening_funder,,push_msat,8
27 opening_funder,16,feerate_per_kw,4 opening_funder,,feerate_per_kw,4
28 opening_funder,20,max_minimum_depth,4 opening_funder,,max_minimum_depth,4
29 opening_funder,24,change_satoshis,u64 opening_funder,,change_satoshis,u64
30 opening_funder,32,change_keyindex,u32 opening_funder,,change_keyindex,u32
31 #include <lightningd/utxo.h>
32 opening_funder,0,num_inputs,u16 opening_funder,,num_inputs,u16
33 opening_funder,0,inputs,num_inputs*struct utxo opening_funder,,inputs,num_inputs*struct utxo
34 opening_funder,0,bip32_len,u16 opening_funder,,bip32_len,u16
35 opening_funder,0,bip32_seed,bip32_len*u8 opening_funder,,bip32_seed,bip32_len*u8
36 # This gives their sig, means we can broadcast tx: we're done.
37 opening_funder_reply,101
38 opening_funder_reply,0,their_config,struct channel_config opening_funder_reply,,their_config,struct channel_config
39 opening_funder_reply,36,first_commit_sig,secp256k1_ecdsa_signature opening_funder_reply,,first_commit_sig,secp256k1_ecdsa_signature
40 opening_funder_reply,100,crypto_state,struct crypto_state opening_funder_reply,,crypto_state,struct crypto_state
41 opening_funder_reply,244,revocation_basepoint,33 opening_funder_reply,,revocation_basepoint,33
42 opening_funder_reply,277,payment_basepoint,33 opening_funder_reply,,payment_basepoint,33
43 opening_funder_reply,310,delayed_payment_basepoint,33 opening_funder_reply,,delayed_payment_basepoint,33
44 opening_funder_reply,343,their_per_commit_point,33 opening_funder_reply,,their_per_commit_point,33
45 opening_funder_reply,376,minimum_depth,4 opening_funder_reply,,minimum_depth,4
46 opening_funder_reply,0,remote_fundingkey,33 opening_funder_reply,,remote_fundingkey,33
47 opening_funder_reply,0,funding_txid,struct sha256_double opening_funder_reply,,funding_txid,struct sha256_double
48 # This means they offer the open (contains their offer packet)
49 opening_fundee,3
50 opening_fundee,0,minimum_depth,4 opening_fundee,,minimum_depth,4
51 opening_fundee,0,min_feerate,4 opening_fundee,,min_feerate,4
52 opening_fundee,4,max_feerate,4 opening_fundee,,max_feerate,4
53 opening_fundee,8,len,2 opening_fundee,,len,2
54 opening_fundee,10,msg,len*u8 opening_fundee,,msg,len*u8
55 # This gives their txid and info, means we can send funding_signed: we're done.
56 opening_fundee_reply,103
57 opening_fundee_reply,0,their_config,struct channel_config opening_fundee_reply,,their_config,struct channel_config
58 opening_fundee_reply,36,first_commit_sig,secp256k1_ecdsa_signature opening_fundee_reply,,first_commit_sig,secp256k1_ecdsa_signature
59 opening_fundee_reply,100,crypto_state,struct crypto_state opening_fundee_reply,,crypto_state,struct crypto_state
60 opening_fundee_reply,244,revocation_basepoint,33 opening_fundee_reply,,revocation_basepoint,33
61 opening_fundee_reply,277,payment_basepoint,33 opening_fundee_reply,,payment_basepoint,33
62 opening_fundee_reply,310,delayed_payment_basepoint,33 opening_fundee_reply,,delayed_payment_basepoint,33
63 opening_fundee_reply,343,their_per_commit_point,33 opening_fundee_reply,,their_per_commit_point,33
64 opening_fundee_reply,0,remote_fundingkey,33 opening_fundee_reply,,remote_fundingkey,33
65 opening_fundee_reply,0,funding_txid,struct sha256_double opening_fundee_reply,,funding_txid,struct sha256_double
66 opening_fundee_reply,0,funding_txout,u16 opening_fundee_reply,,funding_txout,u16
67 opening_fundee_reply,0,funding_satoshis,8 opening_fundee_reply,,funding_satoshis,8
68 opening_fundee_reply,0,push_msat,8 opening_fundee_reply,,push_msat,8
69 # The (encrypted) funding signed message: send this and we're committed.
70 opening_fundee_reply,0,msglen,u16 opening_fundee_reply,,msglen,u16
71 opening_fundee_reply,0,funding_signed_msg,msglen*u8 opening_fundee_reply,,funding_signed_msg,msglen*u8
72
73
74
75
76
77