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