Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.82k stars 2.03k forks source link

[Bug] 1.3 beta wallet: incorrect balances, broken DB migration paths #10194

Closed ojura closed 2 years ago

ojura commented 2 years ago

What happened?

I tried out the 1.3 beta today on my full node/farmer setup. I observed the following issues:

Wallet DB migration from 1.2.11: very borked, only the standard Chia wallet recreated -- not even the standard CATs like Spacebucks or Stably. The Chia wallet had an incorrect balance (it showed the amount of only the last incoming transaction in my case as the entire balance). The pooling wallet was not recreated.

Wallet DB migration from light wallet beta: The pooling wallet was not recreated

The symptoms of the pooling wallet not being recreated (observed in both migration paths):

Mitigation which restored full functionality for me:

Version

1.3 beta

What platform are you using?

Linux

What ui mode are you using?

GUI/CLI

Relevant log output

No response

wallentx commented 2 years ago

I believe this is also what I experienced after a DB upgrade. I pool with chiahub.io, and I saw that my config.yaml pooling section did not have my pool url in place, and chia plotnft show showed that I was self pooling. @yan74 (much thanks :pray:) verified that they had my singleton in their db as a member.

Correcting the config.yaml caused the farmer and wallet to crash upon startup with the following:

  File "/home/william/chia-blockchain/chia/daemon/server.py", line 1280, in launch_service
    process = subprocess.Popen(
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chia_wallet'
2022-02-12T03:34:56.487 daemon chia.daemon.server         : INFO     chia daemon exiting in 5 seconds
2022-02-12T03:34:56.489 daemon chia.daemon.server         : INFO     Daemon WebSocketServer closed

Re-syncing my wallet now to see if I can get things back to a working state

wallentx commented 2 years ago

To follow up, I deleted the contents of the wallet db folder, and that let me start my farmer without the previously mentioned error log. Something still seems very strange, but I am sending partials back to the pool now.

ojura commented 2 years ago

noticed another one in the wild on Keybase image

edit: also another user on keybase confirmed clearing wallet db fixed their issues.

wallentx commented 2 years ago

I've tried for days to replicate the behavior that I was seeing initially, but have been unable to- https://github.com/Chia-Network/chia-blockchain/issues/10439. My issue was experienced with the first beta release, and I believe whatever may have caused it has likely since been fixed.

ojura commented 2 years ago

Yeah, I deleted my v1 wallet DB and cannot reproduce anymore.

I think I do however have a wallet DB from the light wallet beta times which is missing the plot NFT coin. If the light beta messed up and forgot to add the plotnft singleton coin to the wallet DB, is it a bug of 1.3 that it mistakenly believes that the wallet is "synced" to a certain height because the wallet DB says so?

Should we have a "sync from scratch" button in the UI if the user believes they're missing some coins?

paninaro commented 2 years ago

Since this report is fairly comprehensive, and several fixes have gone in relating to the points mentioned, I'm going to close this out. If specific issues persist, please feel free to open individual reports for those issues.