Files
palladum-lightning/connectd/connectd_wire.csv
Rusty Russell 5f5440383d lightningd: fix race with crossover pings.
We cannot use subd_req() here: replies will come out of order, and the
we should not simply assign the reponses in FIFO order.

Changelog-Fixed: lightningd: don't get confused with parallel ping commands.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-08-14 17:35:39 +09:30

7.9 KiB

1#include <bitcoin/block.h>
2#include <common/channel_id.h>
3#include <common/cryptomsg.h>
4#include <common/features.h>
5#include <common/node_id.h>
6#include <common/wireaddr.h>
7#include <wire/onion_wire.h>
8msgtype,connectd_init,2000
9msgdata,connectd_init,chainparams,chainparams,
10msgdata,connectd_init,our_features,feature_set,
11msgdata,connectd_init,id,node_id,
12msgdata,connectd_init,num_wireaddrs,u16,
13msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs
14msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs
15msgdata,connectd_init,tor_proxyaddr,?wireaddr,
16msgdata,connectd_init,use_tor_proxy_always,bool,
17msgdata,connectd_init,dev_allow_localhost,bool,
18msgdata,connectd_init,use_dns,bool,
19msgdata,connectd_init,tor_password,wirestring,
20msgdata,connectd_init,timeout_secs,u32,
21msgdata,connectd_init,websocket_helper,wirestring,
22msgdata,connectd_init,announce_websocket,bool,
23msgdata,connectd_init,dev_fast_gossip,bool,
24# If this is set, then fd 5 is dev_disconnect_fd.
25msgdata,connectd_init,dev_disconnect,bool,
26msgdata,connectd_init,dev_no_ping_timer,bool,
27# Allow incoming connections, but don't talk.
28msgdata,connectd_init,dev_noreply,bool,
29msgdata,connectd_init,dev_throttle_gossip,bool,
30msgdata,connectd_init,dev_no_reconnect,bool,
31msgdata,connectd_init,dev_fast_reconnect,bool,
32msgdata,connectd_init,dev_limit_connections_inflight,bool,
33# Connectd->master, here are the addresses I bound, can announce.
34msgtype,connectd_init_reply,2100
35msgdata,connectd_init_reply,num_bindings,u16,
36msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings
37msgdata,connectd_init_reply,num_announceable,u16,
38msgdata,connectd_init_reply,announceable,wireaddr,num_announceable
39msgdata,connectd_init_reply,failmsg,?wirestring,
40# Activate the connect daemon, so others can connect.
41msgtype,connectd_activate,2025
42# Do we listen?
43msgdata,connectd_activate,listen,bool,
44# Set the allowed (i.e. don't hang up on!) unknown messages.
45msgtype,connectd_set_custommsgs,2007
46msgdata,connectd_set_custommsgs,len,u32,
47msgdata,connectd_set_custommsgs,msgnums,u16,len
48# Connectd->master, I am ready.
49msgtype,connectd_activate_reply,2125
50msgdata,connectd_activate_reply,failmsg,?wirestring,
51# lightningd -> connectd: here's an SCID->peer mapping for onion messages
52msgtype,connectd_scid_map,2024
53msgdata,connectd_scid_map,scid,short_channel_id,
54msgdata,connectd_scid_map,node_id,node_id,
55# Master -> connectd: connect to a peer.
56# If !transient, we will keep trying to connect.
57msgtype,connectd_connect_to_peer,2001
58msgdata,connectd_connect_to_peer,id,node_id,
59msgdata,connectd_connect_to_peer,len,u32,
60msgdata,connectd_connect_to_peer,addrs,wireaddr_internal,len
61msgdata,connectd_connect_to_peer,transient,bool,
62# Connectd->master: connect failed.
63msgtype,connectd_connect_failed,2020
64msgdata,connectd_connect_failed,id,node_id,
65msgdata,connectd_connect_failed,failcode,enum jsonrpc_errcode,
66msgdata,connectd_connect_failed,failreason,wirestring,
67# Connectd -> master: we got a peer.
68msgtype,connectd_peer_connected,2002
69msgdata,connectd_peer_connected,id,node_id,
70msgdata,connectd_peer_connected,counter,u64,
71msgdata,connectd_peer_connected,addr,wireaddr_internal,
72msgdata,connectd_peer_connected,remote_addr,?wireaddr,
73msgdata,connectd_peer_connected,incoming,bool,
74msgdata,connectd_peer_connected,flen,u16,
75msgdata,connectd_peer_connected,features,u8,flen
76# connectd -> master: peer disconnected.
77msgtype,connectd_peer_disconnect_done,2006
78msgdata,connectd_peer_disconnect_done,id,node_id,
79msgdata,connectd_peer_disconnect_done,counter,u64,
80# Master -> connectd: make peer active immediately (we want to talk) (+ fd to subd).
81msgtype,connectd_peer_connect_subd,2004
82msgdata,connectd_peer_connect_subd,id,node_id,
83msgdata,connectd_peer_connect_subd,counter,u64,
84msgdata,connectd_peer_connect_subd,channel_id,channel_id,
85# Connectd -> master: peer said something interesting
86msgtype,connectd_peer_spoke,2005
87msgdata,connectd_peer_spoke,id,node_id,
88msgdata,connectd_peer_spoke,counter,u64,
89msgdata,connectd_peer_spoke,msgtype,u16,
90msgdata,connectd_peer_spoke,channel_id,channel_id,
91# If msgtype == WIRE_ERROR, this is the string.
92msgdata,connectd_peer_spoke,error,?wirestring,
93# master -> connectd: peer no longer reqeuired, don't keep reconnecting.
94msgtype,connectd_downgrade_peer,2015
95msgdata,connectd_downgrade_peer,id,node_id,
96# master -> connectd: force disconnect of peer.
97msgtype,connectd_disconnect_peer,2016
98msgdata,connectd_disconnect_peer,id,node_id,
99msgdata,connectd_disconnect_peer,counter,u64,
100# master -> connectd: give message to peer.
101msgtype,connectd_peer_send_msg,2003
102msgdata,connectd_peer_send_msg,id,node_id,
103msgdata,connectd_peer_send_msg,counter,u64,
104msgdata,connectd_peer_send_msg,len,u16,
105msgdata,connectd_peer_send_msg,msg,u8,len
106# master -> connectd: do you have a memleak?
107msgtype,connectd_dev_memleak,2033
108msgtype,connectd_dev_memleak_reply,2133
109msgdata,connectd_dev_memleak_reply,leak,bool,
110# master -> connectd: dump status of your fds.
111msgtype,connectd_dev_report_fds,2034
112# Ping/pong test. Waits for a reply if it expects one.
113msgtype,connectd_ping,2030
114msgdata,connectd_ping,reqid,u64,
115msgdata,connectd_ping,id,node_id,
116msgdata,connectd_ping,num_pong_bytes,u16,
117msgdata,connectd_ping,len,u16,
118msgtype,connectd_ping_done,2037
119msgdata,connectd_ping_done,reqid,u64,
120# False if we there was already a ping in progress.
121msgdata,connectd_ping_done,sent,bool,
122# 0 == no pong expected, otherwise length of pong.
123msgdata,connectd_ping_done,totlen,u16,
124# We tell lightningd we got an onionmsg
125msgtype,connectd_got_onionmsg_to_us,2145
126msgdata,connectd_got_onionmsg_to_us,path_secret,?secret,
127msgdata,connectd_got_onionmsg_to_us,reply,?blinded_path,
128msgdata,connectd_got_onionmsg_to_us,rawmsg_len,u16,
129msgdata,connectd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len
130# Lightningd tells us to send an onion message.
131msgtype,connectd_send_onionmsg,2041
132msgdata,connectd_send_onionmsg,id,node_id,
133msgdata,connectd_send_onionmsg,onion_len,u16,
134msgdata,connectd_send_onionmsg,onion,u8,onion_len
135msgdata,connectd_send_onionmsg,path_key,pubkey,
136# Lightningd tells us to digest an onion message.
137msgtype,connectd_inject_onionmsg,2042
138msgdata,connectd_inject_onionmsg,path_key,pubkey,
139msgdata,connectd_inject_onionmsg,onion_len,u16,
140msgdata,connectd_inject_onionmsg,onion,u8,onion_len
141# Reply. If error isn't empty, something went wrong.
142msgtype,connectd_inject_onionmsg_reply,2142
143msgdata,connectd_inject_onionmsg_reply,err,wirestring,
144# A custom message that we got from a peer and don't know how to handle, so we
145# forward it to the master for further handling.
146msgtype,connectd_custommsg_in,2110
147msgdata,connectd_custommsg_in,id,node_id,
148msgdata,connectd_custommsg_in,msg_len,u16,
149msgdata,connectd_custommsg_in,msg,u8,msg_len
150# A custom message that the lightningd tells us to send to the peer.
151msgtype,connectd_custommsg_out,2011
152msgdata,connectd_custommsg_out,id,node_id,
153msgdata,connectd_custommsg_out,msg_len,u16,
154msgdata,connectd_custommsg_out,msg,u8,msg_len
155# master -> connectd: we're shutting down, no new connections.
156msgtype,connectd_start_shutdown,2031
157# connect - >master: acknowledged.
158msgtype,connectd_start_shutdown_reply,2131
159# master -> connect: stop sending gossip.
160msgtype,connectd_dev_suppress_gossip,2032
161# master -> connect: waste all your fds.
162msgtype,connectd_dev_exhaust_fds,2036
163# master -> connect: set artificial maximum reply_channel_range size.
164msgtype,connectd_dev_set_max_scids_encode_size,2035
165msgdata,connectd_dev_set_max_scids_encode_size,max,u32,
166# connectd->master I couldn't forward this onionmessage
167msgtype,connectd_onionmsg_forward_fail,2012
168msgdata,connectd_onionmsg_forward_fail,source,node_id,
169msgdata,connectd_onionmsg_forward_fail,incoming_len,u16,
170msgdata,connectd_onionmsg_forward_fail,incoming,u8,incoming_len,
171msgdata,connectd_onionmsg_forward_fail,path_key,pubkey,
172msgdata,connectd_onionmsg_forward_fail,outgoing_len,u16,
173msgdata,connectd_onionmsg_forward_fail,outgoing,u8,outgoing_len,
174msgdata,connectd_onionmsg_forward_fail,next_node,?sciddir_or_pubkey,