Skip to content
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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Mar 8, 2024

No description provided.

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>
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@@ -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
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@arik-so
Copy link
Contributor Author

arik-so commented Mar 12, 2024

Thanks for the feedback, @TheBlueMatt! I'll update #2756 to reflect your recommendations.

@arik-so arik-so force-pushed the arik/trampoline/2024-02-trampoline-route-construction branch 4 times, most recently from 665ba99 to e724cf4 Compare March 22, 2024 01:04
@arik-so arik-so mentioned this pull request Mar 22, 2024
29 tasks
@valentinewallace
Copy link
Contributor

Could we rebase this on #2906? Hard to evaluate the new OutboundTrampolinePayload out of context

@arik-so
Copy link
Contributor Author

arik-so commented Mar 27, 2024

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.

@arik-so arik-so force-pushed the arik/trampoline/2024-02-trampoline-route-construction branch from e724cf4 to a6609ab Compare April 18, 2024 22:41
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 30.41475% with 151 lines in your changes are missing coverage. Please review.

Project coverage is 90.07%. Comparing base (ac9a2c8) to head (e768f53).
Report is 39 commits behind head on main.

Files Patch % Lines
lightning/src/ln/onion_utils.rs 0.86% 114 Missing ⚠️
lightning/src/ln/msgs.rs 50.94% 22 Missing and 4 partials ⚠️
lightning/src/routing/router.rs 56.25% 7 Missing ⚠️
lightning/src/events/mod.rs 25.00% 3 Missing ⚠️
lightning-background-processor/src/lib.rs 0.00% 0 Missing and 1 partial ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

@arik-so arik-so force-pushed the arik/trampoline/2024-02-trampoline-route-construction branch from a6609ab to 51539af Compare April 19, 2024 00:01
@arik-so arik-so force-pushed the arik/trampoline/2024-02-trampoline-route-construction branch from 51539af to 32d7a1e Compare April 19, 2024 08:20
@arik-so arik-so force-pushed the arik/trampoline/2024-02-trampoline-route-construction branch from 32d7a1e to e768f53 Compare April 19, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants