Skip to content
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

Importing descriptors process in a loop #86

Open
chuegel opened this issue Oct 18, 2022 · 10 comments
Open

Importing descriptors process in a loop #86

chuegel opened this issue Oct 18, 2022 · 10 comments

Comments

@chuegel
Copy link

chuegel commented Oct 18, 2022

OS: MacOS 12.6
satstack: 0.16.1_macOS-amd64

lss seems to run in a loop every time it is started. I completed the account import successfully but when lss is stopped:

^C[2022/10/18 - 07:18:20]  INFO Shutdown server: in progress
[2022/10/18 - 07:18:20]  INFO Unloaded wallet successfully                  wallet=satstack
[2022/10/18 - 07:18:20]  INFO Shutdown server: done

the wallet is also released from the node:

2022-10-18T05:18:20Z [satstack] Releasing wallet 

and restarted, the account import process runs again from scratch:

./lss
[2022/10/18 - 07:18:53]  INFO Ledger SatStack (lss) v0.16.1                 arch=darwin amd64 build= commit= runtime=go1.17.13
[2022/10/18 - 07:18:53]  INFO Config file detected                          path=/Users/user/Library/Application Support/Ledger Live/lss.json
[2022/10/18 - 07:18:53]  INFO Warming up...
[2022/10/18 - 07:18:56]  INFO Loaded existing wallet                        wallet=satstack
[2022/10/18 - 07:18:56]  INFO RPC connection established                    blockFilter=false chain=main pruned=false txindex=true
 __________________________________________
/ We define an electronic coin as a chain  \
| of digital signatures. Each owner        |
| transfers the coin to the next by        |
| digitally signing a hash of the previous |
| transaction and the public key of the    |
| next owner and adding these to the end   |
| of the coin. A payee can verify the      |
| signatures to verify the chain of        |
| ownership.                               |
|                                          |
\         -- Satoshi Nakamoto, 2010        /
 ------------------------------------------
        \   ^__^
         \  (₿₿)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /timestamp                --> github.com/ledgerhq/satstack/httpd/handlers.GetTimestamp.func1 (3 handlers)
