-
Notifications
You must be signed in to change notification settings - Fork 403
Fix max-value overflows in set_max_path_length
#3522
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
Fix max-value overflows in set_max_path_length
#3522
Conversation
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.
CI is sad. LGTM though!
@@ -1607,4 +1610,19 @@ mod tests { | |||
writer.write_all(&self.data[..]) | |||
} | |||
} | |||
|
|||
#[test] | |||
fn max_length_with_no_cltv_limit() { |
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.
Can this go in max_path_len_tests.rs
?
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.
Could do...Generally we haven't shied away from doing unit tests in the same module that we're testing, at least for modules that aren't 10k LoC already 😅...
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3522 +/- ##
==========================================
+ Coverage 88.34% 89.01% +0.66%
==========================================
Files 149 149
Lines 112915 116907 +3992
Branches 112915 116907 +3992
==========================================
+ Hits 99753 104061 +4308
+ Misses 10685 10417 -268
+ Partials 2477 2429 -48 ☔ View full report in Codecov by Sentry. |
8bf4dd6
to
8b5cd47
Compare
Tagging this 0.1 since it currently causes some of the Java bindings tests to fail, so its easier if we get it in before the release. |
When either the amount or the `max_total_cltv_expiry_delta` are set to max-value, `set_max_path_length` can trigger overflows in `build_onion_payloads_callback`, leading to debug-panics.
8b5cd47
to
3e88b32
Compare
5f68d71
into
lightningdevkit:main
Backported in #3536. |
When either the amount or the
max_total_cltv_expiry_delta
are set to max-value,set_max_path_length
can trigger overflows inbuild_onion_payloads_callback
, leading to debug-panics.