Skip to content

Conversation

elnosh
Copy link
Contributor

@elnosh elnosh commented Sep 2, 2025

Part of #2298

As an always online node if we receive a invoice request on behalf of an async recipient, add support for forwarding the request to the recipient in case it is online to respond to the request.

Previously it would generate a new nonce for this context
instead of using the offer nonce. This would make it so
that verification would fail later when receiving a
invoice request.
As a static invoice server, if we receive an invoice request on
behalf of an often-offline recipient we will reply to the sender
with the static invoice previously provided by the async recipient.

Here, in addition to doing that we'll forward the invoice request
received to the async recipient to give it a chance to reply with
a fresh invoice in case it is online.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 2, 2025

I've assigned @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 84.05797% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.77%. Comparing base (bf87832) to head (5edc82a).

Files with missing lines Patch % Lines
lightning/src/ln/async_payments_tests.rs 83.64% 47 Missing and 5 partials ⚠️
lightning/src/offers/invoice_request.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #4049    +/-   ##
========================================
  Coverage   88.76%   88.77%            
========================================
  Files         176      176            
  Lines      129345   129632   +287     
  Branches   129345   129632   +287     
========================================
+ Hits       114812   115078   +266     
- Misses      11925    11946    +21     
  Partials     2608     2608            
Flag Coverage Δ
fuzzing 22.00% <0.00%> (-0.01%) ⬇️
tests 88.60% <84.05%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@valentinewallace
Copy link
Contributor

I mentioned to @elnosh since I've been giving input on this feature, but he moved quick and I probably won't be able to get to review this til possibly next week. @tankyleo up to you if you want to get involved in async payments review but I understand if you unassign lol.

@ldk-reviews-bot
Copy link

🔔 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.

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.

3 participants