-
Notifications
You must be signed in to change notification settings - Fork 403
Backports for 0.1.3 #3757
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
Backports for 0.1.3 #3757
Conversation
This bug was recently surfaced to us by a user who wrote a test where the sender is attempting to route an MPP payment split across the two channels that it has with its LSP, where the LSP has a single large channel to the recipient. Previously this led to a pathfinding failure because our router was not sending the maximum possible value over the first MPP path it found due to overestimating the fees needed to cover the following hops. Because the path that had just been found was not maxxed out, our router assumed that we had already found enough paths to cover the full payment amount and that we were finding additional paths for the purpose of redundant path selection. This caused the router to mark the recipient's only channel as exhausted, with the intention of choosing more unique paths in future iterations. In reality, this ended up with the recipient's only channel being disabled and subsequently failing to find a route entirely. Update the router to fully utilize the capacity of any paths it finds in this situation, preventing the "redundant path selection" behavior from kicking in. Use and `rustfmt` conflicts resolved in: * lightning/src/blinded_path/payment.rs The new test was also updated to avoid APIs not present on 0.1.
When calculating the maximum contribution of a path to a larger route, we want to ensure we don't overshoot as that might cause us to violate a maximum value limit. In 209cb2a, we started by calculating with `ceil`, which can trigger exactly that, so here we drop the extra addition, switching us to `floor`. Found both by the `router` fuzzer as well as the `generate_large_mpp_routes` test.
`String::truncate` takes a byte index but panics if we split in the middle of a UTF-8 codepoint. Sadly, in `InvoiceRequest::fields` we want to tuncate the payer note to a maximum of 512 bytes, which may be in the middle of a UTF-8 codepoint and can cause panic. Here we iterate over the bytes in the string until we find one not in the middle of a UTF-8 codepoint and then split the string there. Trivial `rustfmt` conflicts resolved in: * lightning/src/offers/invoice_request.rs
In the next commit we attempt to verify `InvoiceRequest`s when fuzzing so that we can test fetching the `InvoiceRequestFields`, but its useful to allow the verification to succeed more often first, which we do here.
This should allow us to reach the panic from two commits ago from the fuzzer.
Ensures `InvoiceReceived` events are not generated multiple times when `manually_handle_bolt12_invoice` is enabled. Duplicate events for the same invoice could cause confusion—this change introduces an idempotency check to prevent that. Conflicts resolved in: * lightning/src/ln/outbound_payment.rs due to the migration upstream from `max_total_routing_fee_msat` to a more general config struct.
I've assigned @wpaulino as a reviewer! |
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Should we include b434ec8 to build with our MSRV? |
Mmm, yea, good point, done. |
✅ Added second reviewer: @jkczyz |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 0.1 #3757 +/- ##
==========================================
+ Coverage 88.40% 88.42% +0.01%
==========================================
Files 149 149
Lines 113859 114104 +245
Branches 113859 114104 +245
==========================================
+ Hits 100659 100898 +239
- Misses 10743 10749 +6
Partials 2457 2457 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM though CI is showing a couple packages needing a higher MSRV when running build-tx-sync
.
Yea, I think its fine to leave that at least for now. |
No description provided.