Support HTLC interception by source channel#4338
Support HTLC interception by source channel#4338TheBlueMatt wants to merge 2 commits intolightningdevkit:mainfrom
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
|
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
b793c1e to
79952e1
Compare
|
Rebased. |
79952e1 to
779fce3
Compare
tnull
left a comment
There was a problem hiding this comment.
Seems CI is very unhappy as this doesn't build currently.
|
👋 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. |
779fce3 to
0bf2200
Compare
|
Oops, silent conflict. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4338 +/- ##
==========================================
- Coverage 86.09% 85.89% -0.20%
==========================================
Files 156 156
Lines 103623 103958 +335
Branches 103623 103958 +335
==========================================
+ Hits 89211 89299 +88
- Misses 11895 12139 +244
- Partials 2517 2520 +3
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:
|
|
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @tnull! This PR has been waiting for your review. |
elnosh
left a comment
There was a problem hiding this comment.
rustfmt is unhappy but code changes look good to me
|
🔔 3rd Reminder Hey @tnull! This PR has been waiting for your review. |
|
🔔 4th Reminder Hey @tnull! This PR has been waiting for your review. |
0bf2200 to
f6ecc61
Compare
|
🔔 5th Reminder Hey @tnull! This PR has been waiting for your review. |
|
🔔 6th Reminder Hey @tnull! This PR has been waiting for your review. |
tnull
left a comment
There was a problem hiding this comment.
LGTM, feel free to squash.
f6ecc61 to
c4ae026
Compare
|
Squashed without any further changes. |
|
✅ Added second reviewer: @tankyleo |
|
🔔 1st Reminder Hey @tankyleo! This PR has been waiting for your review. |
|
Rebased to address conflict. |
c4ae026 to
ec84d55
Compare
We jump through some hoops in order to pass a small list of objects to `forward_htlcs` on a per-channel basis rather than per-HTLC. Then, `forward_htlcs` builds a `PendingAddHTLCInfo` for each HTLC for insertion. Worse, in some `forward_htlcs` callsites we're actually starting with a `PendingAddHTLCInfo`, converting it to a tuple, then back inside `forward_htlcs`. Instead, here we just pass a list of built `PendingAddHTLCInfo`s to `forward_htlcs`, cleaning up a good bit of code and even avoiding an allocation of the HTLCs vec in many cases.
It may be useful in some situations to select HTLCs for interception based on the source channel in addition to the sink. Here we add the ability to do so by adding new flags to `HTLCInterceptionFlags`.
ec84d55 to
9a9531f
Compare
|
Grr, rebase broke rustfmt: $ git diff-tree -U1 ec84d5549 9a9531f3c
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index a013b1905d..b417e023f4 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -9578,4 +9578,3 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
user_channel_id: u128, unbroadcasted_batch_funding_txid: Option<Txid>,
- update_actions: Vec<MonitorUpdateCompletionAction>,
- htlc_forwards: Vec<PendingAddHTLCInfo>,
+ update_actions: Vec<MonitorUpdateCompletionAction>, htlc_forwards: Vec<PendingAddHTLCInfo>,
decode_update_add_htlcs: Option<(u64, Vec<msgs::UpdateAddHTLC>)>, |
Just a few more flags and a small cleanup.
Based on #4300