Repository navigation
Conversation
bd22f4a to
d429bd1
Compare
d429bd1 to
4853a7d
Compare
c147533 to
57350f8
Compare
cdecker
left a comment
There was a problem hiding this comment.
Very good change 👍
There is one small logical issue that we need to ensure is solved before we can merge it though. As it stands right now, we are delaying the channel_ready signal, but in the case of JIT LSP channels, which I believe this attemtps to stabilize, the LSP waits for the initial payment to complete, but it cannot attempt the forwarding of the payment, until we have exchanged the channel_ready which results in a circular dependency, that'd cause LSP JIT channels to always fail its completion.
It should be ok to exchange the channel_ready, accepting HTLCs, but we can use the signal you are adding here to gate our own use of the channel, so that we do not accidentally lock up on abandoned channels, whcih is the problem we are currently facing.
| * **zeroconf-require-funding-seen**=*BOOL* | ||
|
|
||
| If set to `true`, a zero-conf channel (`minimum_depth` 0) is not used, and we | ||
| don't send `channel_ready` for it, until our own bitcoind has seen its funding |
There was a problem hiding this comment.
This prevents the B-LPS and all other LSPs2 implementations from completing:
There is a circular dependency here:
- LSP opens channel
- Waits for channel_ready so it can add the HTLC paying for the channel
- Recipient waits for incoming payment before sending channel_ready
- The LSP publishes the funding only if and when the HTLC is accepted by the recipient.
Notice how we have a circular dependency here:
4 -> 3 -> 2 -> 4
There is no way to secure these, but we can still guard ourselves from using a channel ourselves until we have its funding. It is even a stronger check than what we currently have in GL (a max_msat_to_us high water mark that tells us if we ever accepted a payment over this channel if it is non-zero).
|
I took the liberty of filing issue #9697 as a followup: it adds a stricter guarantee, i.e., that we save lifecycle relevant transactions in the DB, even if we are the fundee. It builds on your changes here, and strengthens the guarantees a bit, and also gives a fundee all they need to in order to enforce their version of reality. |
…warding on it Changelog-None
Changelog-Added: Config: makes lightningd wait until it has seen a zero-conf channel's funding transaction before using it
57350f8 to
fa38713
Compare
Inside
Zero-conf channels (option_zeroconf) become usable for HTLC forwarding immediately, with zero verification that the funding transaction was ever broadcast to the network - peer_start_channeld() sends channeld an artificial 0-depth confirmation event, unconditionally, using a zeroed-out fake txid, regardless of whether the real funding tx has ever been observed. There was no persisted state anywhere distinguishing "never broadcast" from "broadcast, unconfirmed" from "confirmed."
This PR adds:
Important
26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.
RC1 is scheduled on August 17th
The final release is scheduled for September 7th.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradeChangelog-Fixed: lightningd: zero-conf channels no longer accept HTLC forwards before their funding transaction has actually been observed broadcast, failed forwards over such a channel now report funding_not_broadcast instead of a generic reason