Missing `bolt11` annotation after calling `pay`
After the removal of the pre-splitter it appears that under some
circumstances the bolt11 annotation may not be applied to HTLCs
being sent. This in turn means that we have the invoice while
performing the payment, but will forget it during a restart.
I think this may be related to the pre-splitter, but we may need to look further.
Context:
- GL session_id=7148941103595520
- Version v23.08gl1
Hello @cdecker I would like to give it a try. Can you explain a bit more about the issue please. Thanks.
CLN bounty available here: https://community.corelightning.org/c/cln-bounties/6978-missing-bolt11-annotation-after-calling-pay
I'm investigating this issue and have been able to reproduce the BOLT11 annotation loss after node restart. Working on understanding the exact relationship between HTLCs and payment records in the database schema.
Question for maintainers: Would a database migration approach be acceptable for this fix, or are there specific constraints I should be aware of regarding schema changes?
I have a few ideas on the implementation approach but want to validate the direction before investing too much time. Will update with findings soon.
This looks very much like a bug in pay!
We only set the bolt11 parameter to sendonion for the first payment we make, HOWEVER, if it fails early (e.g. no connection to first peer) it doesn't get saved in the db at all. We should, in fact, reset the invstring_used flag in this case.