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

Restoration workers aren't restarted with the wallet #484

Closed
2 tasks done
KtorZ opened this issue Jun 26, 2019 · 1 comment
Closed
2 tasks done

Restoration workers aren't restarted with the wallet #484

KtorZ opened this issue Jun 26, 2019 · 1 comment
Assignees

Comments

@KtorZ
Copy link
Member

KtorZ commented Jun 26, 2019

Release Operating System Cause
next Windows & OSX & Linux) Code

Context

When creating a wallet via the API, we also start a restoration worker in charge of keeping the wallet in sync with the chain. There's one dedicated worker per wallet, and they're fairly resilient to network issues.
However, when restarting a wallet using an existing database that already contains a wallet, not restoration worker is started. Though, the wallet exist in DB and can't be recreated for instance.

Steps to Reproduce

  1. $ cardano-wallet launch --state-dir .state
  2. $ cardano-wallet wallet create ...
  3. SIGINT or CTRL-C on the launcher
  4. $ cardano-wallet launch --state-dir .state

Expected behavior

We should see log activity for a restoration worker keeping the wallet in sync.

Actual behavior

Nothing happen, the wallet exists in the DB but no restoration worker in background.


Resolution Plan

  • Upon starting, lookup existing wallets.
  • Start a worker for each wallet.

PR

Number Base
#486 master

QA

  • Add an integration tests which does the following steps (see LauncherSpec)

    1. Start a wallet server (on an empty state, with persistence)
    2. Create a new wallet
    3. Immediately kill the wallet server
    4. Re-start a wallet server, using the same database file
    5. Expect the previous wallet to exist and eventually be restored.
  • Note that the test is only a best-effort and will sometimes give false positive (but shouldn't give any false negative!). This is because we are running the test on a fresh new blockchain so, depending on when the restoration kicks in, it might have time to restore the wallet before we even kill the server (:rocket:). This happens fairly rarely in practice, and shouldn't give any false alarm anyway.

@piotr-iohk
Copy link
Contributor

lgtm

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

2 participants