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] Making offer with CAT occasionally eliminates spendable balance until offer is accepted or cancelled #18418

Closed chia-rschmidt closed 3 months ago

chia-rschmidt commented 3 months ago

What happened?

Making offer with a small amount of CAT occasionally reduces spendable balance to 0 or 1 until offer is accepted or cancelled. This did not happen with every offer but sometimes happened with TXCH as well when sending it or including a fee.

TC-November TC-November2

Version

2.4.3-rc1

What platform are you using?

Linux

What ui mode are you using?

GUI

Relevant log output

2024-08-06T22:06:50.395 full_node full_node_server        : WARNING  Banning 65.109.30.123 for 10 seconds
2024-08-06T22:06:50.397 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('65.109.30.123'), _port=58444). Maybe the peer is running old software.
2024-08-06T22:15:22.512 full_node full_node_server        : WARNING  Banning 222.128.30.73 for 10 seconds
2024-08-06T22:15:22.513 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('222.128.30.73'), _port=8888). Maybe the peer is running old software.
2024-08-06T22:35:09.396 full_node full_node_server        : WARNING  Cannot write to closing transport 75.70.34.135
2024-08-06T22:43:49.218 full_node full_node_server        : WARNING  Banning 65.109.30.123 for 10 seconds
2024-08-06T22:43:49.219 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('65.109.30.123'), _port=58444). Maybe the peer is running old software.
2024-08-06T22:48:18.192 full_node asyncio                 : ERROR    Future exception was never retrieved
future: <Future finished exception=ConnectionError('Connection lost')>
Traceback (most recent call last):
  File "asyncio/selector_events.py", line 949, in _write_ready
BrokenPipeError: [Errno 32] Broken pipe

The above exception was the direct cause of the following exception:

ConnectionError: Connection lost
2024-08-06T22:48:57.632 full_node chia.full_node.mempool_manager: WARNING  updating the mempool using the slow-path. peak: 55a02626eabfae0c651d805e6f2682088ef1797e56049f28cc8719eb96f4ef3b new-peak-prev: 52dc4aab9972fa6150d6f556c61a5acd910552b4623fa84171cb92bfc5041c94 coins: not set
2024-08-06T22:48:59.478 wallet wallet_server              : WARNING  Connection failed to wss://104.248.202.108:58444/ws. Error: 403, message='Invalid response status', url=URL('wss://104.248.202.108:58444/ws')
2024-08-06T22:49:25.167 full_node full_node_server        : WARNING  Banning 65.21.193.9 for 10 seconds
2024-08-06T22:49:25.167 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('65.21.193.9'), _port=58444). Maybe the peer is running old software.
2024-08-06T22:50:21.203 wallet chia.wallet.wallet_node    : WARNING  querying DNS introducer failed: All nameservers failed to answer the query dns-introducer-testnet11.chia.net. IN A: Server Do53:127.0.0.53@53 answered SERVFAIL
2024-08-06T22:58:49.450 wallet chia.wallet.wallet_state_manager: ERROR    set_sync_mode failed - range: 1158838-1158838, seconds: 0.007984161376953125
Traceback (most recent call last):
  File "chia/wallet/wallet_state_manager.py", line 674, in set_sync_mode
  File "chia/wallet/wallet_node.py", line 1235, in long_sync_from_untrusted
  File "chia/wallet/wallet_node.py", line 847, in long_sync
  File "chia/wallet/util/wallet_sync_utils.py", line 61, in subscribe_to_phs
ValueError: None response from peer 47.197.8.197 for register_interest_in_puzzle_hash
2024-08-06T23:15:50.299 full_node chia.full_node.mempool_manager: WARNING  updating the mempool using the slow-path. peak: ed3e35963da7e57e1b53b4e4ddb0defc772309fbdc64553520874157113642a4 new-peak-prev: b8d22d3e3d79e471c78eb5f9b8fc1976acadc4eb1ae57f0cf9f8de6fa78b8b92 coins: not set
2024-08-06T23:16:08.467 full_node full_node_server        : WARNING  Banning 75.46.142.121 for 10 seconds
2024-08-06T23:16:08.467 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('75.46.142.121'), _port=28744). Maybe the peer is running old software.
2024-08-06T23:19:19.979 wallet chia.wallet.wallet_node    : WARNING  SpendBundle has been rejected by the FullNode. {'error': 'NO_TRANSACTIONS_WHILE_SYNCING',
 'status': 3,
 'txid': '0x744b2d8e85257b3f683454c4b6d9f7999d3871e5767446ae9660612af0a1eb74'}
