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

Wallet info can be lost during upgrade in very specific edge case #11494

Closed
bsclifton opened this issue Oct 12, 2017 · 0 comments
Closed

Wallet info can be lost during upgrade in very specific edge case #11494

bsclifton opened this issue Oct 12, 2017 · 0 comments

Comments

@bsclifton
Copy link
Member

bsclifton commented Oct 12, 2017

Test plan

  1. Have a v1 wallet (created with 0.18.36 or earlier)
  2. Upgrade to new version of Brave
  3. When launching Brave, you'd need to exit after sync is called but before transition finishes
    • once you see the overlay, quit out. Doesn't have to be immediate, you can probably quit out 5 - 10 seconds after seeing it.
  4. View that the ledger-newstate.json file exists in your profile directory (ex: ~/Libraries/Application Support/brave-folder-here/ledger-newstate.json. It should contain key/pair values (an array of numbers)
  5. re-launch Brave and go back to about:preferences#payments
  6. Verify transition completes
  7. Verify that the ledger-newstate.json file is no longer in your profile directory (ex: ~/Libraries/Application Support/brave-folder-here/ledger-newstate.json

Description

The keypair used by the client isn't generated until after the first call to ledgerClient.sync. We persist before sync and don't ever re-persist

Steps to Reproduce

  1. Have a v1 wallet (created with 0.18.36 or earlier)
  2. Upgrade to new version of Brave
  3. When launching Brave, you'd need to exit after sync is called but before transition finishes
    • once you see the overlay, quit out
    • re-launch Brave and go back to about:preferences#payments

Actual result:
Upgrade can potentially cause loss of funds (if upgrade finishes, nothing receives the new wallet details)

Expected result:
Wallet details should be persisted so that a reload of Brave is safe and doesn't trigger another transition

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

Brave Version

about:brave info:

Brave: 0.19.48
rev: de939f6
Muon: 4.4.28
libchromiumcontent: 61.0.3163.100
V8: 6.1.534.41
Node.js: 7.9.0
Update Channel: Release
OS Platform: macOS
OS Release: 16.7.0
OS Architecture: x64

Reproducible on current live release:
yes

Additional Information

@bsclifton bsclifton added the priority/P2 Crashes. Loss of data. Severe memory leak. label Oct 12, 2017
@bsclifton bsclifton added this to the 0.19.x Release 2 (Beta Channel) milestone Oct 12, 2017
bsclifton added a commit that referenced this issue Oct 12, 2017
- client is now persisted after sync
- file is now cleaned up after transition is complete (when new ledger file is being written)

Fixes #11494

Auditors: @evq
bsclifton added a commit that referenced this issue Oct 12, 2017
- client is now persisted after sync
- file is now cleaned up after transition is complete (when new ledger file is being written)

Fixes #11494

Auditors: @evq
syuan100 pushed a commit to syuan100/browser-laptop that referenced this issue Nov 9, 2017
- client is now persisted after sync
- file is now cleaned up after transition is complete (when new ledger file is being written)

Fixes brave#11494

Auditors: @evq
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants