Repository navigation
Remove padding within node_announcement address data - #471
Conversation
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.
|
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
left a comment
There was a problem hiding this comment.
Death to padding!
LGTM ❄️
rustyrussell
left a comment
There was a problem hiding this comment.
I have reviewed the current gossip on testnet and mainnet, and confirmed that nobody is sending address descriptor 0 (as expected).
| - 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. |
There was a problem hiding this comment.
I think this 'SHOULD NOT' should be removed entirely.
There was a problem hiding this comment.
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).
…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]>
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.