Closed carlaKC closed 5 months ago
I should look at it because I am interesting in the ldk compatibility too, but maybe @rustyrussell know already what it is going on
This sounds like we are basing out CLTV calculations on our current sync-height, rather than the blockheader count. We should change that :-)
That being said, I expect this test environment to be automated, and if we didn't poll bitcoind
recently we won't be aware of recently generated blocks either. This is specific to the testing environment as on mainnet blocks are not generated in rapid success, which also means we don't end up with the wrong CLTVs.
In case you are using the pyln-testing
package, there is a function to allow waiting for blockchain sync: sync_blockheight(bitcoind, [list, of, nodes, to, sync])
, do this and the heights should line up again.
That being said, I expect this test environment to be automated, and if we didn't poll bitcoind recently we won't be aware of recently generated blocks either
Just running a few nodes manually on regtest and re-tested this today (having not mined any block storms for a good 12h since I was trying this out yesterday) and I still get the same value.
Is there a way for me to check whether my nodes are fully synced? I tried waitblockheight 300
and it returns immediately, and getinfo
has the current block height as my other (LND) nodes see it. Logs also have lightningd: Adding block 300
although maybe that doesn't mean it's fully synced?
Hm, that should indeed be the case, I don't have a good explanation for this one :thinking:
@carlaKC maybe core lightning is not pulling bitcoind during this time? there is a flag that I use lnprototest that is --dev-bitcoind-poll=1
passed to lightnind
Logs also have lightningd: Adding block 300 although maybe that doesn't mean it's fully synced?
mh idk :) we should try to reproduce it
@carlaKC maybe core lightning is not pulling bitcoind during this time? there is a flag that I use lnprototest that is --dev-bitcoind-poll=1 passed to lightnind
Tested again with this option and still hitting the same issue - got a max of 108 when on block 148.
Well lets try to look at it during April, thanks for the report @carlaKC
Issue and Steps to Reproduce
I've been testing out blinded payments w/LND and ran into an issue with
max_cltv_expiry
being set to 108 when the current block height is 300.Steps to reproduce:
lightningd: v24.02.1-11-gdf0f4c4
LND --(private channel)-- CL0
max_cltv_expiry
value is less than current block heightThe private channel that I opened has LND's defaults - 80 CLTV delta and 1 msat HTLC minimum.
Command Output
Create offer on CL0:
Fetch an invoice for the offer (using another CL node that's just connected on P2P):
Decode the invoice to grab info to make payment from LND:
Pay invoice from LND, hex-encoded decrypted
encrypted_data
is:020800008900000100000a0800500000000103e80c060000006c03e8