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

Wallet syncing in an infinity loop [[Bug] #13321

Closed gonner22 closed 2 years ago

gonner22 commented 2 years ago

What happened?

Hi,

My wallet has over 6k NFTs, and suddenly it's not able to get synced. I'm getting always: "ERROR Error adding states" and my it tries to "perform_atomic_rollback" without success in an infinity loop...

I tried deleting my db and differents PCs with fresh installation, but the issue remain the same on every system.

Now, I'm not able to mint new NFTs or at least transfer my did because never get synced.

Version

1.5.1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

2022-08-31T18:18:39.971 wallet chia.wallet.wallet_state_manager: INFO     Setting tx_id: 02a9c0cf3d2d97532f8f48029d73a819c0dcee8b085fc1904f21cbbb95b0a7ba to confirmed
2022-08-31T18:18:39.988 wallet DID did:chia:13q0lkt30jysru9078xplncw2x8xm8m3kjsxgk2fdt3w7fa05aymqzqn86a: INFO     DID wallet has been notified that coin was added: b'\x0e-5_\x15f\x9aq\xb47\xdb\x8dpoA\xa2\x9f\x15\xfc\xc5Nu/\xb8\xb5\x85\xccL"&o\xdd':Coin { parent_coin_info: 4ffd9924bec8d58b2236e48482253bc2ac35952cfb364883a27e33bc13e3d024, puzzle_hash: 913064fff26074f8400b70c1fb8a22bdb99c20709e8874b64679d55734b76e74, amount: 1000000 }
2022-08-31T18:18:40.493 wallet DID did:chia:13q0lkt30jysru9078xplncw2x8xm8m3kjsxgk2fdt3w7fa05aymqzqn86a: INFO     Adding parent b'\x0e-5_\x15f\x9aq\xb47\xdb\x8dpoA\xa2\x9f\x15\xfc\xc5Nu/\xb8\xb5\x85\xccL"&o\xdd': {'amount': 1000000,
 'inner_puzzle_hash': '0x5b6d7e41c46099b3bff4d0bfa40f385ff46653f6f7692be7890baf6ca7128db2',
 'parent_name': '0x4ffd9924bec8d58b2236e48482253bc2ac35952cfb364883a27e33bc13e3d024'}
2022-08-31T18:18:41.002 wallet chia.wallet.wallet_node    : ERROR    Error adding states..  Traceback (most recent call last):
  File "chia/wallet/wallet_node.py", line 791, in receive_state_from_peer
  File "chia/wallet/wallet_state_manager.py", line 934, in new_coin_state
  File "chia/wallet/wallet_state_manager.py", line 1330, in coin_added
  File "chia/wallet/did_wallet/did_wallet.py", line 386, in coin_added
AssertionError

2022-08-31T18:18:42.223 wallet chia.wallet.wallet_blockchain: INFO     Peak set to: 2479065 timestamp: 1661983771
2022-08-31T18:18:42.225 wallet chia.wallet.wallet_node    : INFO     Starting sync trusted: True to peer 192.168.21.123
2022-08-31T18:18:42.226 wallet chia.wallet.wallet_node    : INFO     perform_atomic_rollback to 2467068
mariano54 commented 2 years ago

Can you provide a log (debug.log file) and sent it to me privately on keybase (sorgente711) or to trepca. @trepca

mariano54 commented 2 years ago

you might be hitting some rate limits on request_puzzle_solution locally and timing out..

gonner22 commented 2 years ago

Can you provide a log (debug.log file) and sent it to me privately on keybase (sorgente711) or to trepca. @trepca

You can check your keybase....

trepca commented 2 years ago

@gonner22 thanks, while we're investigating this further, can you try the latest dev build here: https://www.chia.net/download/ (scroll down to "Latest Dev" header) we've added a lot of improvements to the wallet to handle larger volume of NFTs

gonner22 commented 2 years ago

@gonner22 thanks, while we're investigating this further, can you try the latest dev build here: https://www.chia.net/download/ (scroll down to "Latest Dev" header) we've added a lot of improvements to the wallet to handle larger volume of NFTs

Thanks for your reply. Is there a way to update my CLI using this method?

cd chia-blockchain . ./activate chia stop -d all deactivate git fetch git checkout latest git reset --hard FETCH_HEAD --recurse-submodules git status sh install.sh

Is there a development branch??

trepca commented 2 years ago

Yes, development branch is main. Replace git checkout latest with git checkout main.

gonner22 commented 2 years ago

I tested the latest dev header, as you can see here:

git log -1 commit 8db1943cde59fc99fe9dd2a2266b652a9efb4bbc (HEAD -> main, origin/main, origin/HEAD) Author: Kyle Altendorf sda@fstab.net Date: Wed Sep 7 23:46:20 2022 -0400

fix datalayer upsert test flakes (#13353) (#13372)

(cherry picked from commit 9b9868d3ef1f015d13b2a3efd48ec8f64b3441b7)

I have the same issue, my wallet continues in an infinity loop of syncing, but now a new error is displayed on the logs: wallet chia.wallet.nft_wallet.nft_off_chain: ERROR Cannot get off-chain metadata of ...

If you have also a keybase user, I can send you the debug.log

gonner22 commented 2 years ago

For those having issues with the wallet 1.5.1 stuck with thousands NFTs, Chia just solved the issue. The new commit is now here quex.new_coin_state_exceptions and you can use it following this upgrade procedure:

cd chia-blockchain . ./activate chia stop -d all deactivate git fetch git checkout quex.new_coin_state_exceptions git reset --hard FETCH_HEAD --recurse-submodules git status sh install.sh

It will be available soon on the development branch and for the latest branch will take some time

thanks @mariano54 and @trepca