[Bug]: User-added LN peers are not backed up
Describe the bug
When I add a new LN peer and then restore my wallet the peer is not persisted. This is most important when there's a connection with an LSP (not blocktank) because without the peer then the connection is unusable.
Reproduce
- Request liquidity from LNBig to establish a new connection
- Observe LN connection that
Is Usable? Yes - Restore wallet
- Observe LN connection is now
Is Usable? No(this is because the peer is not restored) - At this stage, you can scan to re-add the peer to get the connection usable again, but you shouldn't need to.
Screenshots / Recording
No response
Operating system
Android 13 TKQ1.221114.001
Bitkit version
v127
Log output
No response
Fix here https://github.com/synonymdev/react-native-ldk/pull/257
I've tried verifying this with v130 d8f96e7d6475d2eef04ae08f9d9dd2c8894a8218 but the logs do not show me this peer after restore. I followed these steps:
- Scan qr for
039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1@edge-4.LNBiG.com:9735 - Observe the following in ldk logs
2024-07-26 11:46:22 DEBUG (JS): addPeer() success. {"pubKey":"039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1","address":"edge-4.LNBiG.com","port":9735,"timeout":5000}
2024-07-26 11:46:22 DEBUG (LDK): Finished noise handshake for connection with 039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1 (lightning::ln::peer_handler 1418)
2024-07-26 11:46:22 DEBUG (KOTLIN): Checking for dropped peers
2024-07-26 11:46:22 DEBUG (JS): readFromFile() success. "peers.json"
2024-07-26 11:46:22 DEBUG (KOTLIN): Success: file_write_success
2024-07-26 11:46:22 DEBUG (JS): writeToFile() success. "peers.json"
2024-07-26 11:46:22 DEBUG (KOTLIN): Sending backup to https://blocktank.synonym.to/backups-ldk/v1/persist?network=bitcoin&label=peers
2024-07-26 11:46:22 DEBUG (KOTLIN): Remote persist success for peers
2024-07-26 11:46:22 DEBUG (KOTLIN): Remote persist success for peers after 1 attempts
2024-07-26 11:46:22 INFO (LDK): Received peer Init message from 039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1: DataLossProtect: required, InitialRoutingSync: not supported, UpfrontShutdownScript: supported, GossipQueries: supported, VariableLengthOnion: required, StaticRemoteKey: required, PaymentSecret: required, BasicMPP: supported, Wumbo: supported, AnchorsNonzeroFeeHtlcTx: not supported, AnchorsZeroFeeHtlcTx: supported, RouteBlinding: supported, ShutdownAnySegwit: supported, Taproot: supported, OnionMessages: not supported, ChannelType: supported, SCIDPrivacy: not supported, ZeroConf: not supported, unknown flags: supported (lightning::ln::peer_handler 1586)
2024-07-26 11:46:22 DEBUG (LDK): Generating channel_reestablish events for 039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1 (lightning::ln::channelmanager 9003)
- Wait a while (>30 minutes) for restore to occur
- Wipe and restore wallet
- Search ldk logs for this peer
039edc94987c8f3adc28dab455efc00dea876089a120f573bd0b03c40d9d3fb1e1but no trace.
Ok thanks looking into it now. Strange because I see the peer file was both uploaded and restored there so not sure where this peer went missing.
related: synonymdev/react-native-ldk/issues/259
Fix here: https://github.com/synonymdev/bitkit/pull/2199
tl;dr the remote backups and rn-ldk was working fine the whole time, it was an optimisation from 2 years back that was interfering.
thanks
JC Verified on v134