Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Investigate coins not found in development mode #965

Closed
thomaseizinger opened this issue Dec 24, 2021 · 4 comments · Fixed by #1055
Closed

Investigate coins not found in development mode #965

thomaseizinger opened this issue Dec 24, 2021 · 4 comments · Fixed by #1055
Assignees
Labels
bug Something isn't working

Comments

@thomaseizinger
Copy link
Contributor

We sometimes run into the problem that we start with 0 balance when using our development seeds.
Perhaps #838 is related to this issue.

We should investigate, how bdk scans for coins (enable some logs?) and see how to resolve the issue. The original thinking was, because we use electrum as a backend, we should be able to re-scan from scratch on every startup and find ALL coins.

@thomaseizinger thomaseizinger added the bug Something isn't working label Dec 24, 2021
@thomaseizinger
Copy link
Contributor Author

Adding this to the milestone because it is seriously annoying.

Ideas on how to debug this:

  • Enable logs in BDK
  • Go back to BDK's sqlite database so we have a set of UTXOs to start with on startup
  • Try and use the esplora backend instead of the electrum backend in BDK for our wallet (we need to keep the electrum_client dependency for monitor, so don't get too confused by Use async-native esplora backend based on reqwest #815).

@da-kami
Copy link
Contributor

da-kami commented Jan 9, 2022

+1 on seriously annoying. I keep running into this problem upon almost every local test run.
@thomaseizinger do you think that bringing back the SQlite database to cache wallet state would help? At the moment we still only use the in-memory wallet, but I remember we discussed bringing back the wallet db. We should probably #838 into the milestone if we want to tackle this.

@thomaseizinger
Copy link
Contributor Author

So the bug reliably goes away if we scan more than 100 transactions which leads me to conclude that:

  • this can also happen in production as soon as the user has been using the wallet for a while
  • there seems to be a bug in BDK where repeated scans do not pick up balances discovered after the initial scan of 100 addresses

@thomaseizinger
Copy link
Contributor Author

Try and use the esplora backend instead of the electrum backend in BDK for our wallet (we need to keep the electrum_client dependency for monitor, so don't get too confused by

We can't do that unfortuntely because the esplora backend doesn't work with the async-interface: bitcoindevkit/bdk#165.

I tried using ureq which is horribly slow because it is a blocking client but it doesn't fix the issue anyway.

thomaseizinger added a commit that referenced this issue Jan 10, 2022
Fixes #965.

Seems to be an usptream bug: bitcoindevkit/bdk#521.
bors bot added a commit that referenced this issue Jan 11, 2022
1055: Scan for the next 1000 addresses r=thomaseizinger a=thomaseizinger

Fixes #965.

Seems to be an usptream bug: bitcoindevkit/bdk#521.

Co-authored-by: Thomas Eizinger <[email protected]>
@bors bors bot closed this as completed in ef0afcd Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants