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

'grin wallet reconcile' process #2242

Closed
yeastplume opened this issue Dec 27, 2018 · 1 comment
Closed

'grin wallet reconcile' process #2242

yeastplume opened this issue Dec 27, 2018 · 1 comment

Comments

@yeastplume
Copy link
Member

yeastplume commented Dec 27, 2018

I think we need more belts and suspenders around the wallet, and I'm starting to think that in the short term we could very well do with a wallet reconcile command. It would work similarly to the restore process, but instead of blowing up the wallet and restoring all outputs from scratch, it could run the same process against the UTXO set to check and repair wallet outputs (and the tx log as best it can) without requiring the user to re-init a wallet.

Roughly, it would:

  1. Request the user not have any outstanding transactions
  2. run the usual output update, and mark all missing confirmed outputs as 'spent' as usual.
  3. Run the part of the restore process that identifies the user's outputs (the last position scanned can be stored to make this an incremental process, if needed)
  4. Use the UTXO output set to restore any missing outputs, unlock any outputs that are locked but still in the UTXO set, and mark any 'Spent' outputs that aren't spent as 'Confirmed'
  5. Attempt to clear up the transaction log as well as possible

Depending on how this useful this becomes, this check process could later be extended to work in tandem with wallet output summing (as suggested in #1481) and potentially become something that's run regularly as part of normal wallet operations. Creating a stable wallet may potentially turn out to be far less challenging if we allow ourselves to rely on the chain state for more information than we currently do.

However, this does add more dependence on our rangeproof storage, which also may not be desirable. It also may paper over some root issues that should and will still need to be addressed. However, given the time available to launch and the number of potential conditions that can result in a warped wallet state (which aren't all necessarily rooted in the wallet itself), I think having at least a manual version of this process will be of great use, even if it turns out to be temporary.

@0xmichalis
Copy link
Contributor

Request the user not have any outstanding transactions

How can a user verify this when the wallet has already broken? How can I verify that my transaction is still outstanding when after I finalize it, I have no output and no tx log in my wallet? Well, to be fair I had the change output as part of my tx log and I could see whether it was included in a block but that's super poor UX.

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