Skip to content

Remove padding within node_announcement address data - #471

Merged
rustyrussell merged 1 commit into
lightning:masterfrom
TheBlueMatt:no-addr-padding
Sep 17, 2018
Merged

rustyrussell merged 1 commit into
lightning:masterfrom
TheBlueMatt:no-addr-padding

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

This optional padding makes it very difficulty to deserialize
node_announcements into internal structs for storage and then
reconstruct the original node_announcement, plus are unused on the
network today and no known implementations construct
node_announcement messages with them.

This optional padding makes it very difficulty to deserialize
node_announcements into internal structs for storage and then
reconstruct the original node_announcement, plus are unused on the
network today and no known implementations construct
node_announcement messages with them.
@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Not entirely sure, but in my brief reading it looks like lnd may not be able to relay these anyway, so simply making them a SHOULD NOT and suggesting that the entire address data could be ignored if they are used seems like the safest thing to do.

@Roasbeef Roasbeef left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Death to padding!

LGTM ❄️

@rustyrussell rustyrussell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have reviewed the current gossip on testnet and mainnet, and confirmed that nobody is sending address descriptor 0 (as expected).

Comment thread 07-routing-gossip.md
- MUST place non-zero typed address descriptors in ascending order.
- MAY place any number of zero-typed address descriptors anywhere.
- MUST place address descriptors in ascending order.
- SHOULD NOT place any zero-typed address descriptors anywhere.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this 'SHOULD NOT' should be removed entirely.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Heh, I like it for lack of ambiguity as you might otherwise interpret it as a legal thing to put a 0-type address descriptor and expect receivers to stop parsing the rest of the message (as they must stop parsing when they see the first undefined type).

rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Sep 4, 2018
…alformed address descriptors.

Note that we consider a '0' address descriptor malformed, but they're going
away anyway as per lightning/bolts#471

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell
rustyrussell merged commit 8516beb into lightning:master Sep 17, 2018
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.

3 participants