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
Fix gossip code when channels are marked dying #7057
Fix gossip code when channels are marked dying #7057
Conversation
1ec6143
to
6ca04bb
Compare
9f49ef6
to
8b10f13
Compare
Looks like there are still some
And here is what I believe the same use-after-free from the pov of
Very detailed, but almost bludgeoning devs with verbosity xD As far as I can see the
|
8b10f13
to
0c96a3b
Compare
Yep, trivial use-after-free! Obvious fix, may or may not prevent that broken bad gossip msg... |
0c96a3b
to
9b47e74
Compare
Found one place I missed, added final patch with much debug info, so we will get more info if there's another failure in CI. |
8e0c37a
to
4de1a2b
Compare
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It prints a message to stderr, but actually it's fine with this version: ``` dump-gossipstore: UNKNOWN GOSSIP minor VERSION 14 (expected 12) ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
And fix up gossip_store backwards comment! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We want to be able to clear them, and fetch them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ing. This avoids us gossiping about nodes which don't have live channels. Interstingly, we previously tested that we *did* gossip such node announcements, and now we fix that test. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…channel! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We can update dying channels, though it seems weird! We accept gossip about them, we just don't propagate it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We accept node_announcements on dying channels, but make sure we set the dying flag it channels are alll dying. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…l_announcements. We make sure a node_announcement is preceeded by at least one channel_announcement, but dying ones don't count (as they are not broadcast!). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…move last channel. Normally, channels are marked dying, the 12 blocks later, removed. But for local channels, we can access any spliced channel already, so we remove them immediately from our local gossip. This left a hole in our logic, if that channel was the last one keeping a node_announcement alive. Solution is to unify with the "moved node_announcement" path. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
709425c
to
1590e65
Compare
…yet. This happens if: 1. The peer sets a timestamp filter to non-zero, and 2. We have a channel_announcement without a channel_update. The timestamp is 0 as a placeholder as part of the recent gossip rework (we used to hold these channel_announcement in memory, which was complex). But this means we won't send it in this case, and if we later send the channel_update, CI will complain about 'Bad gossip order'. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1590e65
to
90cfc18
Compare
I found it! Our timestamp filtering, which we still kind of support, was omitting channels-without-an-update yet, which is a narrow window. |
The "bad gossip" flakes were caused by the fact that:
dying
which means we don't propagate it.I added a dev sanity check which helped test all of these!