[GIN-debug] GET    /control/descriptors/import --> github.com/ledgerhq/satstack/httpd/handlers.ImportAccounts.func1 (3 handlers)
[GIN-debug] POST   /control/descriptors/has  --> github.com/ledgerhq/satstack/httpd/handlers.HasDescriptor.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/explorer/_health --> github.com/ledgerhq/satstack/httpd/handlers.GetHealth.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/explorer/status --> github.com/ledgerhq/satstack/httpd/handlers.GetStatus.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/btc/network --> github.com/ledgerhq/satstack/httpd/handlers.GetNetwork.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/btc/fees --> github.com/ledgerhq/satstack/httpd/handlers.GetFees.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/btc/blocks/:block --> github.com/ledgerhq/satstack/httpd/handlers.GetBlock.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/btc/transactions/:hash/hex --> github.com/ledgerhq/satstack/httpd/handlers.GetTransactionHex.func1 (3 handlers)
[GIN-debug] POST   /blockchain/:version/btc/transactions/send --> github.com/ledgerhq/satstack/httpd/handlers.SendTransaction.func1 (3 handlers)
[GIN-debug] GET    /blockchain/:version/btc/addresses/:addresses/transactions --> github.com/ledgerhq/satstack/httpd/handlers.GetAddresses.func1 (3 handlers)
[2022/10/18 - 07:18:56]  INFO worker: Initial Block Download complete               blockHash=000000000000000000051ad07f5a11b6701fb954648b0dc44ca41c8a3d6eba92 blockHeight=759179
[2022/10/18 - 07:18:56]  INFO worker: Computing circulating supply...
[2022/10/18 - 07:22:47]  INFO worker: #RunTheNumbers successful                     actualSupply=19182160.91854672 BTC expectedSupply=19182368.75 BTC height=759179
[2022/10/18 - 07:22:47]  INFO worker: Importing descriptors                         duration=0s progress=0.00%
[2022/10/18 - 07:22:54]  INFO worker: Importing descriptors                         duration=7s progress=0.11%
[2022/10/18 - 07:23:01]  INFO worker: Importing descriptors                         duration=14s progress=0.23%
[2022/10/18 - 07:23:08]  INFO worker: Importing descriptors                         duration=21s progress=0.35%
[2022/10/18 - 07:23:15]  INFO worker: Importing descriptors                         duration=28s progress=0.47%
[2022/10/18 - 07:23:22]  INFO worker: Importing descriptors                         duration=35s progress=0.60%
[2022/10/18 - 07:23:29]  INFO worker: Importing descriptors                         duration=42s progress=0.72%
[2022/10/18 - 07:23:36]  INFO worker: Importing descriptors                         duration=49s progress=0.84%
[2022/10/18 - 07:23:43]  INFO worker: Importing descriptors                         duration=56s progress=0.96%
[2022/10/18 - 07:23:50]  INFO worker: Importing descriptors                         duration=1m3s progress=1.08%
[2022/10/18 - 07:23:57]  INFO worker: Importing descriptors                         duration=1m10s progress=1.21%
[2022/10/18 - 07:24:04]  INFO worker: Importing descriptors                         duration=1m17s progress=1.34%
[2022/10/18 - 07:24:11]  INFO worker: Importing descriptors                         duration=1m24s progress=1.45%
[2022/10/18 - 07:24:18]  INFO worker: Importing descriptors                         duration=1m31s progress=1.57%
[2022/10/18 - 07:24:25]  INFO worker: Importing descriptors                         duration=1m38s progress=1.67%
[2022/10/18 - 07:24:32]  INFO worker: Importing descriptors                         duration=1m45s progress=1.77%
[2022/10/18 - 07:24:39]  INFO worker: Importing descriptors                         duration=1m52s progress=1.89%
[2022/10/18 - 07:24:47]  INFO worker: Importing descriptors                         duration=1m59s progress=2.00%
@adrienlacombe
Copy link
Contributor

hi @chuegel can you see if the same descriptors are being imported, or are they new ones? thank you

@chuegel
Copy link
Author

chuegel commented Oct 21, 2022

@adrienlacombe-ledger how can I check that?

Also, I must mention that I'm running a Lightning node on the same machine

@adrienlacombe
Copy link
Contributor

@adrienlacombe-ledger how can I check that?

Also, I must mention that I'm running a Lightning node on the same machine

do you have a multiple descriptors in your lss.json?

@chuegel
Copy link
Author

chuegel commented Oct 21, 2022

No, just one (external/internal)

@ziggie1984
Copy link
Contributor

The scan will repeat for every descriptor, so in your case 2 times (1 for internal 1 for external)

@chuegel
Copy link
Author

chuegel commented Nov 7, 2022

Thanks for your reply. Yes, but why does the import process starts from scratch as the descriptors in the lss.jsondidn't change?

@ziggie1984
Copy link
Contributor

thats a bitcoin-core thing, lss imports the descriptors everytime it restarts, which forces bitcoind to rescan the wallet, need to check whether bitcoinds wallet information persist after a scan

@ziggie1984
Copy link
Contributor

ok, I just checked, core keeps the latest state of the wallet after reloading, so its should be easy to fix this

@ziggie1984
Copy link
Contributor

As a quick fix for the rescanning wallet problem can be to put the birthday in the lss.json to the current date and everything should work find. Only prerequisite for this is that the syncing already happened before. In practical it would look like this: First let ledger and bitcoin-core sync with the real birthday date, if that happened and you need to restart the bridge, change the birthday to the current date.

"external" : "",
"internal" : "",
"birthday": "2022/11/07"

@chuegel
Copy link
Author

chuegel commented Nov 24, 2022

Probably related to #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants