-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting with CLN peer fails with warning #100
Comments
Are you able to replicate this on regtest using something like Polar? |
Well with regtest on polar I can't connect to the CLN peer either, only the LND peer. Calling |
@Jasonvdb can you confirm that connecting to a CLN peer does not work for you either? |
This looks like it is the correct genesis hash for Testnet, however, it's likely in wrong endianess, as I don't see where the byte order is swapped. @Jasonvdb could you check whether you're handing the genesis hash in the right order to LDK? |
I'm testing this on a local regtest and I'm not able to get it to add CLN as a peer. I get a @tnull I don't get the bad chain warning though. I'm not changing the byte order anywhere except for |
Well, likely only CLN chooses to close the connection upon receiving a bogus chain hash. LDK does not, not sure about LND. Note this is in line with BOLT 1 as either is allowed:
|
@Jasonvdb thanks for verifying. So it indeed looks like there is a reproducable issue in the react-native module that prevents connecting to a CLN node.
@tnull mmh, if CLN ist following the spec a little more strictly then perhaps the bug just isn't triggered with LND peers? @Jasonvdb how can I help in debugging the root cause? |
Right, this is likely what happens.
I think you could try to find where the network graph is setup and byte-swap the genesis hash before it is passed in. Note we'll also mitigate the issue upstream with the next release by replacing the genesis hash parameter with |
Tested this quickly and reversing bytes of genesis hash doesn't seem to help. Can still connect to other nodes but not CLN. I also noticed I needed to reverse |
Hm, does it always fail with above mentioned message? |
Hey, just wanted to follow up and ask if there are any updates on this? Thanks 🙏 |
I know that Mutiny Wallet is able to peer with CLN just fine and it's based on LDK. Not sure if any of their code could be helpful |
Sorry for the delay, I'll dive into this properly next week |
@Jasonvdb Any progress on this? Happy to help debug anything on the LDK side. |
Just rebased my config on top of the current master in tanx@10b2c37 and still having this issue. |
Mh, just confirmed again that I can indeed connect to the peer without issue from a Rust-based LDK peer. Not sure if the endianness is indeed an issue here, but meanwhile 0.0.114 was released in which we remove any exposed genesis hashes from the public API to mitigate any confusion in that regard. Would be good to know if the issue still persist after the library has upgraded. |
Great, thanks for verifying @tnull. Good to know we can rule out LDK core 🙏 |
Sorry for the delay here, I was away for a while. I did reverse bytes for genesis hash and it didn't fix, nothing actually seemed to change after doing that. I'm busy updating to 114 now so I'll test again and get back to you. |
@Jasonvdb How is the update to 114 going? |
The bindings or other aspects have caused an increase in fatal bugs. We are working with the LDK team to resolve them, but there will be delays. |
Tested with 114 and still no luck connecting from Android or iOS. @tnull if it wasn't the genesis hashes do you have any other ideas of what we could try? |
So I just also confirmed that I'm able to connect the CLN-based peer on testnet without issue using the Swift bindings (see https://gist.github.com/tnull/ab5df1b4d889e62ae420e51837448f31), which means that the issue is very likely on the react-native-ldk side (which is even more plausible if the issue is also present on Android, which I wasn't aware of so far). Will have another look at the codebase to see if I find something suspicious. |
Just got the same warning message with a Rust LDK client, in fact in the same setup I checked before. Will be investigating what's going on. |
Huh, interesting, just checked my LDK sample (with the network graph wiped and with one loaded from disk) and I don't see it :/. |
Argh, nevermind, I had accidently set it to |
I ran into this issue while attempting to connect with a CLN based LSP peer on testnet (no channel open, just peering). I currently get this warning message when I try to connect to the peer. I spoke with the vendor and they have been able to connect from another LDK based node, so they suggested it might be an issue in the react-native module. This is the config I'm running: tanx@a7b01bf. Thank you 🙏
The text was updated successfully, but these errors were encountered: