Lnd: Handle starting LND with unsynced chain backend.

Created on 6 Sep 2018  路  2Comments  路  Source: lightningnetwork/lnd

Background

LND fails to start on Litecoind testnet

Your environment

  • lnd version 0.5.0-beta commit=baee07ef480c15a731e0c87dc98d27269c5a80fa
  • Linux 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux
  • Litecoin Core Daemon version v0.16.2 eba0e1ca3fb4088998461b02ec6831858cc24144
~/.litecoin/litecoin.conf
testnet=1
txindex=1
server=1
; daemon=1
debug=1
discardfee=0.00000001
mintxfee=0.00000001
minrelaytxfee=0.00000001
rpcuser=jason
rpcpassword=litecoin
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
tail -n1000 ~/.litecoin/testnet4/debug.log |grep UpdateTip   | awk '{print $1, $2, $6, $10, $11, $12}'
2018-09-06 03:38:31 height=724100 date='2018-09-06 03:38:17' progress=1.000000
2018-09-06 03:40:34 height=724101 date='2018-09-06 03:40:21' progress=1.000000
2018-09-06 03:41:07 height=724102 date='2018-09-06 03:40:34' progress=1.000000
2018-09-06 03:50:05 height=724103 date='2018-09-06 03:49:48' progress=1.000000
2018-09-06 03:54:18 height=724104 date='2018-09-06 03:54:05' progress=1.000000

Steps to reproduce

lnd --externalip=$(dig +short myip.opendns.com @resolver1.opendns.com)

Expected behaviour

Start normal

Actual behaviour

2018-09-05 20:51:18.488 [INF] LTND: Version 0.5.0-beta commit=baee07ef480c15a731e0c87dc98d27269c5a80fa
2018-09-05 20:51:18.489 [INF] LTND: Active chain: Litecoin (network=testnet)
2018-09-05 20:51:18.489 [INF] CHDB: Checking for schema update: latest_version=6, db_version=6
2018-09-05 20:51:18.506 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
2018-09-05 20:51:18.507 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
2018-09-05 20:51:18.507 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, o
r `lncli changepassword` to change the password of an existing wallet and unlock it.
2018-09-05 20:51:28.192 [INF] LTND: Primary chain is set to: litecoin
2018-09-05 20:51:28.205 [INF] LTND: Initializing litecoind backed fee estimator
2018-09-05 20:51:29.411 [INF] LTND: LightningWallet opened
2018-09-05 20:51:29.419 [INF] HSWC: Restoring in-memory circuit state from disk
2018-09-05 20:51:29.420 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0
2018-09-05 20:51:29.439 [INF] RPCS: gRPC proxy started at 127.0.0.1:8080
2018-09-05 20:51:29.439 [INF] RPCS: RPC server listening on 127.0.0.1:10009
2018-09-05 20:51:29.446 [INF] LTND: Waiting for chain backend to finish sync, start_height=724103
2018-09-05 20:51:30.457 [INF] LTND: Chain backend is fully synced (end_height=724103)!
2018-09-05 20:51:30.464 [INF] HSWC: Starting HTLC Switch
2018-09-05 20:51:30.464 [INF] NTFN: New block epoch subscription
2018-09-05 20:51:30.464 [INF] NTFN: New block epoch subscription
2018-09-05 20:51:30.464 [INF] NTFN: New block epoch subscription
2018-09-05 20:51:30.467 [INF] DISC: Authenticated Gossiper is starting
2018-09-05 20:51:30.467 [INF] BRAR: Starting contract observer, watching for breaches.
2018-09-05 20:51:30.467 [INF] NTFN: New block epoch subscription
2018-09-05 20:51:30.614 [ERR] SRVR: unable to start server: -8: Block height out of range

2018-09-05 20:51:30.615 [INF] LTND: Shutdown complete
-8: Block height out of range
P3 backend bug enhancement litecoin

Most helpful comment

@alevchuk i've seen this issue before and _i think_ it has to do with LND having tx information that doesn't match your ltcd/litecoind nodes. You can find the offending code for ltcd here.

Reproduction case:
Start a new testnet node (not synced) w/ LND after LND had already been indexed with an up-to-date testnet node

Workaround:
Backup your wallet, delete /data, re-import wallet. I would not recommend these steps for anything outside of test

All 2 comments

very similar issue with ltcd

ltcd version 0.12.0-beta https://github.com/ltcsuite/ltcd/commit/cdab10132e8c6e4a3ffd112dba54791946d28906

2018-09-06 13:23:26.341 [INF] NTFN: New block epoch subscription
2018-09-06 13:23:30.546 [ERR] SRVR: unable to start server: -1: Block number out of range

2018-09-06 13:23:30.547 [INF] LTND: Shutdown complete
-1: Block number out of range

@alevchuk i've seen this issue before and _i think_ it has to do with LND having tx information that doesn't match your ltcd/litecoind nodes. You can find the offending code for ltcd here.

Reproduction case:
Start a new testnet node (not synced) w/ LND after LND had already been indexed with an up-to-date testnet node

Workaround:
Backup your wallet, delete /data, re-import wallet. I would not recommend these steps for anything outside of test

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ealymbaev picture ealymbaev  路  3Comments

alec-djinn picture alec-djinn  路  3Comments

Roasbeef picture Roasbeef  路  3Comments

sunnya97 picture sunnya97  路  3Comments

BitBargain picture BitBargain  路  3Comments