rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Support multi-hop blinded paths for `ReleaseHeldHtlc`

Open valentinewallace opened this issue 4 months ago • 22 comments

In #4045, as part of supporting sending payments as an often-offline sender to an often-offline recipient, we began including blinded paths in the sender's LSP's RAA message for use as reply paths to the sender's held_htlc_available messages.

Because we hold the per-peer lock corresponding to the Channel while creating this RAA, we can't use our typical approach of calling ChannelManager::get_peers_for_blinded_path to create these blinded paths. The ::get_peers method takes each peer's lock in turn in order to check for usable channels/onion message feature support, and it's not permitted to hold multiple peer state locks at the same time due to the potential for deadlocks (see the debug_sync module).

To avoid taking other peer state locks while holding a particular Channel's peer state lock, here we cache the set of peers in the OffersMessageFlow, which is the struct that ultimately creates the blinded paths for the RAA.

For consistency, we also stop passing in peers to every other OffersMessageFlow method.

Based on ~#4045~, ~#4046~

valentinewallace avatar Sep 10 '25 16:09 valentinewallace

👋 I see @tankyleo was un-assigned. If you'd like another reviewer assignment, please click here.

ldk-reviews-bot avatar Sep 10 '25 16:09 ldk-reviews-bot

Codecov Report

:x: Patch coverage is 91.30435% with 12 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 88.53%. Comparing base (c2e3ae0) to head (0721c9e).

Files with missing lines Patch % Lines
lightning/src/offers/flow.rs 83.67% 4 Missing and 4 partials :warning:
lightning/src/ln/channelmanager.rs 80.95% 1 Missing and 3 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4066      +/-   ##
==========================================
- Coverage   88.70%   88.53%   -0.18%     
==========================================
  Files         176      175       -1     
  Lines      132859   132779      -80     
  Branches   132859   132779      -80     
==========================================
- Hits       117854   117555     -299     
- Misses      12309    12621     +312     
+ Partials     2696     2603      -93     
Flag Coverage Δ
fuzzing ?
tests 88.53% <91.30%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Sep 10 '25 17:09 codecov[bot]

I'd hold off on this because it doesn't seem a strict requirement for initial deployment.

joostjager avatar Sep 17 '25 20:09 joostjager

Needs rebase now :tada:

TheBlueMatt avatar Sep 22 '25 19:09 TheBlueMatt

🔔 1st Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Sep 24 '25 20:09 ldk-reviews-bot

🔔 2nd Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Sep 27 '25 00:09 ldk-reviews-bot

🔔 3rd Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Sep 29 '25 00:09 ldk-reviews-bot

🔔 4th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 01 '25 00:10 ldk-reviews-bot

🔔 5th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 04 '25 00:10 ldk-reviews-bot

🔔 6th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 06 '25 00:10 ldk-reviews-bot

🔔 7th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 08 '25 00:10 ldk-reviews-bot

🔔 8th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 11 '25 00:10 ldk-reviews-bot

🔔 9th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 13 '25 00:10 ldk-reviews-bot

🔔 10th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 15 '25 00:10 ldk-reviews-bot

🔔 11th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 18 '25 00:10 ldk-reviews-bot

🔔 12th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 20 '25 00:10 ldk-reviews-bot

🔔 13th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 22 '25 00:10 ldk-reviews-bot

🔔 14th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 25 '25 00:10 ldk-reviews-bot

🔔 15th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 27 '25 00:10 ldk-reviews-bot

🔔 16th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Oct 29 '25 00:10 ldk-reviews-bot

🔔 17th Reminder

Hey @tankyleo! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

ldk-reviews-bot avatar Nov 01 '25 00:11 ldk-reviews-bot

Needs rebase @valentinewallace

TheBlueMatt avatar Nov 02 '25 12:11 TheBlueMatt