-
Notifications
You must be signed in to change notification settings - Fork 382
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
Construct Trampoline onion from path. #2927
base: main
Are you sure you want to change the base?
Construct Trampoline onion from path. #2927
Conversation
lightning/src/ln/msgs.rs
Outdated
Receive { | ||
payment_data: Option<FinalOnionHopData>, | ||
payment_metadata: Option<Vec<u8>>, | ||
keysend_preimage: Option<PaymentPreimage>, | ||
custom_tlvs: Vec<(u64, Vec<u8>)>, | ||
sender_intended_htlc_amt_msat: u64, | ||
cltv_expiry_height: u32, | ||
trampoline_packet: Option<crate::onion_message::packet::Packet> |
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.
Shouldn't this be a different variant? ISTM it would clean up the accessing code if we call this a TrampolineForward
because its really a forward, not have forwarding logic in handling the Receive
variant.
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.
I have moved it to a separate variant, which indeed makes perfect sense.
lightning/src/ln/msgs.rs
Outdated
@@ -1688,13 +1688,22 @@ mod fuzzy_internal_msgs { | |||
amt_to_forward: u64, | |||
outgoing_cltv_value: u32, | |||
}, | |||
// This should only be used for nested Trampoline onions |
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.
Then it should be in a separate struct, not in the same enum, no?
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.
This is still an onion payload, just in this case for an inner onion. The last payload will still be the Receive variant. I'm not 100% sure it makes sense to create a whole separate struct for that.
Thanks for the feedback, @TheBlueMatt! I'll update #2756 to reflect your recommendations. |
665ba99
to
e724cf4
Compare
Could we rebase this on #2906? Hard to evaluate the new |
Yeah, ish, but absent a Receive variant, it's gonna completely break, so I think once 2906 is in I'll need to rework this. Bastien has been very helpful with trampoline to blinded path serialization references, so I'll alter this PR to do that instead. |
e724cf4
to
a6609ab
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2927 +/- ##
==========================================
+ Coverage 89.42% 90.07% +0.64%
==========================================
Files 117 118 +1
Lines 96290 104861 +8571
Branches 96290 104861 +8571
==========================================
+ Hits 86109 94454 +8345
- Misses 7962 8246 +284
+ Partials 2219 2161 -58 ☔ View full report in Codecov by Sentry. |
a6609ab
to
51539af
Compare
51539af
to
32d7a1e
Compare
32d7a1e
to
e768f53
Compare
No description provided.