Make all internal message numbers unique.

We were sending a channeld message to onchaind, which was v. confusing
due to overlap.  We make all the numbers distinct, which means we can
also add an assert() that it's valid for that daemon, which catches
such errors immediately.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-09-27 06:32:48 +09:30
parent a8c60ed289
commit 72b215f6fe
7 changed files with 79 additions and 78 deletions

View file

@ -1,11 +1,11 @@
# Received and sent funding_locked
channel_normal_operation,1001
channel_normal_operation,11001
#include <common/cryptomsg.h>
#include <common/channel_config.h>
# Begin! (passes gossipd-client fd)
channel_init,1
channel_init,1000
channel_init,,chain_hash,struct sha256_double
channel_init,,funding_txid,struct sha256_double
channel_init,,funding_txout,2
@ -58,21 +58,21 @@ 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,1002
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
channel_funding_announce_depth,1003
# Tell channel to offer this htlc
channel_offer_htlc,4
channel_offer_htlc,1004
channel_offer_htlc,,amount_msat,8
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,1104
channel_offer_htlc_reply,,id,8
# Zero failure code means success.
channel_offer_htlc_reply,,failure_code,2
@ -81,12 +81,12 @@ 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,1005
channel_fulfill_htlc,,id,8
channel_fulfill_htlc,,payment_preimage,struct preimage
# Main daemon says HTLC failed
channel_fail_htlc,6
channel_fail_htlc,1006
channel_fail_htlc,,id,8
# If malformed is non-zero, it's a BADONION code
channel_fail_htlc,,malformed,u16
@ -95,22 +95,22 @@ channel_fail_htlc,,len,2
channel_fail_htlc,,error_pkt,len*u8
# Ping/pong test.
channel_ping,11
channel_ping,1011
channel_ping,,num_pong_bytes,u16
channel_ping,,len,u16
channel_ping_reply,111
channel_ping_reply,1111
channel_ping_reply,,totlen,u16
# Channeld tells the master that the channel has been announced
channel_announced,12
channel_announced,1012
# When we receive funding_locked.
channel_got_funding_locked,19
channel_got_funding_locked,1019
channel_got_funding_locked,,next_per_commit_point,struct pubkey
# When we send a commitment_signed message, tell master.
channel_sending_commitsig,20
channel_sending_commitsig,1020
channel_sending_commitsig,,commitnum,u64
# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
channel_sending_commitsig,,num_changed,u16
@ -120,10 +120,10 @@ channel_sending_commitsig,,num_htlc_sigs,u16
channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature
# Wait for reply, to make sure it's on disk before we send commit.
channel_sending_commitsig_reply,120
channel_sending_commitsig_reply,1120
# When we have a commitment_signed message, tell master to remember.
channel_got_commitsig,21
channel_got_commitsig,1021
channel_got_commitsig,,commitnum,u64
channel_got_commitsig,,signature,secp256k1_ecdsa_signature
channel_got_commitsig,,num_htlcs,u16
@ -143,11 +143,11 @@ channel_got_commitsig,,changed,num_changed*struct changed_htlc
channel_got_commitsig,,tx,struct bitcoin_tx
# Wait for reply, to make sure it's on disk before we send revocation.
channel_got_commitsig_reply,121
channel_got_commitsig_reply,1121
#include <common/htlc_wire.h>
channel_got_revoke,22
channel_got_revoke,1022
channel_got_revoke,,revokenum,u64
channel_got_revoke,,per_commitment_secret,struct sha256
channel_got_revoke,,next_per_commit_point,struct pubkey
@ -156,22 +156,22 @@ channel_got_revoke,,num_changed,u16
channel_got_revoke,,changed,num_changed*struct changed_htlc
# Wait for reply, to make sure it's on disk before we continue
# (eg. if we sent another commitment_signed, that would implicitly ack).
channel_got_revoke_reply,122
channel_got_revoke_reply,1122
# Tell peer that channel is shutting down
channel_send_shutdown,23
channel_send_shutdown,1023
channel_send_shutdown,,scriptpubkey_len,u16
channel_send_shutdown,,scriptpubkey,scriptpubkey_len*u8
# Peer told us that channel is shutting down
channel_got_shutdown,24
channel_got_shutdown,1024
channel_got_shutdown,,scriptpubkey_len,u16
channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8
# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
channel_shutdown_complete,25
channel_shutdown_complete,1025
channel_shutdown_complete,,crypto_state,struct crypto_state
# Re-enable commit timer.
channel_dev_reenable_commit,26
channel_dev_reenable_commit_reply,126
channel_dev_reenable_commit,1026
channel_dev_reenable_commit_reply,1126

