[BUG] Unable to claim SELF_POOLING rewards if coins are sent with diff puzzle hash
See original GitHub issueI am solo farming, but I wanted to go ahead and start making pool-compatible plots. I made a plotnft, and started making plots (madmax) using the contract address from chia plotnft show
.
Rather than wait weeks (months?) to win a block SELF_POOLING, only to find that I have no idea how to retrieve it, I decided to send some mojo to my plotnft wallet via a faucet, and test out the chia plotnft claim
process.
See transactions here: https://www.chiaexplorer.com/blockchain/address/xch1wt3gthn43yy52d635ke7nv2rmcm048c3lntkxx27y70sqy5rz62qf8qmj3
chia plotnft show
Wallet height: 562287 Sync status: Synced Wallet id 2: Current state: SELF_POOLING Current state from block height: 547731 Launcher ID: REDACTED Target address (not for plotting): BLAH Owner public key: BLAH P2 singleton address (pool contract address for plotting): xch1wt3gthn43yy52d635ke7nv2rmcm048c3lntkxx27y70sqy5rz62qf8qmj3 Claimable balance: 6.00212e-07 xch (600212 mojo)
Attempting to do a claim on this presents me with an error:
chia plotnft claim -i 2
Will claim rewards for wallet ID: 2. Error performing operation on Plot NFT -f <blahblah> wallet id: 2: {‘error’: “{‘amount’: 500000,\n ‘parent_coin_info’: ‘0xb9<blahblah>’,\n ‘puzzle_hash’: ‘0x72<blahblah>’}”, ‘success’: False}
from debug.log:
2021-07-12T16:20:44.685 wallet chia.rpc.rpc_server : WARNING Error while handling message: Traceback (most recent call last): File “<BLAH>/chia-blockchain/chia/rpc/rpc_server.py”, line 81, in inner res_object = await f(request_data) File “<BLAH>/chia-blockchain/chia/rpc/wallet_rpc_api.py”, line 1227, in pw_absorb_rewards transaction: TransactionRecord = await wallet.claim_pool_rewards(fee) File “<BLAH>/chia-blockchain/chia/pools/pool_wallet.py”, line 761, in claim_pool_rewards coin_to_height_farmed[coin_record.coin] KeyError: Coin(parent_coin_info=<bytes32: 2e9f-BLAH->, puzzle_hash=<bytes32: 72e2-BLAH->, amount=100
Hat tip to @cameroncooper for this:
It appears that the coin sent via faucet the uses a different puzzle than claim is using to spend pool rewards. Starting here: https://github.com/Chia-Network/chia-blockchain/blob/efd401ee35cff76c7fc4d6779c68f72f24fc0217/chia/cmds/plotnft_funcs.py#L330 calls absorb rewards: https://github.com/Chia-Network/chia-blockchain/blob/efd401ee35cff76c7fc4d6779c68f72f24fc0217/chia/rpc/wallet_rpc_api.py#L1217 tries to create a transaction: https://github.com/Chia-Network/chia-blockchain/blob/efd401ee35cff76c7fc4d6779c68f72f24fc0217/chia/pools/pool_wallet.py#L724 and here’s the money shot: https://github.com/Chia-Network/chia-blockchain/blob/efd401ee35cff76c7fc4d6779c68f72f24fc0217/chia/pools/pool_puzzles.py#L219
This behavior seems to be the same as https://github.com/Chia-Network/chia-blockchain/issues/7299
If the ability to anonymously send funds from a faucet to a plotnft contract address results in a corrupted pool wallet, I only request that we please nickname this problem #dripgate
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Thanks for this interesting bug report. This doesn’t create any permanent corruption of the pool wallet. Chia sent directly to the P2 address are not claimable and ideally shouldn’t be shown in the wallet at all. In testing with testnet, the current wallet code will return an error if you have “real” claimable rewards in your pool wallet in this case where you have a mix of claimable and non-claimable (T)XCH. However, this will be fixed in a future release of the wallet such that all truly claimable rewards are claimable while ignoring any other chia in the pooling wallet. Note we plan to make some further fixes to make it harder to get into this state (eg, we will prevent you from sending chia to your own P2 address).
This issue as written was resolved in version 1.2.3