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

Improvements to the OfferManager #633

Closed
wants to merge 8 commits into from
Closed

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Apr 25, 2024

This PR is targeting #624 and adds some improvements and refactoring. Each commit is independent and should be reviewed separately (the commit messages contain useful details about the commit itself). This PR fixes the comments from my latest review of #624.

The main changes are:

  • more fine-grained invoice request timeout to minimize UX issues (see details in the commit message)
  • add more logs around error cases, as I suspect we'll spend quite some time debugging compatibility issues with other implementations initially
  • remove some duplication and add a few helper functions
  • add more tests

thomash-acinq and others added 8 commits April 22, 2024 19:02
We always use the invoice's `node_id`, so instead of duplicating this
argument we can extract it automatically from the invoice. It avoids
mistakes that could mess up our accounting.
And rename top-level `SendMessage` to `SendOnionMessage`.
We may want to display a spinner in the UI while requesting the invoice
for an offer payment, to quickly report back when the recipient cannot
be contacted. This means we need to fail as soon as the timeout provided
is hit, so we cannot rely on a regular background task.

We instead create a dedicated coroutine for each payment, with the
timeout provided in the `PayOffer` request.
This commit keeps the business logic mostly unchanged, but re-works the
error handling to ensure that we log as much details as possible to help
troubleshoot compatibility issues.

It adds support for sending `invoice_error` on some error cases to help
debug potential issues.

When the introduction node of the recipient is our trampoline node, we
remove an unnecessary hop in the onion message.
@t-bast t-bast requested a review from thomash-acinq April 25, 2024 10:08
@t-bast t-bast mentioned this pull request Apr 25, 2024
@t-bast t-bast deleted the offer-manager-bast branch April 25, 2024 14:54
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.

2 participants