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

Skip channel_update signature checks if we have a newer state #1380

Conversation

TheBlueMatt
Copy link
Collaborator

channel_update messages already have their signatures checked
with the network graph write lock held, so there's no reason to
check the signatures before doing other quicker checks first,
including checking if we're already aware of a newer update for the
channel.

This reduces common-case CPU usage as channel_updates are sent
rather liberally over the p2p network to gossip them.

@jkczyz jkczyz added this to the 0.0.106 milestone Mar 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2022

Codecov Report

Merging #1380 (15a036a) into main (fcfd683) will increase coverage by 0.13%.
The diff coverage is 100.00%.

❗ Current head 15a036a differs from pull request most recent head 63ca72e. Consider uploading reports for the commit 63ca72e to get more accurate results

@@            Coverage Diff             @@
##             main    #1380      +/-   ##
==========================================
+ Coverage   90.81%   90.94%   +0.13%     
==========================================
  Files          73       73              
  Lines       41187    42311    +1124     
  Branches    41187    42311    +1124     
==========================================
+ Hits        37402    38480    +1078     
- Misses       3785     3831      +46     
Impacted Files Coverage Δ
lightning/src/routing/network_graph.rs 89.56% <100.00%> (+0.01%) ⬆️
lightning/src/ln/functional_tests.rs 97.14% <0.00%> (-0.02%) ⬇️
lightning/src/routing/router.rs 93.48% <0.00%> (+1.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcfd683...63ca72e. Read the comment docs.

@TheBlueMatt TheBlueMatt force-pushed the 2022-03-skip-redundant-sig-checks branch from 9a1e989 to 7819cbd Compare March 23, 2022 23:50
jkczyz
jkczyz previously approved these changes Mar 24, 2022
`channel_update` messages already have their signatures checked
with the network graph write lock held, so there's no reason to
check the signatures before doing other quicker checks first,
including checking if we're already aware of a newer update for the
channel.

This reduces common-case CPU usage as `channel_update`s are sent
rather liberally over the p2p network to gossip them.
@TheBlueMatt
Copy link
Collaborator Author

Squashed without changes.

@TheBlueMatt TheBlueMatt merged commit 4e89e57 into lightningdevkit:main Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants