Skip to content

[bug]: asset invoice can be created for an amount greater than the RFQ quote and poor error message when trying to pay this bogus invoice #1428

@ZZiigguurraatt

Description

@ZZiigguurraatt

We have a test case where an asset invoice is created for an amount greater than the RFQ quote

https://github.com/lightninglabs/lightning-terminal/blob/f082579252e4b6d1f9dd84e74646ec3e9b7e8e33/itest/litd_custom_channels_test.go#L2112-L2166

This test case fails as designed, but there are problems with how it fails and how the test case is designed:

  1. The amounts in the comments don't seem to match up with the the amounts of the RFQ quote request and the invoice.
  2. It doesn't fail when invoice generation occurs with AddInvoice. Instead, the test case later fails when SendPaymentV2 is attempted. We should get failure immediately when invoice generation is attempted so that the user doesn't waste time trying to get someone else to pay an invoice that they can already know will never go through. This follows the same methodology that is explained in [feature]: fail AddInvoice if not enough capacity to actually receive the payment lightningnetwork/lnd#9380 for not creating invoices that we know won't work if there is not enough channel capacity.
  3. When SendPaymentV2 fails, it fails with "context deadline exceeded", which is a totally uninformative error message for an application developer to try and figure out what is going on.
  4. withFailure(lnrpc.Payment_FAILED, failureNone) is passed to the function payInvoiceWithSatoshi, but I don't know that that information is actually used since cfg.errSubStr="context deadline exceeded" seems to be all that is tested.

We need to have the issues with AddInvoice fixed and better error messages with SendPaymentV2 if someone does manage to make a bogus invoice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3RFQWork relating to TAP channel Request For Quote (RFQ).bugSomething isn't workingerror handlinginvoices

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions