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

Avoid redundant {channel,node}_announcement signature checks #3305

Commits on Sep 9, 2024

  1. Avoid redundant {channel,node}_announcement signature checks

    If we receive `{channel,node}_announcement` messages which we
    already have, we first validate their signatures and then look in
    our graph and discover that we should discard the messages. This
    avoids a second lock in `node_announcement` handling but does not
    impact our locking in `channel_announcement` handling. It also
    avoids lock contention in cases where the signatures are invalid,
    but that should be exceedingly rare.
    
    For nodes with relatively few peers, this is a fine state to be in,
    however for nodes with many peers, we may see the same messages
    hundreds of times. This causes a rather substantial waste of CPU
    resources validating gossip messages.
    
    Instead, here, we change to checking our network graph first and
    then validate the signatures only if we don't already have the
    message.
    TheBlueMatt committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    56cb6a1 View commit details
    Browse the repository at this point in the history