1 # Received and sent funding_locked
2 channel_normal_operation,1001 channel_normal_operation,11001
3 #include <common/cryptomsg.h>
4 #include <common/channel_config.h>
5 # Begin! (passes gossipd-client fd)
6 channel_init,1 channel_init,1000
7 channel_init,,chain_hash,struct sha256_double
8 channel_init,,funding_txid,struct sha256_double
9 channel_init,,funding_txout,2
10 channel_init,,funding_satoshi,8
11 channel_init,,our_config,struct channel_config
58 channel_funding_locked,2 channel_funding_locked,1002
59 channel_funding_locked,,short_channel_id,struct short_channel_id
60 # Tell the channel that we may announce the channel's existence
61 channel_funding_announce_depth,3 channel_funding_announce_depth,1003
62 # Tell channel to offer this htlc
63 channel_offer_htlc,4 channel_offer_htlc,1004
64 channel_offer_htlc,,amount_msat,8
65 channel_offer_htlc,,cltv_expiry,4
66 channel_offer_htlc,,payment_hash,32
67 channel_offer_htlc,,onion_routing_packet,1366*u8
68 # Reply; synchronous since IDs have to increment.
69 channel_offer_htlc_reply,104 channel_offer_htlc_reply,1104
70 channel_offer_htlc_reply,,id,8
71 # Zero failure code means success.
72 channel_offer_htlc_reply,,failure_code,2
73 channel_offer_htlc_reply,,failurestrlen,2
74 channel_offer_htlc_reply,,failurestr,failurestrlen*u8
75 # Main daemon found out the preimage for an htlc
76 #include <bitcoin/preimage.h>
77 channel_fulfill_htlc,5 channel_fulfill_htlc,1005
78 channel_fulfill_htlc,,id,8
81 channel_fail_htlc,6 channel_fail_htlc,1006
82 channel_fail_htlc,,id,8
83 # If malformed is non-zero, it's a BADONION code
84 channel_fail_htlc,,malformed,u16
85 # Otherwise, error_pkt contains failreason.
86 channel_fail_htlc,,len,2
87 channel_fail_htlc,,error_pkt,len*u8
88 # Ping/pong test.
89 channel_ping,11 channel_ping,1011
90 channel_ping,,num_pong_bytes,u16
91 channel_ping,,len,u16
92 channel_ping_reply,111 channel_ping_reply,1111
95 channel_announced,12 channel_announced,1012
96 # When we receive funding_locked.
97 channel_got_funding_locked,19 channel_got_funding_locked,1019
98 channel_got_funding_locked,,next_per_commit_point,struct pubkey
99 # When we send a commitment_signed message, tell master.
100 channel_sending_commitsig,20 channel_sending_commitsig,1020
101 channel_sending_commitsig,,commitnum,u64
102 # SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
103 channel_sending_commitsig,,num_changed,u16
104 channel_sending_commitsig,,changed,num_changed*struct changed_htlc
105 channel_sending_commitsig,,commit_sig,secp256k1_ecdsa_signature
106 channel_sending_commitsig,,num_htlc_sigs,u16
107 channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature
108 # Wait for reply, to make sure it's on disk before we send commit.
109 channel_sending_commitsig_reply,120 channel_sending_commitsig_reply,1120
110 # When we have a commitment_signed message, tell master to remember.
111 channel_got_commitsig,21 channel_got_commitsig,1021
112 channel_got_commitsig,,commitnum,u64
113 channel_got_commitsig,,signature,secp256k1_ecdsa_signature
114 channel_got_commitsig,,num_htlcs,u16
115 channel_got_commitsig,,htlc_signature,num_htlcs*secp256k1_ecdsa_signature
116 # RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
120 # RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
121 channel_got_commitsig,,num_fulfilled,u16
122 channel_got_commitsig,,fulfilled,num_fulfilled*struct fulfilled_htlc
123 channel_got_commitsig,,num_failed,u16
124 channel_got_commitsig,,failed,num_failed*struct failed_htlc
125 # RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT
126 channel_got_commitsig,,num_changed,u16
127 channel_got_commitsig,,changed,num_changed*struct changed_htlc
128 channel_got_commitsig,,tx,struct bitcoin_tx
129 # Wait for reply, to make sure it's on disk before we send revocation.
143 channel_send_shutdown,23 channel_send_shutdown,1023
144 channel_send_shutdown,,scriptpubkey_len,u16
145 channel_send_shutdown,,scriptpubkey,scriptpubkey_len*u8
146 # Peer told us that channel is shutting down
147 channel_got_shutdown,24 channel_got_shutdown,1024
148 channel_got_shutdown,,scriptpubkey_len,u16
149 channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8
150 # Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
151 channel_shutdown_complete,25 channel_shutdown_complete,1025
152 channel_shutdown_complete,,crypto_state,struct crypto_state
153 # Re-enable commit timer.
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

