-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler error #9
base: connectd-demux-part-2
Are you sure you want to change the base?
Commits on Dec 15, 2021
-
lightningd: close one more fd for subdaemons.
Noticed by stracing for an unrelated problem. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 31d4457 - Browse repository at this point
Copy the full SHA 31d4457View commit details -
lightningd: handle channel cleanups more explicitly.
1. Freeing an unconfirmed channel already releases the subd, so don't do that explicitly. 2. Use channel->owner to transfer ownership where possible, using channel_set_owner() which handles all the cases. This simplifies the code and makes it more readable, IMHO. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for b7268b3 - Browse repository at this point
Copy the full SHA b7268b3View commit details -
common: is_msg_gossip_broadcast() for putting things in filter.
We don't need the other "gossip" messages in our echo-suppression filter. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 23e0c9e - Browse repository at this point
Copy the full SHA 23e0c9eView commit details -
connectd: clean up lightningd connection handling.
They all returned the same thing anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 3bf0a20 - Browse repository at this point
Copy the full SHA 3bf0a20View commit details -
common: generalize extract_channel_id().
connectd is going to end up using this do demux; make it fast and complete. Fixing this reveals a problem in openingd: it now extracts the channel_id from funding_signed (which is where we transition off the temporary), and gets upset. So fix that. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 0fd02f7 - Browse repository at this point
Copy the full SHA 0fd02f7View commit details -
common/socket_close: don't wait forever.
The "read until closed" trick doesn't work if the other end doesn't close (as found in the next patch, where we use DEV_DISCONNECT_DISABLE_AFTER). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for bb635a0 - Browse repository at this point
Copy the full SHA bb635a0View commit details -
pytest: disable dev-disconnect blackhole tests.
These would have to be done by connectd, not the local daemon, once it's intermediating. Otherwise the remote peer won't see any change. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 99c08f3 - Browse repository at this point
Copy the full SHA 99c08f3View commit details -
dev_disconnect: remove @ marker.
Once connectd is doing this, we can't close as soon as we send, and in fact we can't do 'fail write' either. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 81abdcd - Browse repository at this point
Copy the full SHA 81abdcdView commit details -
channeld: add dev-disable-commit-after instead of dev-disconnect -noc…
…ommit It was always a hack, but an impossible one once connectd will be interpreting dev-disconnect! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d4ad4ce - Browse repository at this point
Copy the full SHA d4ad4ceView commit details -
gossipd: local_direction helper to generalize is_local_channel.
Increasingly we want to know is it local, and get the direction: it's more efficient to do both at once. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 2975aa3 - Browse repository at this point
Copy the full SHA 2975aa3View commit details -
gossipd: rewrite update generation, remove local_chan.
local_chan was mainly around so we could "soft" disable channels (and really disable them once we used the channel_update in an error message). Instead we introduce the idea of a "deferred_update": it's either deferred indefinitely (a peer goes offline, if we need to send it in an error we'll apply it immediatly), or simply delayed to avoid spamming everyone. The resulting rewrite is much clearer, IMHO. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 37abe30 - Browse repository at this point
Copy the full SHA 37abe30View commit details -
gossipd: make request handlers return void.
They all returned the next io_plan, but it was always the same. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 63265ed - Browse repository at this point
Copy the full SHA 63265edView commit details -
connectd: rename struct peer in peer_exchange_initmsg to early_peer.
We want to have a real (persistent) struct peer eventually. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 65beadd - Browse repository at this point
Copy the full SHA 65beaddView commit details -
connectd: keep timeout timer around so we can disable it.
connectd will be keeping the conn open, so it needs to free this "conn_timeout" timer. Pass it through, so we can do that. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for f28c3f1 - Browse repository at this point
Copy the full SHA f28c3f1View commit details -
connectd: maintain connection with peer, shuffle data.
Instead of passing the incoming socket to lightningd for the subdaemon, create a new one and simply shuffle data between them, keeping connectd in the loop. For the moment, we don't decrypt at all, just shuffle. This means our buffer code is kind of a hack, but that goes away once we start actually decrypting and understanding message boundaries. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 769b368 - Browse repository at this point
Copy the full SHA 769b368View commit details -
gossipwith: create our own internal sync_crypto functions.
This avoids changes to crypto_sync which are coming in next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for c40ac7c - Browse repository at this point
Copy the full SHA c40ac7cView commit details -
connectd: do decryption for peers.
We temporarily hack to sync_crypto_write/sync_crypto_read functions to not do any crypto, and do it all in connectd. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for a2271cd - Browse repository at this point
Copy the full SHA a2271cdView commit details -
peer_io: replace crypto_sync in daemons, use normal wire messages.
Now connectd is doing the crypto, we can use normal wire io. We create helper functions to clearly differentiate between "peer" comms and intra-daemon comms though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for bc4eff8 - Browse repository at this point
Copy the full SHA bc4eff8View commit details
Commits on Dec 20, 2021
-
per_peer_state: remove struct crypto_state
Now that connectd does the crypto, no need to hand around crypto_state. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 22ecac7 - Browse repository at this point
Copy the full SHA 22ecac7View commit details -
connectd: do dev_disconnect logic.
As connectd handles more packets itself, or diverts them to/from gossipd, it's the only place we can implement the dev_disconnect logic. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ff26d89 - Browse repository at this point
Copy the full SHA ff26d89View commit details -
connectd: do nagle by packet type.
channeld can't do it any more: it's using local sockets. Connectd can do it, and simply does it by type. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 381b62e - Browse repository at this point
Copy the full SHA 381b62eView commit details -
common: add routine for absolute timeouts (vs. relative).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ff57f6d - Browse repository at this point
Copy the full SHA ff57f6dView commit details -
connectd: serve gossip_store file for the peer.
We actually intercept the gossip_timestamp_filter, so the gossip_store mechanism inside the per-peer daemon never kicks off for normal connections. The gossipwith tool doesn't set OPT_GOSSIP_QUERIES, so it gets both, but that only effects one place. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 5c7d7b7 - Browse repository at this point
Copy the full SHA 5c7d7b7View commit details -
subdaemons: don't stream gossip_store at all.
We now let gossipd do it. This also means there's nothing left in 'struct per_peer_state' to send across the wire (the fds are sent separately), so that gets removed from wire messages too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d131293 - Browse repository at this point
Copy the full SHA d131293View commit details -
lightningd: remove per_peer_state struct.
Just hand around the two fds. We have to take a little care to close them manually now, though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for be86bae - Browse repository at this point
Copy the full SHA be86baeView commit details -
connectd: remove per_peer_state in favor of keeping gossip_fd directly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 006a335 - Browse repository at this point
Copy the full SHA 006a335View commit details -
connectd: put more stuff into struct gossip_state.
We're the only ones who use it now, so put our fields inside it and make it local. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 71b02f4 - Browse repository at this point
Copy the full SHA 71b02f4View commit details -
connectd: get addresses from lightningd, not gossipd.
It's weird to have connectd ask gossipd, when lightningd can just do it and hand all the addresses together. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d802834 - Browse repository at this point
Copy the full SHA d802834View commit details -
lightningd: start gossipd after channels are loaded.
This is in preparation for gossipd feeding us the latest channel_updates, rather than having lightningd and channeld query gossipd when it wants to send an onion error with an update included. This means gossipd will start telling us the updates, so we need the channels loaded first. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for aee1b46 - Browse repository at this point
Copy the full SHA aee1b46View commit details -
gossipd: infrastructure to tell lightningd about local channel updates.
We want it to keep the latest, so it can make its own error msgs without asking us. This installs (but does not use!) the message handler. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 3e00b5d - Browse repository at this point
Copy the full SHA 3e00b5dView commit details -
gossipd: feed lightningd the channel_updates as soon as we make them.
Even if we're deferring putting them in the store and broadcasting them, we tell lightningd so it will use it in any error messages. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 40dac53 - Browse repository at this point
Copy the full SHA 40dac53View commit details -
lightningd: tell gossipd when we use the channel_update.
This way it can flush it if it was pending. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d581a86 - Browse repository at this point
Copy the full SHA d581a86View commit details -
lightningd: use our cached channel_update for errors instead of askin…
…g gossipd. We also no longer strip the type off: everyone handles both forms, and Eclair doesn't strip (and it's easier!). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 0842e89 - Browse repository at this point
Copy the full SHA 0842e89View commit details -
channeld: keep local copy of latest channel_update for errors.
Now we don't ask gossipd, but lightningd keeps channeld up-to-date. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for a668ed2 - Browse repository at this point
Copy the full SHA a668ed2View commit details -
This only happened once, but it's possible if the node gets the new node announcement while we're querying, we could see both old and new. ``` # Get node_announcements. msgs = l1.query_gossip('gossip_timestamp_filter', genesis_blockhash, '0', '0xFFFFFFFF', # Filter out gossip_timestamp_filter, # channel_announcement and channel_updates. filters=['0109', '0102', '0100']) > assert len(msgs) == 2 E assert 3 == 2 E +3 E -2 ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ae5efef - Browse repository at this point
Copy the full SHA ae5efefView commit details -
channeld: send channel updates and announcements via lightningd.
We're weaning per-peer daemons off having a direct gossipd connection. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d336fa7 - Browse repository at this point
Copy the full SHA d336fa7View commit details -
channeld: tell gossipd about new channel earlier.
We're about to change this to go via lightningd, not direct to gossipd, and connectd will send gossip direct to gossipd. Once we do this, it introduces a race. The peer sends funding_locked then immediately sends an update_channel. channeld used to process the funding_locked from the peer, tell gossipd about the new channel, then finally forward the channel_update. With the new architecture, we can have the channel_update hit gossipd before we've told it about the channel. It ignores the channel_update. Better is to tell gossipd as soon as *we* are ready to send funding_locked; this gives a round trip time at least, before gossipd could get the update. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ad5a53e - Browse repository at this point
Copy the full SHA ad5a53eView commit details -
dualopend: tell lightningd about new channel as soon as it's locked in.
Once we send funding_locked, gossipd could start seeing channel_updates from the peer (which get sent so we can use the channel in routehints even before it's announcable). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 4078ac8 - Browse repository at this point
Copy the full SHA 4078ac8View commit details -
connectd: temporarily have two fds to gossipd.
We want to stream gossip through this, but currently connectd treats the fd as synchronous. While we work on getting rid of that, it's easiest to have two fds. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 08af613 - Browse repository at this point
Copy the full SHA 08af613View commit details -
gossipd: add routines to send gossip messages to and from connectd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for e1e7e76 - Browse repository at this point
Copy the full SHA e1e7e76View commit details -
connectd: divert gossip messages directly to gossipd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 4248fbe - Browse repository at this point
Copy the full SHA 4248fbeView commit details -
gossipd: send all gossip msgs directly to connectd, not peer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for c7c0bef - Browse repository at this point
Copy the full SHA c7c0befView commit details -
connectd: handle pings and pongs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON_RPC: `ping` now works with connected peers, even without a channel.
Configuration menu - View commit details
-
Copy full SHA for e3e8718 - Browse repository at this point
Copy the full SHA e3e8718View commit details -
connectd: handle onion messages.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 23ca389 - Browse repository at this point
Copy the full SHA 23ca389View commit details -
connectd: handle custom messages.
This is neater than what we had before, and slightly more general. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON_RPC: `sendcustommsg` now works with any connected peer, even when shutting down a channel.
Configuration menu - View commit details
-
Copy full SHA for ef6364d - Browse repository at this point
Copy the full SHA ef6364dView commit details -
channeld: simply exit if hsmd vanishes.
We currently die when gossipd vanishes, but our direct connection will go away. We then complain if the node is shutting down while we're talking to hsmd. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 460d78e - Browse repository at this point
Copy the full SHA 460d78eView commit details -
subdaemons: remove gossipd fd from per-peer daemons.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for bcf867d - Browse repository at this point
Copy the full SHA bcf867dView commit details -
Gossipd now simply gets told by channeld when peers arrive or leave. (it only needs to know for the seeker). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for eb178b8 - Browse repository at this point
Copy the full SHA eb178b8View commit details -
connectd: remove second gossip fd.
Now we only send and receive gossip messages on this fd. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 39c241b - Browse repository at this point
Copy the full SHA 39c241bView commit details -
connectd: don't received useless peer fd if we're told to send final …
…msg. We don't need the connection to ourselves! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 8950384 - Browse repository at this point
Copy the full SHA 8950384View commit details
Commits on Dec 31, 2021
-
I'm guessing doing a 16 bit swap on WIRE_GOSSIP_STORE_ENDED is the solution Error on Mac OSX 11.6: common/gossip_store.c:132:16: error: result of comparison of constant 152043520 with expression of type 'be16' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (buf.type == CPU_TO_BE32(WIRE_GOSSIP_STORE_ENDED)) $ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 13.0.0 (clang-1300.0.29.30) Target: x86_64-apple-darwin20.6.0
Configuration menu - View commit details
-
Copy full SHA for aa88b6a - Browse repository at this point
Copy the full SHA aa88b6aView commit details