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

Ignore RGS channel updates for unknown channels #1833

Conversation

johncantrell97
Copy link
Contributor

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?

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2022

Codecov Report

Base: 90.78% // Head: 90.78% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (ab89dd9) compared to base (e55e0d5).
Patch coverage: 97.14% of modified lines in pull request are covered.

❗ Current head ab89dd9 differs from pull request most recent head c044238. Consider uploading reports for the commit c044238 to get more accurate results

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           
Impacted Files Coverage Δ
lightning-rapid-gossip-sync/src/processing.rs 92.01% <97.14%> (+0.52%) ⬆️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/ln/functional_tests.rs 97.04% <0.00%> (-0.02%) ⬇️
lightning/src/chain/onchaintx.rs 95.22% <0.00%> (+0.21%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -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:
Copy link
Contributor

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

Copy link
Contributor Author

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

arik-so
arik-so previously approved these changes Nov 4, 2022
Copy link
Contributor

@arik-so arik-so left a 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.

@johncantrell97
Copy link
Contributor Author

This is quite elegant. But please remove the comment in line 76.

Thanks, just force pushed without the comment.

@arik-so arik-so merged commit 554fc02 into lightningdevkit:main Nov 8, 2022
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.

RGS Fails When Channel Was Removed
5 participants