View file

@ -1,7 +1,7 @@
#include <common/cryptomsg.h>
#include <common/htlc_wire.h>
# Begin! (passes peer fd, gossipd-client fd)
closing_init,1
closing_init,2001
closing_init,,crypto_state,struct crypto_state
closing_init,,seed,struct privkey
closing_init,,funding_txid,struct sha256_double
@ -25,11 +25,11 @@ closing_init,,next_index_remote,u64
closing_init,,revocations_received,u64
# We received an offer, save signature.
closing_received_signature,2
closing_received_signature,2002
closing_received_signature,,signature,secp256k1_ecdsa_signature
closing_received_signature,,tx,struct bitcoin_tx
closing_received_signature_reply,102
closing_received_signature_reply,2102
# Negotiations complete, we're exiting.
closing_complete,4
closing_complete,2004

1 #include <common/cryptomsg.h>
2 #include <common/htlc_wire.h>
3 # Begin! (passes peer fd, gossipd-client fd)
4 closing_init,1 closing_init,2001
5 closing_init,,crypto_state,struct crypto_state
6 closing_init,,seed,struct privkey
7 closing_init,,funding_txid,struct sha256_double
25 closing_init,,revocations_received,u64
26 # We received an offer, save signature.
27 closing_received_signature,2 closing_received_signature,2002
28 closing_received_signature,,signature,secp256k1_ecdsa_signature
29 closing_received_signature,,tx,struct bitcoin_tx
30 closing_received_signature_reply,102 closing_received_signature_reply,2102
31 # Negotiations complete, we're exiting.
32 closing_complete,4 closing_complete,2004
33
34
35

View file

@ -1,11 +1,11 @@
# Peers can give a bad message, we close their fd, but no harm done.
gossipstatus_peer_bad_msg,1000
gossipstatus_peer_bad_msg,13000
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,13001
gossipstatus_peer_failed,,unique_id,8
gossipstatus_peer_failed,,len,2
gossipstatus_peer_failed,,err,len*u8
@ -13,29 +13,29 @@ gossipstatus_peer_failed,,err,len*u8
#include <common/cryptomsg.h>
# Initialize the gossip daemon
gossipctl_init,0
gossipctl_init,3000
gossipctl_init,,broadcast_interval,4
gossipctl_init,,chain_hash,struct sha256_double
# 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,3001
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,3002
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,3102
gossipctl_release_peer_reply,,crypto_state,struct crypto_state
# This is if we couldn't find the peer.
gossipctl_release_peer_replyfail,202
gossipctl_release_peer_replyfail,3202
# This is where we save a peer's features.
#gossipstatus_peer_features,1
#gossipstatus_peer_features,3001
#gossipstatus_peer_features,,unique_id,8
#gossipstatus_peer_features,,gflen,2
#gossipstatus_peer_features,,globalfeatures,gflen
@ -43,72 +43,72 @@ gossipctl_release_peer_replyfail,202
#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,3004
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
gossip_getnodes_request,3005
#include <lightningd/gossip_msg.h>
gossip_getnodes_reply,105
gossip_getnodes_reply,3105
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,3006
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,3106
gossip_getroute_reply,,num_hops,u16
gossip_getroute_reply,,hops,num_hops*struct route_hop
gossip_getchannels_request,7
gossip_getchannels_request,3007
gossip_getchannels_reply,107
gossip_getchannels_reply,3107
gossip_getchannels_reply,,num_channels,u16
gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
# Ping/pong test.
gossip_ping,8
gossip_ping,3008
gossip_ping,,unique_id,u64
gossip_ping,,num_pong_bytes,u16
gossip_ping,,len,u16
gossip_ping_reply,108
gossip_ping_reply,3108
gossip_ping_reply,,totlen,u16
# Given a short_channel_id, return the endpoints
gossip_resolve_channel_request,9
gossip_resolve_channel_request,3009
gossip_resolve_channel_request,,channel_id,struct short_channel_id
gossip_resolve_channel_reply,109
gossip_resolve_channel_reply,3109
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,3010
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,3011
gossipctl_fail_peer,,unique_id,8
# Get a gossip fd for this peer (it has reconnected)
gossipctl_get_peer_gossipfd,12
gossipctl_get_peer_gossipfd,3012
gossipctl_get_peer_gossipfd,,unique_id,u64
# Does it want a full dump of gossip?
gossipctl_get_peer_gossipfd,,sync,bool
# + fd.
gossipctl_get_peer_gossipfd_reply,112
gossipctl_get_peer_gossipfd_reply,3112
# Failure (can't make new socket)
gossipctl_get_peer_gossipfd_replyfail,212
gossipctl_get_peer_gossipfd_replyfail,3212

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

