-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[bug]: missing settled invoices (gap in settle_index) #7071
Comments
Possible AMP invoices? Could you check the |
I get four results, all of them with |
I checked on my own db and I had two missing. When I checked I was able to find
For every amp invoice paid you should have a gap in the settle_index from the jq command that you sent. Do you know what versions (approx) you were running when the gap occurred? |
2022-02-08 15:41:24.247 [INF] LTND: Version: 0.14.1-beta commit=v0.14.1-beta-5-g7f121f20b, build=production, logging=default, debuglevel=info,CNCT=debug,DISC=warn,HSWC=debug,NANN=debug,WTCL=warn 2022-05-26 12:02:27.384 [INF] LTND: Version: 0.15.0-beta.rc3 commit=v0.15.0-beta.rc3-6-g9aef65858, build=production, logging=default, debuglevel=info,CNCT=debug,DISC=warn,HSWC=debug,NANN=debug,WTCL=warn |
If you've ever deleted a settled invoice, then you might have a gap, see this fragment: https://github.com/lightningnetwork/lnd/blob/master/channeldb/invoices.go#L3384-L3404 |
This is the case. But if invoice are ever deleted, then there'll be a gap there. If the numbers decreased or duplicated then it would no longer be monotonically increasing. |
@Roasbeef I don't see any code that would delete a settled invoice. How would I do that? If I ever did that, would that appear in my logs (I still have them)? And thank you, I just realized that the gap doesn't violate the documented behavior. However, if gaps are allowed, this makes it much harder to know that all settled invoices have been processed (i.e. that no pending invoice might settle in the future and fill the gap). |
Aside from that, shouldn't it be "strictly monotonically increasing", i.e. no two invoices share the same |
I believe that this wouldn't be feasible if a gap is ever created. You can't enforce strictness if there is also the possibility of a gap creation. As in order to fill the gap you'd need to break the monotonic increase. I assume the purpose of |
Aside from math and definitions, my problem remains: |
Background
The "settle_index" is supposed to be monotonically increasing:
However, my node does not have any invoice with settle_index 30278 nor 50310, whereas all other invoices exist according to
lncli listinvoices --index_offset 0 --paginate-forwards --max_invoices 3000000 | jq -r .invoices[].settle_index
.The settled invoices following the gaps were settled on 2022-02-14 02:59:10+01 and 2022-06-05 22:10:46+02.
Your environment
The text was updated successfully, but these errors were encountered: