Fix max-value overflows in set_max_path_length#3522
Merged
valentinewallace merged 1 commit intolightningdevkit:mainfrom Jan 13, 2025
Merged
Fix max-value overflows in set_max_path_length#3522valentinewallace merged 1 commit intolightningdevkit:mainfrom
set_max_path_length#3522valentinewallace merged 1 commit intolightningdevkit:mainfrom
Conversation
Contributor
valentinewallace
left a comment
There was a problem hiding this comment.
CI is sad. LGTM though!
| } | ||
|
|
||
| #[test] | ||
| fn max_length_with_no_cltv_limit() { |
Contributor
There was a problem hiding this comment.
Can this go in max_path_len_tests.rs?
Collaborator
Author
There was a problem hiding this comment.
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
Collaborator
Author
|
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
valentinewallace
approved these changes
Jan 13, 2025
5f68d71
into
lightningdevkit:main
16 of 19 checks passed
Merged
Collaborator
Author
|
Backported in #3536. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When either the amount or the
max_total_cltv_expiry_deltaare set to max-value,set_max_path_lengthcan trigger overflows inbuild_onion_payloads_callback, leading to debug-panics.