Skip to content
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

Merged
merged 12 commits into from
Feb 12, 2024

Commits on Feb 11, 2024

  1. pyln-testing: dump gossip store when we complain about bad gossip.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    926c0ec View commit details
    Browse the repository at this point in the history
  2. devtools: remove warning message from dump-gossipstore.

    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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    3d003e7 View commit details
    Browse the repository at this point in the history
  3. common: add gossmap_chan_is_dying() helper to check flags.

    And fix up gossip_store backwards comment!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    e8061f2 View commit details
    Browse the repository at this point in the history
  4. gossipd: clean up flags accessors.

    We want to be able to clear them, and fetch them.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    8c16ce0 View commit details
    Browse the repository at this point in the history
  5. gossipd: set dying flag on node_announcement when all channels are dy…

    …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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    49c315b View commit details
    Browse the repository at this point in the history
  6. gossipd: make sure to unmark dying node_announcement if we see a new …

    …channel!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    873c5ee View commit details
    Browse the repository at this point in the history
  7. gossipd: when applying a new channel_update, preserve the dying flag.

    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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    3bb9a96 View commit details
    Browse the repository at this point in the history
  8. gossipd: preserve the dying flag when moving node_announcement.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    e9cb450 View commit details
    Browse the repository at this point in the history
  9. gossipd: set dying flag on node_announcements when initially created.

    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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    d21dbe2 View commit details
    Browse the repository at this point in the history
  10. gossipd: don't consider dying channels when seeking preceeding channe…

    …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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    c0f533b View commit details
    Browse the repository at this point in the history
  11. gossipd: make sure to mark node_announcement dying if we fast-path re…

    …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>
    rustyrussell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    3937855 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2024

  1. connectd: don't suppress channel_announcement without channel_update …

    …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>
    rustyrussell committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    90cfc18 View commit details
    Browse the repository at this point in the history