-
Notifications
You must be signed in to change notification settings - Fork 407
Remove NodeAnnouncementInfo addresses #2102
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
Conversation
f5c7fc0
to
576e43a
Compare
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2102 +/- ##
==========================================
+ Coverage 91.32% 91.52% +0.19%
==========================================
Files 101 101
Lines 48791 49796 +1005
Branches 48791 49796 +1005
==========================================
+ Hits 44558 45574 +1016
+ Misses 4233 4222 -11
... and 6 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Absolutely. The protocol allows new address descriptors to be advertised so we wouldn't want to store/relay messages that include a whole lot of junk data by prepending it with a greater address descriptor type than those known. That's why we bound this excess data by a reasonable value (1K).
Definitely not. We should still maintain a list of reachable addresses for a node even if we don't have the full message (which is always the case when syncing via RGS). It seems like this will require storing either the unsigned variant or just its addresses if the signed one isn't available cc @TheBlueMatt.
I don't think so. It seems we only return |
RGS doesn't provide address information anyway, so there's nothing we can do. I think in the cases where we have address information we store it, so its fine. We should note it in the
No strong opinion, I guess its not crazy to say "we dont have data for the given node" if we didn't store the full message, even though technically we do have some data, just not the right data. |
576e43a
to
3e8d659
Compare
(2, self.last_update, required), | ||
(4, self.rgb, required), | ||
(6, self.alias, required), | ||
(8, self.announcement_message, option), |
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.
We may want to write an empty vec for the old field, since currently old versions will fail to read this
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.
Oops, looking back at this this isn't true - vec_type
semantics are super unclear - they are allowed to have a missing TLV (just implies an empty vec), but we always write something even if the vec is empty. It doesnt matter much tho.
3e8d659
to
62b38a9
Compare
When you go to fix val's last comment, can you add some additional detail to the commit message? Just "remove node info addresses" doesnt explain why we're doing it. |
...replacing it with an acessor `addresses()`. Besides removing a redundant data structure already present on inner `NodeAnnouncement`, this change makes it possible to discover new address types upon deserialization thanks to `UnsignedNodeAnnouncement`'s implementation.
62b38a9
to
6f5e5e3
Compare
@TheBlueMatt changed commit message, please take a look |
Hopefully closes #1630
Open questions:
NodeAnnouncementInfo
with excess data size still valid? Specially given the treatment onrust-lightning/lightning/src/routing/gossip.rs
Line 1366 in c18f705
update_node_from_unsigned_announcement
is called, then the addresses will be empty. Is this behavior acceptable?pub fn addresses(&self)
returnOption<Vec<NetAddress>>
instead ofVec<NetAddress>
ifannouncement_message
isNone
?