-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnwire+peer: fully validate node aliases on the wire, don't d/c due to invalid aliases #2412
lnwire+peer: fully validate node aliases on the wire, don't d/c due to invalid aliases #2412
Conversation
a121061
to
7100288
Compare
Comment addressed, PTAL @halseth |
peer.go
Outdated
// If the NodeAnnouncement has an invalid alias, then | ||
// we'll log that error above and continue so we can | ||
// continue to read messges from the peer. | ||
case lnwire.ErrInvalidNodeAlias: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a test if possible. I think maybe this should be a pointer as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't a good way to make an accurate end to end test for this as we don't allow local nodes to set the value, and we don't yet have a p2p testing framework in place. Correct on pointer, just added! We do currently have unit tests that cover validation however.
In this commit, we ensure that when we read node aliases from the wire, we ensure that they're valid. Before this commit, we would read the raw bytes without checking for validity which could result in us writing in invalid node alias to disk. We've fixed this, and also updated the quickcheck tests to generate valid strings.
7100288
to
a49e39d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💥
No description provided.