Allow blinded path diversification by expanding create_blinded_paths#3087
Allow blinded path diversification by expanding create_blinded_paths#3087TheBlueMatt merged 3 commits intolightningdevkit:mainfrom
create_blinded_paths#3087Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3087 +/- ##
==========================================
- Coverage 89.80% 89.78% -0.02%
==========================================
Files 121 121
Lines 100045 100207 +162
Branches 100045 100207 +162
==========================================
+ Hits 89845 89975 +130
- Misses 7533 7558 +25
- Partials 2667 2674 +7 ☔ View full report in Codecov by Sentry. |
|
Updated from pr3087.01 to pr3087.02 (diff): Changes:
|
f0c2e7d to
f32a93a
Compare
f32a93a to
c8e7993
Compare
c8e7993 to
4032289
Compare
|
Updated from pr3087.03 to pr3087.04 (diff): Changes:
|
4032289 to
56013be
Compare
|
Updated from pr3087.04 to pr3087.05 (diff): Updates:
|
56013be to
b6e38c2
Compare
b6e38c2 to
4461115
Compare
jbesraa
left a comment
There was a problem hiding this comment.
Looks good
Is it worth adding a test to cover the new code?
Chatted with @shaavan earlier today about how to go about testing this. |
d672475 to
5d66998
Compare
5d66998 to
f541586
Compare
f541586 to
94354f3
Compare
94354f3 to
0354d8d
Compare
0354d8d to
43e821c
Compare
43e821c to
893f62d
Compare
| fn extract_invoice<'a, 'b, 'c>(node: &Node<'a, 'b, 'c>, message: &OnionMessage) -> (Bolt12Invoice, Option<BlindedPath>) { | ||
| match node.onion_messenger.peel_onion_message(message) { | ||
| Ok(PeeledOnion::Receive(message, _, _)) => match message { | ||
| Ok(PeeledOnion::Receive(message, _, reply_path)) => match message { |
There was a problem hiding this comment.
As a follow-up PR, could you start including a reply path with invoices for offers? We should have the capability now, but we just haven't updated ChannelManager's implementation of OffersMessageHandler yet.
There was a problem hiding this comment.
Sure! Added it to the task list! 🚀
893f62d to
212ade4
Compare
jkczyz
left a comment
There was a problem hiding this comment.
The change looks good. I went through the tests and noted where we should remove checks that aren't relevant to the new behavior. There may be tests where we are asserting more than necessary, but might as well avoid doing that in newer tests.
…ication - Previously, the `create_blinded_path` function was limited to returning a single `BlindedPath`, which restricted the usage of `blinded_paths`. - This commit extends the `create_blinded_path` function to return the entire blinded path vector generated by the `MessageRouter`'s `create_blinded_paths`. - The updated functionality is integrated across the codebase, enabling the sending of Offers Response messages, such as `InvoiceRequest` (in `pay_for_offer`) and `Invoice` (in `request_refund_payment`), utilizing multiple reply paths.
- This will be utilised in the following commit for a test.
212ade4 to
f5aa883
Compare
0e16cdb to
e6bb965
Compare
jkczyz
left a comment
There was a problem hiding this comment.
LGTM. Please squash the fixup.
e6bb965 to
a643112
Compare
a643112 to
957b337
Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
LGTM. Diff since @jkczyz's "LGTM" is trivial, so landing:
$ git diff-tree -U2 e6bb965bcd3fede82b956c5abb17d6e501c8d9af 957b33712ad3d5a7aed624e4f565887817fd9944
diff --git a/lightning/src/ln/offers_tests.rs b/lightning/src/ln/offers_tests.rs
index 2eddb1991..cdd78d02c 100644
--- a/lightning/src/ln/offers_tests.rs
+++ b/lightning/src/ln/offers_tests.rs
@@ -1019,4 +1019,6 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
expect_recent_payment!(alice, RecentPaymentDetails::AwaitingInvoice, payment_id);
+ let _expected_invoice = david.node.request_refund_payment(&refund).unwrap();
+
connect_peers(david, bob);
$
blinded_pathsis limited becausecreate_blinded_pathonly returns a singleBlindedPath.create_blinded_pathby allowing it to return multipleBlindedPaths, as determined by the newcountparameter.InvoiceRequest(inpay_for_offer) andInvoice(inrequest_refund_payment), using multiple reply paths.create_blinded_pathsto 10, enabling the generation of more reply paths. It also increases the number ofblinded_pathsused in offer and refund builders and responders to 5, demonstrating the usage of multiple reply paths.