View file

@ -1,17 +1,17 @@
#include <common/cryptomsg.h>
# FIXME: This is probably too finegrained.
initr_act_one,1001
initr_act_two,1002
initr_act_three,1003
respr_act_one,1011
respr_act_two,1012
respr_act_three,1013
success,0
initr_act_one,14001
initr_act_two,14002
initr_act_three,14003
respr_act_one,14011
respr_act_two,14012
respr_act_three,14013
success,4000
handshake_responder,1
handshake_responder,4001
handshake_responder,,my_id,33
handshake_responder_reply,101
handshake_responder_reply,4101
handshake_responder_reply,,initiator_id,33
handshake_responder_reply,,cs,struct crypto_state
handshake_responder_reply,,gflen,2
@ -19,11 +19,11 @@ handshake_responder_reply,,globalfeatures,gflen
handshake_responder_reply,,lflen,2
handshake_responder_reply,,localfeatures,lflen
handshake_initiator,2
handshake_initiator,4002
handshake_initiator,,my_id,33
handshake_initiator,,responder_id,33
handshake_initiator_reply,102
handshake_initiator_reply,4102
handshake_initiator_reply,,cs,struct crypto_state
handshake_initiator_reply,,gflen,2
handshake_initiator_reply,,globalfeatures,gflen

1 #include <common/cryptomsg.h>
2 # FIXME: This is probably too finegrained.
3 initr_act_one,1001 initr_act_one,14001
4 initr_act_two,1002 initr_act_two,14002
5 initr_act_three,1003 initr_act_three,14003
6 respr_act_one,1011 respr_act_one,14011
7 respr_act_two,1012 respr_act_two,14012
8 respr_act_three,1013 respr_act_three,14013
9 success,0 success,4000
10 handshake_responder,1 handshake_responder,4001
11 handshake_responder,,my_id,33
12 handshake_responder_reply,101 handshake_responder_reply,4101
13 handshake_responder_reply,,initiator_id,33
14 handshake_responder_reply,,cs,struct crypto_state
15 handshake_responder_reply,,gflen,2
16 handshake_responder_reply,,globalfeatures,gflen
17 handshake_responder_reply,,lflen,2
19 handshake_initiator,2 handshake_initiator,4002
20 handshake_initiator,,my_id,33
21 handshake_initiator,,responder_id,33
22 handshake_initiator_reply,102 handshake_initiator_reply,4102
23 handshake_initiator_reply,,cs,struct crypto_state
24 handshake_initiator_reply,,gflen,2
25 handshake_initiator_reply,,globalfeatures,gflen
26 handshake_initiator_reply,,lflen,2
27 handshake_initiator_reply,,localfeatures,lflen
28
29

View file

