-
Notifications
You must be signed in to change notification settings - Fork 407
Ignore RGS channel updates for unknown channels #1833
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
Ignore RGS channel updates for unknown channels #1833
Conversation
Codecov ReportBase: 90.78% // Head: 90.78% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1833 +/- ##
=======================================
Coverage 90.78% 90.78%
=======================================
Files 87 87
Lines 47604 47607 +3
Branches 47604 47607 +3
=======================================
+ Hits 43218 43221 +3
Misses 4386 4386
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 at Codecov. |
@@ -75,6 +72,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L | |||
|
|||
let node_id_1_index: BigSize = Readable::read(read_cursor)?; | |||
let node_id_2_index: BigSize = Readable::read(read_cursor)?; | |||
|
|||
// Is this only because we truncate max node ids read? Why not do a >0 bounds check as well :shrug: |
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.
it preëmpts an array index out of bounds error. >=0 is unnecessary because bigsize only supports unsigned ints under the hood
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.
got it, makes sense on the bigsize -- thanks
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 is quite elegant. But please remove the comment in line 76.
ab89dd9
to
c044238
Compare
Thanks, just force pushed without the comment. |
Fixes #1784 by ignoring channel updates for channels our graph doesn't know about instead of returning an error. Also includes a minor style change with added test for unknown version header. I can remove that part but was just something I noticed when first reviewing RGS client code. Maybe there's a reason it was using the empty match arm style that I'm unaware of?