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

lnwire+peer: fully validate node aliases on the wire, don't d/c due to invalid aliases #2412

Merged
merged 3 commits into from Jan 8, 2019

Conversation

Projects
None yet
4 participants
@Roasbeef
Copy link
Member

commented Jan 4, 2019

No description provided.

Show resolved Hide resolved peer.go Outdated

@Roasbeef Roasbeef force-pushed the Roasbeef:node-alias-validation branch from a121061 to 7100288 Jan 4, 2019

@Roasbeef

This comment has been minimized.

Copy link
Member Author

commented Jan 4, 2019

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:

This comment has been minimized.

Copy link
@halseth

halseth Jan 7, 2019

Collaborator

This should have a test if possible. I think maybe this should be a pointer as well?

This comment has been minimized.

Copy link
@Roasbeef

Roasbeef Jan 7, 2019

Author Member

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.

Roasbeef added some commits Jan 4, 2019

lnwire: when reading node aliases, properly check validity
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.

@Roasbeef Roasbeef force-pushed the Roasbeef:node-alias-validation branch from 7100288 to a49e39d Jan 7, 2019

@cfromknecht
Copy link
Collaborator

left a comment

LGTM! 💯

@wpaulino
Copy link
Collaborator

left a comment

LGTM 💥

@Roasbeef Roasbeef merged commit 0725fec into lightningnetwork:master Jan 8, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.004%) to 55.948%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.