core-lightning/gossipd/gossip_wire.csv
Rusty Russell be1f33b265 gossipd: have master explicitly tell us when peer is disconnected.
Currently we intuit it from the fd being closed, but that may happen out
of order with when the master thinks it's dead.

So now if the gossip fd closes we just ignore it, and we'll get a
notification from the master when the peer is disconnected.

The notification is slightly ugly in that we have to disable it for
a channel when we manually hand the channel back to gossipd.

Note: as stands, this is racy with reconnects.  See the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-26 05:47:57 +00:00

8.3 KiB

1#include <common/cryptomsg.h>
2#include <common/wireaddr.h>
3#include <wire/gen_onion_wire.h>
4# Initialize the gossip daemon.
5gossipctl_init,3000
6gossipctl_init,,broadcast_interval,u32
7gossipctl_init,,chain_hash,struct bitcoin_blkid
8gossipctl_init,,id,struct pubkey
9# If non-zero, port to listen on.
10gossipctl_init,,port,u16
11gossipctl_init,,gflen,u16
12gossipctl_init,,gfeatures,gflen*u8
13gossipctl_init,,lflen,u16
14gossipctl_init,,lfeatures,lflen*u8
15gossipctl_init,,num_wireaddrs,u16
16gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr
17gossipctl_init,,rgb,3*u8
18gossipctl_init,,alias,32*u8
19gossipctl_init,,update_channel_interval,u32
20# DEVELOPER only
21gossipctl_init,,no_reconnect,bool
22# Gossipd->master, I am ready.
23gossipctl_init_reply,3100
24# Master -> gossipd: Optional hint for where to find peer.
25gossipctl_peer_addrhint,3014
26gossipctl_peer_addrhint,,id,struct pubkey
27gossipctl_peer_addrhint,,addr,struct wireaddr
28# Master -> gossipd: connect to a peer.
29gossipctl_connect_to_peer,3001
30gossipctl_connect_to_peer,,id,struct pubkey
31# Gossipd->master: result (not a reply since it can be out-of-order, but
32# you will get one reply for every request).
33gossipctl_connect_to_peer_result,3020
34gossipctl_connect_to_peer_result,,id,struct pubkey
35# True it connected.
36gossipctl_connect_to_peer_result,,connected,bool
37# Otherwise, why we can't reach them.
38gossipctl_connect_to_peer_result,,failreason,wirestring
39# Master -> gossipd: try to always maintain connection to this peer (or not)
40gossipctl_peer_important,3010
41gossipctl_peer_important,,id,struct pubkey
42gossipctl_peer_important,,important,bool
43# Gossipd -> master: we got a peer. Two fds: peer and gossip
44gossip_peer_connected,3002
45gossip_peer_connected,,id,struct pubkey
46gossip_peer_connected,,addr,struct wireaddr
47gossip_peer_connected,,crypto_state,struct crypto_state
48gossip_peer_connected,,gflen,u16
49gossip_peer_connected,,gfeatures,gflen*u8
50gossip_peer_connected,,lflen,u16
51gossip_peer_connected,,lfeatures,lflen*u8
52# Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip
53gossip_peer_nongossip,3003
54gossip_peer_nongossip,,id,struct pubkey
55gossip_peer_nongossip,,addr,struct wireaddr
56gossip_peer_nongossip,,crypto_state,struct crypto_state
57gossip_peer_nongossip,,gflen,u16
58gossip_peer_nongossip,,gfeatures,gflen*u8
59gossip_peer_nongossip,,lflen,u16
60gossip_peer_nongossip,,lfeatures,lflen*u8
61gossip_peer_nongossip,,len,u16
62gossip_peer_nongossip,,msg,len*u8
63# Master -> gossipd: release a peer (so we can open a channel)
64gossipctl_release_peer,3004
65gossipctl_release_peer,,id,struct pubkey
66# Gossipd -> master: reply to gossip_release_peer. Two fds: peer and gossip.
67gossipctl_release_peer_reply,3104
68gossipctl_release_peer_reply,,addr,struct wireaddr
69gossipctl_release_peer_reply,,crypto_state,struct crypto_state
70gossipctl_release_peer_reply,,gflen,u16
71gossipctl_release_peer_reply,,gfeatures,gflen*u8
72gossipctl_release_peer_reply,,lflen,u16
73gossipctl_release_peer_reply,,lfeatures,lflen*u8
74# Gossipd -> master: reply to gossip_release_peer if we couldn't find the peer.
75gossipctl_release_peer_replyfail,3204
76# master -> gossipd: take back peer, with optional msg. (+peer fd, +gossip fd)
77gossipctl_hand_back_peer,3013
78gossipctl_hand_back_peer,,id,struct pubkey
79gossipctl_hand_back_peer,,crypto_state,struct crypto_state
80gossipctl_hand_back_peer,,len,u16
81gossipctl_hand_back_peer,,msg,len*u8
82# master -> gossipd: peer has disconnected.
83gossipctl_peer_disconnected,3015
84gossipctl_peer_disconnected,,id,struct pubkey
85# Pass JSON-RPC getnodes call through
86gossip_getnodes_request,3005
87# Can be 0 or 1 currently
88gossip_getnodes_request,,num,u16
89gossip_getnodes_request,,id,num*struct pubkey
90#include <lightningd/gossip_msg.h>
91gossip_getnodes_reply,3105
92gossip_getnodes_reply,,num_nodes,u16
93gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry
94# Pass JSON-RPC getroute call through
95gossip_getroute_request,3006
96gossip_getroute_request,,source,struct pubkey
97gossip_getroute_request,,destination,struct pubkey
98gossip_getroute_request,,msatoshi,u64
99gossip_getroute_request,,riskfactor,u16
100gossip_getroute_request,,final_cltv,u32
101gossip_getroute_request,,fuzz,double
102gossip_getroute_request,,seed,struct siphash_seed
103gossip_getroute_reply,3106
104gossip_getroute_reply,,num_hops,u16
105gossip_getroute_reply,,hops,num_hops*struct route_hop
106gossip_getchannels_request,3007
107# In practice, 0 or 1.
108gossip_getchannels_request,,num,u16
109gossip_getchannels_request,,short_channel_id,num*struct short_channel_id
110gossip_getchannels_reply,3107
111gossip_getchannels_reply,,num_channels,u16
112gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
113# Ping/pong test. Waits for a reply if it expects one.
114gossip_ping,3008
115gossip_ping,,id,struct pubkey
116gossip_ping,,num_pong_bytes,u16
117gossip_ping,,len,u16
118gossip_ping_reply,3108
119# False if id in gossip_ping was unknown.
120gossip_ping_reply,,sent,bool
121# 0 == no pong expected
122gossip_ping_reply,,totlen,u16
123# Given a short_channel_id, return the endpoints
124gossip_resolve_channel_request,3009
125gossip_resolve_channel_request,,channel_id,struct short_channel_id
126gossip_resolve_channel_reply,3109
127gossip_resolve_channel_reply,,num_keys,u16
128gossip_resolve_channel_reply,,keys,num_keys*struct pubkey
129# The main daemon asks for peers
130gossip_getpeers_request,3011
131# 0 or 1
132gossip_getpeers_request,,num,u16
133gossip_getpeers_request,,id,num*struct pubkey
134gossip_getpeers_reply,3111
135gossip_getpeers_reply,,num,u16
136gossip_getpeers_reply,,id,num*struct pubkey
137gossip_getpeers_reply,,addr,num*struct wireaddr
138gossip_getpeers_reply,,numnodes,u16
139gossip_getpeers_reply,,nodes,numnodes*struct gossip_getnodes_entry
140# Channel daemon can ask for updates for a specific channel, for sending
141# errors. Must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs!
142gossip_get_update,3012
143gossip_get_update,,short_channel_id,struct short_channel_id
144# If channel isn't known, update will be empty.
145gossip_get_update_reply,3112
146gossip_get_update_reply,,len,u16
147gossip_get_update_reply,,update,len*u8
148# Gossipd can tell channeld etc about gossip to fwd.
149gossip_send_gossip,3016
150gossip_send_gossip,,len,u16
151gossip_send_gossip,,gossip,len*u8
152# Both sides have seen the funding tx being locked, but we have not
153# yet reached the announcement depth. So we add the channel locally so
154# we can use it already.
155gossip_local_add_channel,3017
156gossip_local_add_channel,,short_channel_id,struct short_channel_id
157gossip_local_add_channel,,chain_hash,struct bitcoin_blkid
158gossip_local_add_channel,,remote_node_id,struct pubkey
159gossip_local_add_channel,,cltv_expiry_delta,u16
160gossip_local_add_channel,,htlc_minimum_msat,u64
161gossip_local_add_channel,,fee_base_msat,u32
162gossip_local_add_channel,,fee_proportional_millionths,u32
163# Gossipd->master get this tx output please.
164gossip_get_txout,3018
165gossip_get_txout,,short_channel_id,struct short_channel_id
166# master->gossipd here is the output, or empty if none.
167gossip_get_txout_reply,3118
168gossip_get_txout_reply,,short_channel_id,struct short_channel_id
169gossip_get_txout_reply,,satoshis,u64
170gossip_get_txout_reply,,len,u16
171gossip_get_txout_reply,,outscript,len*u8
172# client->gossipd: Disable the channel matching the short_channel_id
173gossip_disable_channel,3019
174gossip_disable_channel,,short_channel_id,struct short_channel_id
175gossip_disable_channel,,direction,u8
176gossip_disable_channel,,active,bool
177# master->gossipd a routing failure occurred
178gossip_routing_failure,3021
179gossip_routing_failure,,erring_node,struct pubkey
180gossip_routing_failure,,erring_channel,struct short_channel_id
181gossip_routing_failure,,failcode,u16
182gossip_routing_failure,,len,u16
183gossip_routing_failure,,channel_update,len*u8
184# master->gossipd temporarily mark a channel unroutable
185# (used in case of unparseable onion reply)
186gossip_mark_channel_unroutable,3022
187gossip_mark_channel_unroutable,,channel,struct short_channel_id
188# master->gossipd: Request to disconnect from a peer.
189gossipctl_peer_disconnect,3023
190gossipctl_peer_disconnect,,id,struct pubkey
191# Gossipd -> master: reply to gossip_peer_disconnect with peer id.
192gossipctl_peer_disconnect_reply,3123
193# Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer.
194gossipctl_peer_disconnect_replyfail,3223
195gossipctl_peer_disconnect_replyfail,,isconnected,bool
196# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel
197gossip_outpoint_spent,3024
198gossip_outpoint_spent,,short_channel_id,struct short_channel_id