ExchangeUnion / xud-docker

Streamlined setup of xud and all dependencies via docker 🐳
https://docs.exchangeunion.com
GNU Affero General Public License v3.0
5 stars 5 forks source link

Optimize lnd neutrino sync #368

Open kilrau opened 4 years ago

kilrau commented 4 years ago

Currently, lndbtc/lndltc sync takes some 10-15 minutes on simnet, about 3h on mainnet.

What can be optimized:

michael1011 commented 4 years ago

I understand the reason for which mobile wallets do these optimizations but we are not a mobile wallet running on a low powered Android device with limited bandwidth.

I would avoid adding even more security assumptions to our light client setup. Checkpoints would sound reasonable if we really really (really) want to have our clients synced in a couple seconds which is not necessary I think. 10 minutes of syncing is not too bad considering that you have a fully featured DEX afterwards.

routing.assumechanvalid=1 is not worth the effort for us right now.

What we can do for now is also use our own nodes to provide the Neutrino filters for the Bitcoin chain. That would mitigate the problem of the banned peers and timeouts until there are more reliable BTCD nodes on the network.

@kilrau

kilrau commented 4 years ago

Agree on leaving routing.assumechanvalid=1 aside for now and try checkpoints + reliable nodes.

kilrau commented 4 years ago

My nodes are up:

btc.kilrau.com 8333
btc.kilrau.com 18333
ltc.kilrau.com 9333
ltc.kilrau.com 19335
kilrau commented 4 years ago

Did a lnd 0.10 test with neutrino today too (mainnet+testnet) connecting to my own btc.kilrau.com full nodes. Result=Neutrino processes filters from genesis to tip with about 4000 blocks/minute.

2020-05-18 17:14:25.357 [INF] BTCN: Processed 2000 blocks in the last 25.23s (height 150445, 2011-10-24 12:55:09 +0000 UTC)
2020-05-18 17:16:42.555 [INF] BTCN: Verified 2000 filter headers in the last 28.83s (height 150001, 2011-10-20 13:51:45 +0000 UTC)
kilrau commented 4 years ago

Since things are working fine and Neutrino syncs in 15-30 mins on mainnet and as @michael1011 described we would want to avoid adding more security assumptions, we will leave things as is for now and only revisit this if syncing Neutrino becomes a problem. I'll leave this issue open though.