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

Add helper functions to verify node and channel annoucements #2307

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

benthecarman
Copy link
Contributor

Right now the only real way to verify the node and channel announcements is to call update_node_from_announcement/update_channel_from_announcement. If you want to do some processing before you add to your network graph then you need to manually verify the signature. This adds some nice helper functions to make it easier.

I tried to do the same for channel update but it did not seem as easy so figured that is fine to punt on since I don't see many people doing manual things with channel updates.

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.08 ⚠️

Comparison is base (498f233) 90.87% compared to head (70d164c) 90.79%.

❗ Current head 70d164c differs from pull request most recent head 5cc400c. Consider uploading reports for the commit 5cc400c to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2307      +/-   ##
==========================================
- Coverage   90.87%   90.79%   -0.08%     
==========================================
  Files         104      104              
  Lines       52926    53017      +91     
  Branches    52926    53017      +91     
==========================================
+ Hits        48094    48137      +43     
- Misses       4832     4880      +48     
Impacted Files Coverage Δ
lightning/src/routing/gossip.rs 89.83% <100.00%> (+0.05%) ⬆️

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two minor doc nits.

lightning/src/routing/gossip.rs Outdated Show resolved Hide resolved
lightning/src/routing/gossip.rs Outdated Show resolved Hide resolved
@benthecarman
Copy link
Contributor Author

@tnull done

@wpaulino
Copy link
Contributor

I tried to do the same for channel update but it did not seem as easy so figured that is fine to punt on since I don't see many people doing manual things with channel updates.

We could expose a method that either:

  • Accepts the signed ChannelUpdate and the expected public key or
  • Accepts the signed ChannelUpdate and its corresponding ChannelAnnouncement

@TheBlueMatt
Copy link
Collaborator

Looks fine to me either way, but please include the rationale you have here in the commit message, not just the PR text - the git history is what matters, github is just the (bad) UI we use to update it today :)

@benthecarman
Copy link
Contributor Author

Looks fine to me either way, but please include the rationale you have here in the commit message, not just the PR text - the git history is what matters, github is just the (bad) UI we use to update it today :)

added

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented May 30, 2023

Sorry for the delay here, but please keep commit messages wrapped at 70 chars unless you're quoting something specific that is longer. This applies both to the title and the body of the commit message itself.

Right now the only real way to verify the node and channel
announcements is to call `update_node_from_announcement`/
`update_channel_from_announcement`. If you want to do some
processing before you add to your network graph then you need to
manually verify the signature. This adds some nice helper functions
to make it easier.

I tried to do the same for channel update but it did not seem as
easy so figured that is fine to punt on since I don't see many
people doing manual things with channel updates.
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited the commit message to wrap the lines, somehow @tnull's approval is still valid, maybe if the commit diff didn't change github allows it?

@TheBlueMatt TheBlueMatt merged commit a358ba2 into lightningdevkit:main Jul 8, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants