Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Restoring a wallet backup (wallet v2) sometimes fails and then only shows "a" #11383

Closed
bsclifton opened this issue Oct 9, 2017 · 20 comments · Fixed by #12286
Closed

Restoring a wallet backup (wallet v2) sometimes fails and then only shows "a" #11383

bsclifton opened this issue Oct 9, 2017 · 20 comments · Fixed by #12286

Comments

@bsclifton
Copy link
Member

bsclifton commented Oct 9, 2017

Test plan

  1. Fresh profile
  2. Launch with extra command line param:
    LEDGER_NO_DELAY=true
  3. Visit Preferences > Payments and enable Brave Payments
  4. Visit Preferences > Advanced > Backup your wallet and copy the keywords
  5. Visit Preferences > Advanced > Recover your wallet
  6. Restore wallet using keywords from step 4
  7. Repeat step 6 over and over again (with the LEDGER_NO_DELAY flag, it will try to run sync every 5 seconds. Running sync at the same time that restore happened appeared to be the root cause).
  8. Visit Preferences > Advanced > Backup your wallet and verify key is NOT a

Description

I migrated from wallet 1 to 2 and did the backup/recover process. Now that I've restored, the backup screen simply shows "a" as the keyword?
screen shot 2017-10-08 at 11 33 30 pm

Steps to Reproduce

1. Have a wallet with v2 (BAT) that is displaying and working properly
2. Go to advanced => backup
3. Copy the keywords to clipboard and store somewhere
4. Go to advanced => restore
5. Input the keywords copied from step 3
6. After recovery finishes, go to advanced => backup

Updated steps per @srirambv via his post below

  1. Upgrade from 0.18.36 with wallet created
  2. Wait for the transition to complete
  3. Recover wallet using different wallet backup codes
  4. Recover wallet without selecting any file or typing any code and ensure it fails
  5. Repeat steps 3 & 4 around 4-5 times
  6. Change reconcile stamp in ledger-state.json
  7. Relaunch payments tab open up with the code as a

Actual result:
See screenshot

Expected result:
Should be showing all 32 words

Reproduces how often: [What percentage of the time does it reproduce?]

Brave Version

about:brave info:

Brave: 0.19.34
rev: d87b7ca
Muon: 4.4.25
libchromiumcontent: 61.0.3163.100
V8: 6.1.534.41
Node.js: 7.9.0
Update Channel: Beta
OS Platform: macOS
OS Release: 16.7.0
OS Architecture: x64

Reproducible on current live release:
no

Additional Information

@bsclifton
Copy link
Member Author

bsclifton commented Oct 9, 2017

Per @NejcZdovc's request, I checked my seed in ledger-state.json and it appears that is the issue:

{
  // snip
  "properties": {
    "setting": "adFree",
    "fee": {
      "currency": "BAT",
      "amount": 10
    },
    "days": 30,
    "wallet": {
      "keyinfo": {
        "seed": {
          "0": 0,
          "1": 0
        }
      },
      // snip

@NejcZdovc
Copy link
Contributor

tried to reproduce this one, but without success

@luixxiul luixxiul added the needs-STR This bug needs steps to reproduce. label Oct 9, 2017
@NejcZdovc NejcZdovc added needs-info Another team member needs information from the PR/issue opener. and removed needs-STR This bug needs steps to reproduce. labels Oct 9, 2017
@bsclifton
Copy link
Member Author

Per discussion w/ @NejcZdovc, we suspect this may be because I was switching between staging and production URLs several times (also, some updates had to be made for the endpoint; cc: @evq). I'll close this issue for now and we can re-open if we see again

@bsclifton bsclifton removed this from the 0.19.x (Beta Channel) milestone Oct 9, 2017
@luixxiul luixxiul removed the needs-info Another team member needs information from the PR/issue opener. label Oct 9, 2017
@srirambv
Copy link
Collaborator

image
Seeing this on 0.19.41
STR I followed

  1. Upgrade from 0.18.36 with wallet creaeted
  2. Wait for the transition to complete
  3. Recover wallet using different wallet backup codes
  4. Recover wallet without selecting any file or typing any code and ensure it fails
  5. Repeat steps 3 & 4 around 4-5 times
  6. Change reconcile stamp in ledger-state.json
  7. Relaunch payments tab open up with the code as a

@srirambv srirambv reopened this Oct 11, 2017
@bsclifton
Copy link
Member Author

@srirambv based on your steps, it seems there is an intermittent failure somewhere which we need to be handling. I'm going to update the text of this issue to reflect that

@bsclifton bsclifton changed the title Backup wallet screen (wallet v2) only shows "a" Restoring a wallet backup (wallet v2) sometimes fails and then only shows "a" Oct 16, 2017
@bsclifton bsclifton added the priority/P2 Crashes. Loss of data. Severe memory leak. label Oct 16, 2017
@LaurenWags
Copy link
Member

Reproduced on 0.19.93.

@bsclifton bsclifton added this to the Backlog (Prioritized) milestone Nov 22, 2017
@LaurenWags
Copy link
Member

@bsclifton
Copy link
Member Author

+1 from @jenn-rhim and also +1 from @disfit (still troubleshooting with them via #12122)

@bsclifton
Copy link
Member Author

Here are some steps I can easily reproduce the problem

  1. Clean profile
  2. Launch Brave in staging
LEDGER_ENVIRONMENT=staging npm run start
  1. Enable payments
  2. Go to advanced (gear icon), restore, and then use the following words:
straightest cooker ringer beslime larch earthliest carabineer necrophilism hexed jerusalem sherry tart stratospheric casuistical damson cooeyed
  1. Quit Brave
  2. Relaunch (same as step 2)
  3. Go to advanced (gear icon), backup, and then notice it shows "a"

@NejcZdovc
Copy link
Contributor

@bsclifton thx for the steps, taking a look now

@srirambv
Copy link
Collaborator

srirambv commented Dec 7, 2017

This is reproducible on 0.19.48 and all hotfix release.

@NejcZdovc NejcZdovc modified the milestones: 0.19.x Hotfix 7 (Release channel), 0.19.x + C63 (Release Channel) Dec 7, 2017
@NejcZdovc NejcZdovc self-assigned this Dec 7, 2017
@bsclifton
Copy link
Member Author

Moving to 0.19.x hotfix 12

@bsclifton bsclifton reopened this Jan 9, 2018
@bsclifton bsclifton modified the milestones: 0.20.x (Beta Channel), 0.19.x Hotfix 12 Jan 9, 2018
bsclifton added a commit that referenced this issue Jan 9, 2018
Fixes use case where passphrase is empty
@bsclifton
Copy link
Member Author

Fixed in 0.19.x with 395e12b

@srirambv
Copy link
Collaborator

Verified the steps mentioned in test plan. Repeated step 6, 10-12 times in quick succession and was still able to get the backup code. 👍

@jenn-rhim
Copy link

this is still happening to me. i'm on vs. 0.19.134.

@jenn-rhim
Copy link

sorry, scratch the above comment. @LaurenWags just pinged me that i should restore my wallet key first and see if the key sticks. it looks like it's sticking. i'll keep an eye on it. thanks @LaurenWags!

@LaurenWags
Copy link
Member

thanks @jenn-rhim 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.