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

Not getting change back in Wallet[Bug] #10795

Closed MojoWhaleCom closed 2 years ago

MojoWhaleCom commented 2 years ago

What happened?

Sending out Chia and CATs using RPC, the wallet does not read the change coming back. The wallet restart fixes that.

initial_number_of_public_keys is already set to 5000

Version

1.3.1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

$ chia wallet show
Wallet height: 1710933
Sync status: Synced
Balances, fingerprint: 970918524
Wallet ID 1 type STANDARD_WALLET Chia Wallet
   -Total Balance: 0.002999944311 xch (2999944311 mojo)
   -Pending Total Balance: 0.002999943309 xch (2999943309 mojo)
   -Spendable: 0.002744944627 xch (2744944627 mojo)
Wallet ID 2 type CAT CAT 7f3584af7b574030...
   -Total Balance: 20060.5  (20060500 mojo)
   -Pending Total Balance: 20060.5  (20060500 mojo)
   -Spendable: 20060.5  (20060500 mojo)
Wallet ID 3 type CAT CAT 9490a2040e33d437...
   -Total Balance: 9915.5  (9915500 mojo)
   -Pending Total Balance: 9915.5  (9915500 mojo)
   -Spendable: 9915.5  (9915500 mojo)
Wallet ID 4 type CAT CAT b7c0b9c3a59898a8...
   -Total Balance: 9249.0  (9249000 mojo)
   -Pending Total Balance: 9249.0  (9249000 mojo)
   -Spendable: 9249.0  (9249000 mojo)
Wallet ID 5 type CAT CAT a6a3dbc8ecacdbe3...
   -Total Balance: 1738.0  (1738000 mojo)
   -Pending Total Balance: 1738.0  (1738000 mojo)
   -Spendable: 1738.0  (1738000 mojo)
Wallet ID 6 type CAT CAT eb2e03fc437f3582...
   -Total Balance: 2309260.0  (2309260000 mojo)
   -Pending Total Balance: 2309260.0  (2309260000 mojo)
   -Spendable: 2309260.0  (2309260000 mojo)

Connections:
Type      IP                                     Ports       NodeID      Last Connect      MiB Up|Dwn
FULL_NODE 127.0.0.1                               8444/8444  b1afd186... Mar 18 10:35:46     10.4|18.3
                                                 -Height: No Info    -Hash: No Info    -Trusted: True
(venv) xxx@vmi:~/.chia/mainnet/wallet/db$ chia stop wallet
chia_wallet: Stopped
(venv) xxx@vmi:~/.chia/mainnet/wallet/db$ chia start wallet
chia_wallet: started
(venv) xxx@vmi:~/.chia/mainnet/wallet/db$ chia wallet show
Wallet height: 1710991
Sync status: Synced
Balances, fingerprint: 970918524
Wallet ID 1 type STANDARD_WALLET Chia Wallet
   -Total Balance: 0.013611925045 xch (13611925045 mojo)
   -Pending Total Balance: 0.013611925045 xch (13611925045 mojo)
   -Spendable: 0.013611925045 xch (13611925045 mojo)
Wallet ID 2 type CAT CAT 7f3584af7b574030...
   -Total Balance: 21015.5  (21015500 mojo)
   -Pending Total Balance: 21015.5  (21015500 mojo)
   -Spendable: 21015.5  (21015500 mojo)
Wallet ID 3 type CAT CAT 9490a2040e33d437...
   -Total Balance: 9915.5  (9915500 mojo)
   -Pending Total Balance: 9915.5  (9915500 mojo)
   -Spendable: 9915.5  (9915500 mojo)
Wallet ID 4 type CAT CAT b7c0b9c3a59898a8...
   -Total Balance: 9249.0  (9249000 mojo)
   -Pending Total Balance: 9249.0  (9249000 mojo)
   -Spendable: 9249.0  (9249000 mojo)
Wallet ID 5 type CAT CAT a6a3dbc8ecacdbe3...
   -Total Balance: 1738.0  (1738000 mojo)
   -Pending Total Balance: 1738.0  (1738000 mojo)
   -Spendable: 1738.0  (1738000 mojo)
Wallet ID 6 type CAT CAT eb2e03fc437f3582...
   -Total Balance: 2309260.0  (2309260000 mojo)
   -Pending Total Balance: 2309260.0  (2309260000 mojo)
   -Spendable: 2309260.0  (2309260000 mojo)

Connections:
Type      IP                                     Ports       NodeID      Last Connect      MiB Up|Dwn
FULL_NODE 127.0.0.1                               8444/8444  b1afd186... Mar 18 10:53:10     10.4|14.0
                                                 -Height: No Info    -Hash: No Info    -Trusted: True
loppefaaret commented 2 years ago

You guys are running a faucet correct ? can i just ask how much transaction volume you are putting through it before you start seeing problems ?

MojoWhaleCom commented 2 years ago

I just checked our logs. Our faucet was doing 177 tx per day on average before switching to 1.3 and than 1.3.1 and adding cats. Than from March 10 to 17 there are 1377 claims in total, but first we added our own token, than others, totaling 5 CATS. So in 7 days there were around 5000 total transactions, XCH and CATs included.

MojoWhaleCom commented 2 years ago

I reinstalled the server (Ubuntu 20.04), installed fresh Chia 1.3.1 (thought there might be some conflicts in upgrading from 1.2.11 to 1.3. and than 1.3.1), set initial number of public keys to 5000, set cat discovery to true, imported mnemonics, run the node & wallet. It synced, showing correct amount of XCH, incorrect balance of CAT ID2 (less than should be) and 0 for all the other CATs, although there are plenty.

The problem seems to be with not reading all the addresses of the wallet? Could it be?

Thank you so much!

github-actions[bot] commented 2 years ago

This issue has not been updated in 14 days and is now flagged as stale. If this issue is still affecting you and in need of further review, please comment on it with an update to keep it from auto closing in 7 days.

MojoWhaleCom commented 2 years ago

Still active

emlowe commented 2 years ago

If you are comfortable with sqlite3, I wouldn't mind seeing the output of SELECT MAX(derivation_index) FROM derivation_paths; on the wallet DB

There is a setting on the node called max_subscribe_items - which is the max number of addresses + coins the node will allow the wallet to subscribe to, By default is it set to 200000 - which is a pretty big number. But you could try changing that on your local node in config.yaml under full_node:

MojoWhaleCom commented 2 years ago

Thank you for your reply.

This is what I get: [MAX(derivation_index)] => 32888

MojoWhaleCom commented 2 years ago

This could also be because issues #10815 and #10914 delete_unconfirmed_transactions seems to solve it in 1.3.4, I will investigate further

github-actions[bot] commented 2 years ago

This issue has not been updated in 14 days and is now flagged as stale. If this issue is still affecting you and in need of further review, please comment on it with an update to keep it from auto closing in 7 days.

github-actions[bot] commented 2 years ago

This issue was automatically closed because it has been flagged as stale, and subsequently passed 7 days with no further activity from the submitter or watchers.