Closed owtyahyg6 closed 1 month ago
So I just tested this in v23.11 and it works just fine to open private channels with CLN peers. It thus looks like the issue is a regression in v24.
Ok, so using v23.11, I can reproduce the issue when I launch using --enable-experimental-anchors. In v24.02, anchors are enabled by default. The issue seems to be related.
Was able to reproduce this with signet nodes:
LND logs:
2024-05-02 22:26:19.949 [INF] SRVR: New inbound connection from 127.0.0.1:50700
2024-05-02 22:26:19.950 [INF] SRVR: Finalizing connection to 036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344@127.0.0.1:50700, inbound=true
2024-05-02 22:26:19.951 [INF] NTFN: New block epoch subscription
2024-05-02 22:26:19.951 [INF] PEER: Peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): Negotiated chan series queries
2024-05-02 22:26:19.952 [INF] DISC: Creating new GossipSyncer for peer=036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344
2024-05-02 22:26:19.952 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): requesting new chans from height=0 and 193884 blocks after
2024-05-02 22:26:19.953 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): applying new update horizon: start=1969-12-31 19:00:00 -0500 EST, end=2106-02-07 01:28:15 -0500 EST, backlog_size=0
2024-05-02 22:26:19.953 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): buffering chan range reply of size=0
2024-05-02 22:26:19.954 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): filtering through 0 chans
2024-05-02 22:26:19.954 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): remote peer has no new chans
2024-05-02 22:26:19.954 [INF] DISC: GossipSyncer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): applying gossipFilter(start=2024-05-02 22:26:19.95444326 -0400 EDT m=+109.489331933, end=2160-06-09 04:54:34.95444326 -0400 EDT)
2024-05-02 22:26:36.755 [INF] FNDG: Recv'd fundingRequest(amt=1 BTC, push=0 mSAT, delay=6, pendingId=6e48cde5bdd8c0247fcc42aa993e0e59535d337346bc63cd31d5ac69717d252d) from peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344)
2024-05-02 22:26:36.755 [ERR] FNDG: channel type negotiation failed: requested channel type not supported
2024-05-02 22:26:36.755 [INF] FNDG: Cancelling funding reservation for node_key=036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344, chan_id=6e48cde5bdd8c0247fcc42aa993e0e59535d337346bc63cd31d5ac69717d252d
2024-05-02 22:26:36.756 [ERR] FNDG: unable to cancel reservation: no active reservations for peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344)
CLN:
2024-05-03T02:26:36.731Z DEBUG lightningd: fundchannel_start: allocating uncommitted_channel
2024-05-03T02:26:36.734Z INFO lightningd: Will open private channel with node 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923
2024-05-03T02:26:36.739Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: pid 1609484, msgfd 73
2024-05-03T02:26:36.740Z DEBUG hsmd: Client: Received message 30 from client
2024-05-03T02:26:36.740Z DEBUG hsmd: Client: Received message 10 from client
2024-05-03T02:26:36.741Z DEBUG hsmd: new_client: 1
2024-05-03T02:26:36.745Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-hsmd: Got WIRE_HSMD_GET_PER_COMMITMENT_POINT
2024-05-03T02:26:36.745Z DEBUG hsmd: Client: Received message 18 from client
2024-05-03T02:26:36.746Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: funder_channel_start
2024-05-03T02:26:36.746Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: Setting their reserve to 1000000sat
2024-05-03T02:26:36.746Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: peer_out WIRE_OPEN_CHANNEL
2024-05-03T02:26:36.746Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: billboard: Funding channel start: offered, now waiting for accept_channel
2024-05-03T02:26:36.757Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: peer_in WIRE_ERROR
2024-05-03T02:26:36.757Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: aborted opening negotiation: They sent ERROR channel 6e48cde5bdd8c0247fcc42aa993e0e59535d337346bc63cd31d5ac69717d252d: funding failed due to internal error
2024-05-03T02:26:36.758Z DEBUG 035ca2fe4793a5e789ce846062eb4834f573c060d9200ce77544a29b48a0aa5923-openingd-chan#1: billboard perm: They sent ERROR channel 6e48cde5bdd8c0247fcc42aa993e0e59535d337346bc63cd31d5ac69717d252d: funding failed due to internal error
2024-05-02 22:26:36.755 [ERR] FNDG: channel type negotiation failed: requested channel type not supported
What bits are being sent for the channel type? Note that we don't support the old non zero fee anchor channel with the default build.
If you do this lncli debuglevel --level=PEER=trace
, then we should be able to see exactly what channel type is being sent as part of open_channel
.
In this case, is CLN using the explicit channel type negotiation? So using the channel_type
field instead of relying on default behavior re feature bits? These are all the channel type combinations we explicitly support: https://github.com/lightningnetwork/lnd/blob/master/funding/commitment_type_negotiation.go#L88-L297
Here is the --level=PEER=trace
logs:
ChannelType: (*lnwire.ChannelType)(0x4001502070)({
features: (map[lnwire.FeatureBit]struct {}) (len=3) {
(lnwire.FeatureBit) 12: (struct {}) {
},
(lnwire.FeatureBit) 22: (struct {}) {
},
(lnwire.FeatureBit) 46: (struct {}) {
}
}
}),
Thanks! So that looks ok, as it's static key, scid alias, and anchor zero fee. Can you post what the Init
message that CLN sends to lnd looks like? Perhaps lnd doesn't like the feature bits advertised there compared to the channel it's trying to fund.
Where can I find that Init
message you are referring to? I don't see it in the trace logs but maybe I just haven't had enough coffee.
2024-05-04 15:36:56.706 [DBG] PEER: Peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): Received MsgOpenChannel(temp_chan_id=7076b565234e9adda83de57fc6b7835da1066c08314
af746613ae89332d7eae4, chain=00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6, csv=6, amt=1 BTC, push_amt=0 mSAT, reserve=0.01000000 BTC, flags=0) from 036e680823a129ac9a2eeb
8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344@127.0.0.1:58758
2024-05-04 15:36:56.706 [TRC] PEER: Peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): readMessage from peer: (*lnwire.OpenChannel)(0x4000934100)({
ChainHash: (chainhash.Hash) (len=32 cap=32) 00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6,
PendingChannelID: ([32]uint8) (len=32 cap=32) {
00000000 70 76 b5 65 23 4e 9a dd a8 3d e5 7f c6 b7 83 5d |pv.e#N...=.....]|
00000010 a1 06 6c 08 31 4a f7 46 61 3a e8 93 32 d7 ea e4 |..l.1J.Fa:..2...|
},
FundingAmount: (btcutil.Amount) 1 BTC,
PushAmount: (lnwire.MilliSatoshi) 0 mSAT,
DustLimit: (btcutil.Amount) 0.00000546 BTC,
MaxValueInFlight: (lnwire.MilliSatoshi) 18446744073709551615 mSAT,
ChannelReserve: (btcutil.Amount) 0.01000000 BTC,
HtlcMinimum: (lnwire.MilliSatoshi) 0 mSAT,
FeePerKiloWeight: (uint32) 1250, CsvDelay: (uint16) 6,
MaxAcceptedHTLCs: (uint16) 483,
FundingKey: (*secp256k1.PublicKey)(0x4002d147d0)({ x: (secp256k1.FieldVal) 4a954faa785e8f082bd2cbeea18935e49195b030993915821a758139830e931d,
y: (secp256k1.FieldVal) d508d25f0376e6678997cd1d7648bee87ea8789d06902386768bea39edc004ae
}), RevocationPoint: (*secp256k1.PublicKey)(0x4002d14870)({
x: (secp256k1.FieldVal) 09f8dc7f541f5759ee9182afa9e730a096ea959b76031a3f4a178a653774f3e4, y: (secp256k1.FieldVal) 9bc75e4445491e1f0bd1f3f7cb4463bdf98eb7089eefa80765280288791bbb75
}),
PaymentPoint: (*secp256k1.PublicKey)(0x4002d148c0)({ x: (secp256k1.FieldVal) d3d888a4f0ee72de959db9c8ca434ffe19cd422577dac050dcbe01bd94547555, y: (secp256k1.FieldVal) 2c4a5844dc99719962e63f6804c9956ca0cefa0d6bec1686737b1f1633c98281
}),
DelayedPaymentPoint: (*secp256k1.PublicKey)(0x4002d14910)({
x: (secp256k1.FieldVal) a724a5b89f8c943820ca19e34dd3aa228f36314e2bc392207cbb9fed720760a1,
y: (secp256k1.FieldVal) 4e227a2cb6f7e9cbd1d6de9c39909833b443c3e3d171b83f1929cd02fed57381
}),
HtlcPoint: (*secp256k1.PublicKey)(0x4002d14960)({
x: (secp256k1.FieldVal) 6a4b82ec3da4bcebac14011ed566100107e23ca72874435cb46b190d1ee54fcb,
y: (secp256k1.FieldVal) ebf77c6a3172b7350f9691ad992966d8f67746f9524bb130d0d8ce4cb43a9ab7
}),
FirstCommitmentPoint: (*secp256k1.PublicKey)(0x4002d149b0)({
x: (secp256k1.FieldVal) 8532c71622be9795a3f6fd9ebe87341ce4bfb20621f18f4fac7450cd1c9e4cf7,
y: (secp256k1.FieldVal) b83e8387bcd2964a4d95b2a22d1cda4f331e5510fb5406a1ffd73c743cab3849
}),
ChannelFlags: (lnwire.FundingFlag) 0,
UpfrontShutdownScript: (lnwire.DeliveryAddress) {
},
ChannelType: (*lnwire.ChannelType)(0x4002d924f0)({
features: (map[lnwire.FeatureBit]struct {}) (len=3) {
(lnwire.FeatureBit) 12: (struct {}) {
},
(lnwire.FeatureBit) 22: (struct {}) {
},
(lnwire.FeatureBit) 46: (struct {}) {
}
}
}),
LeaseExpiry: (*lnwire.LeaseExpiry)(<nil>),
LocalNonce: (*lnwire.Musig2Nonce)(<nil>),
ExtraData: (lnwire.ExtraOpaqueData) (len=10 cap=512) {
00000000 00 00 01 06 40 00 00 40 10 00 |....@..@..|
}
})
2024-05-04 15:36:56.715 [INF] FNDG: Recv'd fundingRequest(amt=1 BTC, push=0 mSAT, delay=6, pendingId=7076b565234e9adda83de57fc6b7835da1066c08314af746613ae89332d7eae4) from peer(036e680823a12
9ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344)
2024-05-04 15:36:56.715 [ERR] FNDG: channel type negotiation failed: requested channel type not supported
2024-05-04 15:36:56.716 [INF] FNDG: Cancelling funding reservation for node_key=036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344, chan_id=7076b565234e9adda83de57fc6b7835da1
066c08314af746613ae89332d7eae4
2024-05-04 15:36:56.716 [ERR] FNDG: unable to cancel reservation: no active reservations for peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344)
2024-05-04 15:36:56.716 [DBG] PEER: Peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): Sending Error(chan_id=7076b565234e9adda83de57fc6b7835da1066c08314af746613ae89332
d7eae4, err=funding failed due to internal error) to 036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344@127.0.0.1:58758
2024-05-04 15:36:56.716 [TRC] PEER: Peer(036e680823a129ac9a2eeb8c43514a5b6cb09ae28e3e698a0e34aaa8865d6cc344): writeMessage to peer: (*lnwire.Error)(0x4003702700)(chan_id=7076b565234e9adda83d
e57fc6b7835da1066c08314af746613ae89332d7eae4, err=funding failed due to internal error)
We may get this information from cln, if you look with io
log level, if you post it there we will fine a way to see where the bug is
Yeah, looking at LND master, seems like it should be fine with this combo? A bit overzealous checking that we offer the matching features (there's nothing fundamental about requesting an explicit channel even if you didn't say you supported that, though weird), but we do indeed offer those features.
LND doesn't like a public channel with scid_alias, which is actually legal (normalize scid aliases!), but we don't do that either and it's not where it's getting upset.
Mh not sure that this happens with not private channel @rustyrussell I think the problem is only with the private one
I get some data out from the wire, but I still need more coffee to see what it is going on
➜ lightning git:(macros/wallet-fix-dev-rescan-ouputs) ✗ ./devtools/decodemsg 0020f61eee3b63a380a477a063af32b2bbc97c9ff9f01f2c4225e97398810800000047d9863fb7f7aef3a63cc8d2ad5410a870e860f2923791877d61947a7cb3c30b000000000010664e00000000000000000000000000000222ffffffffffffffff00000000000029fb0000000000000000000004e2000601e302eff2aefd167fbf4b4a6f840cb2993e484a18f971708ff1ae2a11b21125cc059602c55be0fdb1f633b12c94c7baa07672434928466b1283005522e79270d167b51502919f67306c83c045c6a3bdb0d573bedb18f7e7aa015fd240d55718250a55b058020cb9361d824a89a8ceb996e10629a5c76d80e29c47e4f26f6fa982e5379aed6e0373ab210f91a57a283a8cc9a578eb3f78d0b8a300f98e7dee93f9e1b256e8e89d02a55a729f07e17797efa47bb2c26b5c61f5cbfdb0ec3cd560a66c1c54a97b43d20000000106400000401000
WIRE_OPEN_CHANNEL:
chain_hash=00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6
temporary_channel_id=47d9863fb7f7aef3a63cc8d2ad5410a870e860f2923791877d61947a7cb3c30b
funding_satoshis=1074766sat
push_msat=0msat
dust_limit_satoshis=546sat
max_htlc_value_in_flight_msat=18446744073709551615msat
channel_reserve_satoshis=10747sat
htlc_minimum_msat=0msat
feerate_per_kw=1250
to_self_delay=6
max_accepted_htlcs=483
funding_pubkey=02eff2aefd167fbf4b4a6f840cb2993e484a18f971708ff1ae2a11b21125cc0596
revocation_basepoint=02c55be0fdb1f633b12c94c7baa07672434928466b1283005522e79270d167b515
payment_basepoint=02919f67306c83c045c6a3bdb0d573bedb18f7e7aa015fd240d55718250a55b058
delayed_payment_basepoint=020cb9361d824a89a8ceb996e10629a5c76d80e29c47e4f26f6fa982e5379aed6e
htlc_basepoint=0373ab210f91a57a283a8cc9a578eb3f78d0b8a300f98e7dee93f9e1b256e8e89d
first_per_commitment_point=02a55a729f07e17797efa47bb2c26b5c61f5cbfdb0ec3cd560a66c1c54a97b43d2
channel_flags=0
tlvs={
type=0
len=0
(msg_name=upfront_shutdown_script)
shutdown_scriptpubkey=[]
}
{
type=1
len=6
(msg_name=channel_type)
type=[400000401000]
}
Ok I think I found the problem
lnd disable the by default inside the configuration, I try to do some tests
# enabling the option_scid_alias
➜ lightning git:(macros/wallet-fix-dev-rescan-ouputs) ✗ ./devtools/features 80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0008a8251a1
option_data_loss_protect/even (compulsory)
option_upfront_shutdown_script/odd (optional)
option_gossip_queries/odd (optional)
option_var_onion_optin/even (compulsory)
option_static_remotekey/even (compulsory)
option_payment_secret/even (compulsory)
option_basic_mpp/odd (optional)
option_anchors_zero_fee_htlc_tx/odd (optional)
option_route_blinding/odd (optional)
option_shutdown_anysegwit/odd (optional)
option_amp/odd (optional)
option_channel_type/odd (optional)
option_scid_alias/odd (optional)
option_unknown_2022/odd (optional)
# with defaults
➜ lightning git:(macros/wallet-fix-dev-rescan-ouputs) ✗ ./devtools/features 8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a8251a1
option_data_loss_protect/even (compulsory)
option_upfront_shutdown_script/odd (optional)
option_gossip_queries/odd (optional)
option_var_onion_optin/even (compulsory)
option_static_remotekey/even (compulsory)
option_payment_secret/even (compulsory)
option_basic_mpp/odd (optional)
option_anchors_zero_fee_htlc_tx/odd (optional)
option_route_blinding/odd (optional)
option_shutdown_anysegwit/odd (optional)
option_amp/odd (optional)
option_channel_type/odd (optional)
option_unknown_2022/odd (optional)
To more explicitly close the gap here:
lnd
node the OP tried again didn't have scid alias active. lnd
, it isn't on by default (historical reasons), so users need to set it with this flag: https://github.com/lightningnetwork/lnd/blob/2f2efc782436944ce98b1e0e13bde125951b2b36/sample-lnd.conf#L1304-L1307lnd
node, it'll reject it. There's no good reason why scid
alias should be an opt in feature though, so we're looking to make it on by default in our next release.
To more explicitly close the gap here:
* The comment by @vincenzopalazzo above shows that the `lnd` node the OP tried again didn't have scid alias active. * Today for `lnd`, it isn't on by default (historical reasons), so users need to set it with this flag: https://github.com/lightningnetwork/lnd/blob/2f2efc782436944ce98b1e0e13bde125951b2b36/sample-lnd.conf#L1304-L1307 * Without that flag, if a private channel with scid alias active is opened towards an `lnd` node, it'll reject it.
There's no good reason why
scid
alias should be an opt in feature though, so we're looking to make it on by default in our next release.
So is it possible that it is still not fixed in the new release? https://github.com/lightningnetwork/lnd/blob/v0.18.3-beta/sample-lnd.conf#L1304-L1307 . If this is the case, what prevents it from being fixed?
Thanks!
Did you have the feature enable on the land side? See https://github.com/ElementsProject/lightning/issues/7221#issuecomment-2100052979
Did you have the feature enable on the land side? See #7221 (comment)
I am a CLN user trying to establish private channels with LND peers. I was waiting for the default value of the protocol.option-scid-alias parameter in lnd.conf to be updated so I can open channels with them, assuming they would use the default value. However I see that CLN's code was patched as well here https://github.com/ElementsProject/lightning/commit/e85eabcf748eb169cd50e90d9b31081fa2a6132a to prevent the issue?
Issue and Steps to Reproduce
Private channel funding seems to be broken with LND peers (works with CLN and Eclair peers I tested):
For example, I consistently get this error if I try channel funding with the (LND) Boltz node, but I don't from their CLN node. I have experienced this error as well from another node I presume is using LND. I have not seen with with non-LND nodes. In all cases there is no such error when I set announce=true. I am using v24.02.2. I had the same error with v24.02.1. I tested with multiple CLN nodes I have.