Mega-merge 1: Test invoice creation with description hash (WIP) #812
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Mega-merge
This is the first PR of the Mega-merge series. The ultimate goal of the Mega-merge series it to use updated CLN and LND libraries and fix the use of
description_hash
for all wallets (which ultimately enables LNURL).The Mega-merge series is separated into following parts in order to avoid total chaos and make review easier. All successive PRs have their predecessor merged into them already which is why the number of changed files is deceivingly large for the later PRs (they should go down as we merge one by one).
Dependency graph:
Mega-merge 1: Test invoice creation with
description_hash
(PR #812)The purpose of this (present) PR is to add tests for invoice creation via the endpoint
/api/v1/payments
withdescription_hash
. The tests are expected to fail but should succeed after the successive fixes in following merges.Mega-merge 2: Refactor
description_hash
handling (PR #814)This PR refactors how
description_hash
in handled in LNbits. Since most wallets (LND, Eclair, web-wallets) expect the hash of the description and others (CLN and FakeWallet/bolt11) expect the description itself, the process of hashing needs to be refactored to the very end of the pipeline into the wallets itself. Before, LNbits was hashing the description in all LNURL operations before callingcreate_invoice
. After this PR, LNbits will pass the description and the wallet decides to hash it or notMega-merge 3: Update CLN to use
description_hash
(PR #792)This PR updates the CLN library and enables the native use of
description_hash
. This PR is the reason why the previous two PR's exist. They are separated so that the previous parts can be merged before the lib is updated.Mega-merge 4: Reenable LND GRPC and update invoice status checking (PR #745)
This PR is not directly related to the previous ones and could be merged separately. Here we updated the RPC stub to the latest version and use
TrackPaymentV2
to check whether an outgoing payment has succeeded or not.To be continued...
The end of this series (which I will tackle some other day after we merged all this) will be a new payment checking flow in which the payment will be created in the backend asynchronously and a task is kicked off that regularly checks the status of the payment. In theory, this should get rid of stuck payments. A precondition for this would be that all payments are written to the LNbits database with their
payment_hash
as thechecking_id
and not some post-hoc label that we only know when the payment is sent to the backend. More thoughts on this are written down in the notes of PR #745.