2024-08-06T23:19:19.999 wallet chia.wallet.wallet         : WARNING  TransactionRecord SpendBundle ID: b'tK-\x8e\x85%{?h4T\xc4\xb6\xd9\xf7\x99\x9d8q\xe5vtF\xae\x96`a*\xf0\xa1\xebt' not in mempool. (peer, included, error) list: [('84ac7c2a74192e5ad490b18d81ac2f594b66bc2d90e35e332502900b451026fc', 3, 'NO_TRANSACTIONS_WHILE_SYNCING')]
2024-08-06T23:19:25.583 wallet chia.wallet.wallet_node    : WARNING  SpendBundle has been rejected by the FullNode. {'error': 'NO_TRANSACTIONS_WHILE_SYNCING',
 'status': 3,
 'txid': '0x744b2d8e85257b3f683454c4b6d9f7999d3871e5767446ae9660612af0a1eb74'}
2024-08-06T23:19:25.585 wallet chia.wallet.wallet_node    : WARNING  SpendBundle has been rejected by the FullNode. {'error': 'NO_TRANSACTIONS_WHILE_SYNCING',
 'status': 3,
 'txid': '0xa1d4ab85e85b2fa22fdcec270b1af839ff2a1de2de85c8242a36074b747a5b5f'}
2024-08-06T23:19:25.607 wallet chia.wallet.wallet         : WARNING  TransactionRecord SpendBundle ID: b"\xa1\xd4\xab\x85\xe8[/\xa2/\xdc\xec'\x0b\x1a\xf89\xff*\x1d\xe2\xde\x85\xc8$*6\x07Ktz[_" not in mempool. (peer, included, error) list: [('84ac7c2a74192e5ad490b18d81ac2f594b66bc2d90e35e332502900b451026fc', 3, 'NO_TRANSACTIONS_WHILE_SYNCING')]
2024-08-06T23:19:39.318 full_node full_node_server        : WARNING  Banning 222.128.30.73 for 10 seconds
2024-08-06T23:19:39.318 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('222.128.30.73'), _port=8888). Maybe the peer is running old software.
2024-08-06T23:20:01.941 full_node chia.full_node.mempool_manager: WARNING  updating the mempool using the slow-path. peak: 8023c8e85e1dc56caa9bd236496bbef5658ac77e870a7c667fb061bf817e52fa new-peak-prev: b38d2fbb035344ca3551e5207446969ba85248e572a6e17156211b3dbdc635fc coins: set
2024-08-06T23:20:05.286 full_node chia.full_node.mempool_manager: WARNING  updating the mempool using the slow-path. peak: a3eb3a796ba67e296b1016fc0fca2aab0fc6e87ea46f438e4f950b32cf7171f1 new-peak-prev: d139d0036b79ee14a0ec30352cdec5e5fe4244b1cd37bbc7ba981b6a4fd6eb7b coins: set
2024-08-06T23:20:06.936 full_node chia.full_node.mempool_manager: WARNING  updating the mempool using the slow-path. peak: 17395685af263fe2468574156807d04325de93440c98a3d90775178e39fe9b85 new-peak-prev: ca2407e7cfecc9cc14212ec453359176122a88ae6f02472aa1965645ad6992f4 coins: set
2024-08-06T23:21:36.266 full_node full_node_server        : WARNING  Banning 65.21.193.9 for 10 seconds
2024-08-06T23:21:36.266 full_node full_node_server        : WARNING  Invalid handshake with peer PeerInfo(_ip=IPv4Address('65.21.193.9'), _port=58444). Maybe the peer is running old software.
BrandtH22 commented 3 months ago

Hey @chia-rschmidt , this is expected and is due to how the coinset model works.

The coinset model can be thought of similarly to cash in your wallet. For example say you only have a $5 bill but you want to by a gumball for $1. You personally cannot split your $5 bill into 5 $1s so you instead go the bank and get change.

With offer files applied to this concept, even though you are only spending $1 you have to lock the entire $5 bill into the offer file until it is fulfilled. To circumvent locking up of all funds you can first "fragment" your funds by either sending $1 to yourself (effectively creating a $1 bill and a $4 bill) or you can use the cli commands for coin splitting which would likely create 5 $1 bills.

Let us know if any questions arise but since this is expected with the coinset model I am closing this ticket for the time being.