lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Missing `bolt11` annotation after calling `pay`

Open cdecker opened this issue 1 year ago • 1 comments

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

cdecker avatar Jan 05 '24 13:01 cdecker

Hello @cdecker I would like to give it a try. Can you explain a bit more about the issue please. Thanks.

Harshit933 avatar Mar 01 '24 03:03 Harshit933

CLN bounty available here: https://community.corelightning.org/c/cln-bounties/6978-missing-bolt11-annotation-after-calling-pay

BitcoinJiuJitsu avatar Jan 28 '25 04:01 BitcoinJiuJitsu

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.

wqxoxo avatar Sep 25 '25 11:09 wqxoxo

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.

rustyrussell avatar Nov 13 '25 05:11 rustyrussell