Uh oh!
There was an error while loading. Please reload this page.
Routing to blinded payment paths - #2120
Conversation
6841e43 to
6e6f76eComparec0c4a84 to
d5c978cCompareCodecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #2120 +/- ##
==========================================
+ Coverage 90.48% 91.30% +0.81%
==========================================
Files 104 106 +2 Lines 53920 63000 +9080 Branches 53920 63000 +9080 ==========================================
+ Hits 48792 57525 +8733 - Misses 5128 5475 +347 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TheBlueMatt
left a comment
There was a problem hiding this comment.
We should definitely land at least the new serialization backwards-incompatible hints tlvs for the next release.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d5c978c to
fb85bbdComparefb85bbd to
79e3442CompareUh oh!
There was an error while loading. Please reload this page.
ad8ccbf to
559ec3bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| if blinded_path.blinded_hops.len() == 0 { | ||
| return Err(LightningError{err: "0-hop blinded path provided".to_owned(), action: ErrorAction::IgnoreError}); | ||
| } else if &blinded_path.introduction_node_id == our_node_pubkey { | ||
| log_info!(logger, "Got blinded path with ourselves as the introduction node, ignoring"); |
There was a problem hiding this comment.
Should this get some kind of TODO? Or should we just always use this path directly?
There was a problem hiding this comment.
We can't use these paths atm because get_route doesn't have the ability to "advance" the blinded path to the next hop (and we can't pathfind to ourselves, ofc). Previously discussed here: #2146 (comment)
There was a problem hiding this comment.
Ah, I misunderstood that comment, so I think there's another way to handle this - let get_route return early with a 0-hop unblinded path portion and the blinded tail as-is. Then the paying code would handle it by detecting this case and doing the advancing itself.
There was a problem hiding this comment.
Hmm, I don't see how that would work if the max_htlc of the 1 blinded hint isn't sufficient for the entire payment?
There was a problem hiding this comment.
Mmm right, I suppose we could pre-select it as a path and then run the router to select more paths if needed? That seems like it would work pretty easy.
There was a problem hiding this comment.
Yeah that sounds good! We might want to have another prefactor, though, because there's still assumptions that path.hops.len() > 0 scattered around. Will look into that.
There was a problem hiding this comment.
FYI, two more notes on this approach:
- We may end up double-booking our own channel liquidity, since we don't know which of our channels is being used inside the blinded path (double-booking liquidity is a general problem for blinded pathfinding anyway, though)
- ISTM we'll always want to go through the process of selecting additional paths, because the blinded path where we are the intro node may be the most expensive option
For (1), we could decrement each of our available channel balances by the amount used on the path. Not sure it's if worth the additional complexity.
There was a problem hiding this comment.
I'm gonna address this in a follow-up since this PR is growing. IMO our offers code should still advance blinded paths before pathfinding to them, though adding the behavior you describe is good for keeping find_route general-purpose
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b181025 to
c90a259Comparevalentinewallace
commented
May 16, 2023
Rebased to fix CI, also squashed. |
c90a259 to
8012de1CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| fees: RoutingFees { | ||
| base_msat: blinded_payinfo.fee_base_msat, | ||
| proportional_millionths: blinded_payinfo.fee_proportional_millionths, |
There was a problem hiding this comment.
More of a comprehension question - if a recipient includes a dummy hop, we'll send extra sats for this dummy hop's fees that will go to the recipient right? Is there anything stopping a recipient from always making a sender slightly overpay as long as there's a route with enough liquidity?
There was a problem hiding this comment.
Dummy hops don't cost extra fees, since agregated fees for use of the entire blinded path are calculated by the recipient per https://github.com/lightning/bolts/blob/master/proposals/route-blinding.md#blinded-payments, based on the non-dummy hops' feerates. I think the recipient could make the sender overpay, though, if they just added extra fees on top of the aggregated fees?
There was a problem hiding this comment.
Dummy hops don't cost extra fees, since agregated fees for use of the entire blinded path are calculated by the recipient per https://github.com/lightning/bolts/blob/master/proposals/route-blinding.md#blinded-payments
Oh I see, thanks
I think the recipient could make the sender overpay, though, if they just added extra fees on top of the aggregated fees?
I realize reading more of the proposal that recipients are even encouraged to in order to avoid probing, although I also saw this section where the recipient pays the blinded fees which was interesting. But yea, seems like nothing's really stopping a recipient from getting the sender to overpay as long as its not outrageous...🤷
Uh oh!
There was an error while loading. Please reload this page.
3329fe3 to
776bd7dCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b59cf53 to
c2cc256Comparevalentinewallace
commented
Jun 15, 2023
Squashed. |
jkczyz
left a comment
There was a problem hiding this comment.
Largely looks good though I need to do a more detailed pass at the last commit still.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c2cc256 to
8d4b6daCompareTo make it uniform with PaymentParameters' Payee::Blinded::route_hints.
8d4b6da to
a02a157Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
LGTM, I think, feel free to squash fixups.
Uh oh!
There was an error while loading. Please reload this page.
a02a157 to
ddf497dCompareUh oh!
There was an error while loading. Please reload this page.
ddf497d to
fcb6149Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
One small thing worth fixing in a followup, though I'm not even sure the code is actually reachable.
Uh oh!
There was an error while loading. Please reload this page.
It's unclear what values 1-hop blinded paths should set their BlindedPayInfos to, because those values are meant to refer to the fees/cltv delta on the path *between* the intro node and the destination. We zero out these values in the new variant's methods so they don't mess with path finding/construction.
We don't need to collect a vec of Results anymore.
Sending to them is still disallowed, for now.
fcb6149 to
6c3ca55Compare
Support finding a route to a recipient who is behind blinded payment paths, which are provided in BOLT12 invoices.
Based on
#2258,#2305.