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

stateless invoices #9

Merged
merged 6 commits into from
Jul 1, 2022
Merged

stateless invoices #9

merged 6 commits into from
Jul 1, 2022

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Jun 22, 2022

Converts lnmux to always use stateless invoices. This means that nothing needs to be stored on disk when an invoice is generated.

As a result of this, the number of invoice (sub)states in the database is reduced as well. Only incoming payments for which settlement is requested are stored on disk.

mux_test.go Outdated Show resolved Hide resolved
invoiceregistry.go Outdated Show resolved Hide resolved
cmd/lnmuxd/config.go Show resolved Hide resolved
invoiceregistry.go Outdated Show resolved Hide resolved
invoiceregistry.go Outdated Show resolved Hide resolved
invoiceregistry_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@aakselrod-nydig aakselrod-nydig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and simplifies the code a lot! I did leave a couple of comments about potentially handling a set of HTLCs that overpays an invoice, which could be especially useful in the case of donations or overpayments for the sake of reliable routing. If you want to make a TODO, I would like to implement a test for this condition and the handling of it as a first issue for me?

cmd/lnmuxd/config.go Show resolved Hide resolved
cmd/lnmuxd/lnmux_proto/lnmux.proto Show resolved Hide resolved
cmd/lnmuxd/lnmux_proto/lnmux.proto Show resolved Hide resolved
cmd/lnmuxd/server.go Show resolved Hide resolved
cmd/lnmuxd/server.go Show resolved Hide resolved
invoiceregistry.go Show resolved Hide resolved
invoiceregistry.go Show resolved Hide resolved
invoiceregistry.go Show resolved Hide resolved
stateless_data.go Show resolved Hide resolved
stateless_data.go Show resolved Hide resolved
invoiceregistry_test.go Outdated Show resolved Hide resolved
invoiceregistry.go Outdated Show resolved Hide resolved
invoiceregistry_test.go Outdated Show resolved Hide resolved
@joostjager joostjager force-pushed the stateless branch 2 times, most recently from 6e42206 to 8150785 Compare July 1, 2022 08:27
@joostjager joostjager requested a review from qustavo July 1, 2022 08:30
@joostjager joostjager merged commit 26f2fab into master Jul 1, 2022
@joostjager joostjager deleted the stateless branch July 1, 2022 09:05
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.

4 participants