@ -551,6 +551,7 @@ struct subd *new_subd(const tal_t *ctx,
void subd_send_msg(struct subd *sd, const u8 *msg_out)
{
assert(!strstarts(sd->msgname(fromwire_peektype(msg_out)), "INVALID"));
msg_enqueue(&sd->outq, msg_out);
}

View file

@ -1,6 +1,6 @@
#include <common/htlc_wire.h>
# Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
onchain_init,1
onchain_init,5001
onchain_init,,seed,struct privkey
onchain_init,,shachain,struct shachain
onchain_init,,funding_amount_satoshi,u64
@ -33,48 +33,48 @@ onchain_init,,num_htlcs,u64
#include <onchaind/onchain_wire.h>
# This is all the HTLCs: one per message
onchain_htlc,2
onchain_htlc,5002
onchain_htlc,,htlc,struct 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
# This sets what the state is, depending on tx.
onchain_init_reply,101
onchain_init_reply,5101
onchain_init_reply,,state,u8
# onchaind->master: Send out a tx.
onchain_broadcast_tx,3
onchain_broadcast_tx,5003
onchain_broadcast_tx,,tx,struct bitcoin_tx
# master->onchaind: Notifier that an output has been spent by input_num of tx.
onchain_spent,4
onchain_spent,5004
onchain_spent,,tx,struct bitcoin_tx
onchain_spent,,input_num,u32
onchain_spent,,blockheight,u32
# master->onchaind: We will receive more than one of these, as depth changes.
onchain_depth,5
onchain_depth,5005
onchain_depth,,txid,struct sha256_double
onchain_depth,,depth,u32
# onchaind->master: We don't want to watch this tx, or its outputs
onchain_unwatch_tx,6
onchain_unwatch_tx,5006
onchain_unwatch_tx,,txid,struct sha256_double
onchain_unwatch_tx,,num_outputs,u32
# master->onchaind: We know HTLC preimage
onchain_known_preimage,7
onchain_known_preimage,5007
onchain_known_preimage,,preimage,struct preimage
# onchaind->master: We discovered HTLC preimage
onchain_extracted_preimage,8
onchain_extracted_preimage,5008
onchain_extracted_preimage,,preimage,struct preimage
# onchaind->master: this HTLC was missing from commit tx.
onchain_missing_htlc_output,9
onchain_missing_htlc_output,5009
onchain_missing_htlc_output,,htlc,struct htlc_stub
# onchaind->master: this HTLC has timed out (after reasonable_depth)
onchain_htlc_timeout,10
onchain_htlc_timeout,5010
onchain_htlc_timeout,,htlc,struct htlc_stub

1 #include <common/htlc_wire.h>
2 # Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
3 onchain_init,1 onchain_init,5001
4 onchain_init,,seed,struct privkey
5 onchain_init,,shachain,struct shachain
6 onchain_init,,funding_amount_satoshi,u64
33 #include <onchaind/onchain_wire.h>
34 # This is all the HTLCs: one per message
35 onchain_htlc,2 onchain_htlc,5002
36 onchain_htlc,,htlc,struct htlc_stub
37 # If it's not in the commitment tx, tell us (immediately or htlc_missing_depth)
38 onchain_htlc,,tell_if_missing,bool
39 onchain_htlc,,tell_immediately,bool
40 # This sets what the state is, depending on tx.
41 onchain_init_reply,101 onchain_init_reply,5101
42 onchain_init_reply,,state,u8
43 # onchaind->master: Send out a tx.
44 onchain_broadcast_tx,3 onchain_broadcast_tx,5003
45 onchain_broadcast_tx,,tx,struct bitcoin_tx
46 # master->onchaind: Notifier that an output has been spent by input_num of tx.
47 onchain_spent,4 onchain_spent,5004
48 onchain_spent,,tx,struct bitcoin_tx
49 onchain_spent,,input_num,u32
50 onchain_spent,,blockheight,u32
51 # master->onchaind: We will receive more than one of these, as depth changes.
52 onchain_depth,5 onchain_depth,5005
53 onchain_depth,,txid,struct sha256_double
54 onchain_depth,,depth,u32
55 # onchaind->master: We don't want to watch this tx, or its outputs
56 onchain_unwatch_tx,6 onchain_unwatch_tx,5006
57 onchain_unwatch_tx,,txid,struct sha256_double
58 onchain_unwatch_tx,,num_outputs,u32
59 # master->onchaind: We know HTLC preimage
60 onchain_known_preimage,7 onchain_known_preimage,5007
61 onchain_known_preimage,,preimage,struct preimage
62 # onchaind->master: We discovered HTLC preimage
63 onchain_extracted_preimage,8 onchain_extracted_preimage,5008
64 onchain_extracted_preimage,,preimage,struct preimage
65 # onchaind->master: this HTLC was missing from commit tx.
66 onchain_missing_htlc_output,9 onchain_missing_htlc_output,5009
67 onchain_missing_htlc_output,,htlc,struct htlc_stub
68 # onchaind->master: this HTLC has timed out (after reasonable_depth)
69 onchain_htlc_timeout,10 onchain_htlc_timeout,5010
70 onchain_htlc_timeout,,htlc,struct htlc_stub
71
72
73
74
75
76
77
78
79
80

View file

@ -1,6 +1,6 @@
#include <common/cryptomsg.h>
#include <common/channel_config.h>
opening_init,0
opening_init,6000
# Which network are we configured for (as index into the chainparams)?
opening_init,,network_index,4
# Base configuration we'll offer (channel reserve will vary with amount)
@ -15,7 +15,7 @@ opening_init,,seed,struct privkey
#include <common/bip32.h>
#include <common/htlc_wire.h>
# This means we offer the open.
opening_funder,1
opening_funder,6001
opening_funder,,funding_satoshis,8
opening_funder,,push_msat,8
opening_funder,,feerate_per_kw,4
@ -29,7 +29,7 @@ opening_funder,,inputs,num_inputs*struct utxo
opening_funder,,bip32,struct ext_key
# This gives their sig, means we can broadcast tx: we're done.
opening_funder_reply,101
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,secp256k1_ecdsa_signature
@ -44,7 +44,7 @@ opening_funder_reply,,funding_txid,struct sha256_double
opening_funder_reply,,feerate_per_kw,4
# This means they offer the open (contains their offer packet)
opening_fundee,3
opening_fundee,6003
opening_fundee,,minimum_depth,4
opening_fundee,,min_feerate,4
opening_fundee,,max_feerate,4
@ -52,7 +52,7 @@ 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,6103
opening_fundee_reply,,their_config,struct channel_config
opening_fundee_reply,,first_commit,struct bitcoin_tx
opening_fundee_reply,,first_commit_sig,secp256k1_ecdsa_signature

1 #include <common/cryptomsg.h>
2 #include <common/channel_config.h>
3 opening_init,0 opening_init,6000
4 # Which network are we configured for (as index into the chainparams)?
5 opening_init,,network_index,4
6 # Base configuration we'll offer (channel reserve will vary with amount)
15 #include <common/htlc_wire.h>
16 # This means we offer the open.
17 opening_funder,1 opening_funder,6001
18 opening_funder,,funding_satoshis,8
19 opening_funder,,push_msat,8
20 opening_funder,,feerate_per_kw,4
21 opening_funder,,max_minimum_depth,4
29 # This gives their sig, means we can broadcast tx: we're done.
30 opening_funder_reply,101 opening_funder_reply,6101
31 opening_funder_reply,,their_config,struct channel_config
32 opening_funder_reply,,first_commit,struct bitcoin_tx
33 opening_funder_reply,,first_commit_sig,secp256k1_ecdsa_signature
34 opening_funder_reply,,crypto_state,struct crypto_state
35 opening_funder_reply,,revocation_basepoint,33
44 opening_fundee,3 opening_fundee,6003
45 opening_fundee,,minimum_depth,4
46 opening_fundee,,min_feerate,4
47 opening_fundee,,max_feerate,4
48 opening_fundee,,len,2
49 opening_fundee,,msg,len*u8
50 # This gives their txid and info, means we can send funding_signed: we're done.
52 opening_fundee_reply,,their_config,struct channel_config
53 opening_fundee_reply,,first_commit,struct bitcoin_tx
54 opening_fundee_reply,,first_commit_sig,secp256k1_ecdsa_signature
55 opening_fundee_reply,,crypto_state,struct crypto_state
56 opening_fundee_reply,,revocation_basepoint,33
57 opening_fundee_reply,,payment_basepoint,33
58 opening_fundee_reply,,delayed_payment_basepoint,33