-
Notifications
You must be signed in to change notification settings - Fork 417
Trampoline forwarding #3976
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
base: main
Are you sure you want to change the base?
Trampoline forwarding #3976
Conversation
👋 Hi! This PR is now in draft status. |
lightning/src/ln/channelmanager.rs
Outdated
|
||
#[cfg(not(any(test, feature = "_test_utils")))] | ||
let retry_strategy = Retry::Attempts(3); | ||
#[cfg(any(test, feature = "_test_utils"))] |
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.
Not really a fan on this one, I'd accept any idea
drafting while rebasing again and fixing minor issues of CI |
Ensure that the Trampolin onion's amount and CLTV values does not exceed the limitations imposed by the outer onion. Co-authored-by: Arik Sosman <[email protected]>
To process errors returned from downstream nodes when forwarding between Trampoline nodes, we need to store information beyond what's available in `HTLCPreviousHopData`, suc as the used hops as the newly generated outer onion's session_priv. To that end, we add a new variant to `HTLCSource` in this commit, which futre-proofs mapping an outbound forward to an incoming MPP. Co-authored-by: Arik Sosman <[email protected]>
The previously existing `HTLCDestination` do not map nicely to the failure vent of a Trampoline forward, so we introduce a new variant to fill the gap. Co-authored-by: Arik Sosman <[email protected]>
{ | ||
// We use Unkonwn Failure code instead of TemporaryTrampolineFailure because errors uses u16 bolt04 codes. | ||
let payment_failed_conditions = PaymentFailedConditions::new() | ||
.expected_htlc_error_data(LocalHTLCFailureReason::UnknownFailureCode { code: 16409 }, &[0; 0]); |
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.
Not really sure on testing like this or just add the TemporaryTrampolineFailure
4a72640
to
ef09262
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3976 +/- ##
=========================================
Coverage 88.91% 88.91%
=========================================
Files 174 174
Lines 124232 125526 +1294
Branches 124232 125526 +1294
=========================================
+ Hits 110455 111610 +1155
- Misses 11301 11419 +118
- Partials 2476 2497 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
In this commit, we expand our forwarding logic to do ad-hoc pathfinding to subsequent Trampoline nodes, covering both blinded and unblinded scenarios. We set a constant for retrying payments in Trampoline nodes up to 3 failures. We further modify our error propagation logic to handle Trampoline forward HTLC failures. Co-authored-by: Arik Sosman <[email protected]>
ef09262
to
3d2fe8d
Compare
Supersedes #3711
Rebase and fixes to a sooner
main
branch.Some changes from the previous branch:
What's missing: