Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Failed to burn asset: Input does not contain requested asset #704

Closed
ffranr opened this issue Nov 28, 2023 · 8 comments
Closed

[bug]: Failed to burn asset: Input does not contain requested asset #704

ffranr opened this issue Nov 28, 2023 · 8 comments
Assignees
Labels
bug Something isn't working burning gRPC

Comments

@ffranr
Copy link
Contributor

ffranr commented Nov 28, 2023

Reported by @Liongrass

I seem to be unable to burn an asset:
[tapcli] unable to send assets: rpc error: code = Unknown desc = error funding burn: input commitment does not contain asset_id=f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914: send: Input does not contain requested asset
The asset is a grouped asset, but there exist 90 of them as part of the same asset id. It has 6+ confirmations since I last sent that asset

Command executed was:

tapcli assets burn --asset_id 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc --amount 90
@ffranr
Copy link
Contributor Author

ffranr commented Dec 11, 2023

I've attempted to reproduce this bug here: #732

I couldn't reproduce the bug in the simplest case. I've requested logs from @Liongrass .

@ffranr
Copy link
Contributor Author

ffranr commented Dec 11, 2023

@Liongrass you say that the asset you were trying to burn was part of a group. But the burning functionality is indifferent to that point. It acts on a single asset identified by it's "asset ID" and not on an asset group. Did asset ID 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc have an amount of 90 or was that the total for the whole group?

Also what sort of asset were you trying to burn? Normal or a collection?

@ffranr
Copy link
Contributor Author

ffranr commented Dec 11, 2023

Logs from Leon:

2023-12-11 16:56:07.235 [INF] FRTR: Identified 1 eligible asset inputs for send of 90 to 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc
2023-12-11 16:56:07.253 [INF] FRTR: Selected 1 asset inputs for send of 90 to 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc
2023-12-11 16:56:07.266 [ERR] RPCS: [/taprpc.TaprootAssets/BurnAsset]: error funding burn: input commitment does not contain asset_id=53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc: send: Input does not contain requested asset

@Liongrass
Copy link
Contributor

There are 100 assets of the (normal) asset ID 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc in circulation, all of them in my wallet. They have never been transferred. I'm attempting to burn 90 of them.

The other asset of the same group is ID f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914, I have 90 assets of that ID in my wallet, 10 have been transferred successfully elsewhere.
When trying to burn 90 of that asset I get the following error in the logs:

2023-12-11 18:15:59.899 [INF] FRTR: Identified 1 eligible asset inputs for send of 90 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-11 18:15:59.909 [INF] FRTR: Selected 1 asset inputs for send of 90 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-11 18:15:59.917 [ERR] RPCS: [/taprpc.TaprootAssets/BurnAsset]: error funding burn: input commitment does not contain asset_id=f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914: send: Input does not contain requested asset

Same if I'm only trying to burn 10:

2023-12-11 18:16:32.089 [INF] FRTR: Identified 1 eligible asset inputs for send of 10 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-11 18:16:32.104 [INF] FRTR: Selected 1 asset inputs for send of 10 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-11 18:16:32.120 [ERR] RPCS: [/taprpc.TaprootAssets/BurnAsset]: error funding burn: input commitment does not contain asset_id=f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914: send: Input does not contain requested asset

@ffranr
Copy link
Contributor Author

ffranr commented Dec 12, 2023

If I take these errors at face value, they indicate that our coin selector has selected anchored commitments which have associated tap commitments that do not include the target asset.

Leon has provided the tap db of the node which encountered this bug.

@ffranr
Copy link
Contributor Author

ffranr commented Dec 13, 2023

Here's my unsuccessful attempt at reproducing this bug with the db Leon provided: #736

@ffranr
Copy link
Contributor Author

ffranr commented Dec 13, 2023

Leon says his tapd node was running commit v0.3.2-beta.rc1.

@ffranr
Copy link
Contributor Author

ffranr commented Dec 13, 2023

I put up this branch: https://github.com/lightninglabs/taproot-assets/tree/burn-bug-extra-commitment-logging which is basically main + some additional logging.

Leon could correctly burn asset (ID) 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc and f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914 (10 units).

Here are the log output for 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc (90 units):

2023-12-13 18:14:09.923 [INF] RPCS: Burning asset (asset_id=53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc, group_key=035d7df7ef47226a8940bd800963957f1faf275079abe4654822344d04e8b98ea0, burn_amount=90)
2023-12-13 18:14:09.989 [INF] FRTR: Identified 1 eligible asset inputs for send of 90 to 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc
2023-12-13 18:14:10.010 [INF] FRTR: Selected 1 asset inputs for send of 90 to 53723837a882c2c3daf92c09406719055e0d1bf58b1c51e59672379ae4263bdc
2023-12-13 18:14:10.048 [INF] FRTR: New signed delivery request with 2 outputs
2023-12-13 18:14:10.049 [INF] FRTR: ChainPorter executing state: SendStateAnchorSign
2023-12-13 18:14:10.079 [INF] FRTR: sending with fee rate: 1012 sat/kb
2023-12-13 18:14:10.079 [INF] FRTR: Constructing new Taproot Asset commitments for send to: 0253e3941fae4203abbad792b838a545649d0147b31221109f951996fca1838288
2023-12-13 18:14:10.258 [INF] FRTR: Received funded PSBT packet
2023-12-13 18:14:10.259 [INF] FRTR: Adjusting send pkt by delta of 59 from 155 sats to 214 sats
2023-12-13 18:14:10.272 [INF] FRTR: PSBT absolute fee: 214 sats
2023-12-13 18:14:10.272 [INF] FRTR: ChainPorter executing state: SendStateLogCommit
2023-12-13 18:14:10.625 [INF] FRTR: Committing pending parcel to disk
2023-12-13 18:14:10.632 [INF] FRTR: ChainPorter executing state: SendStateBroadcast
2023-12-13 18:14:10.639 [INF] FRTR: Broadcasting new transfer tx, txid=b158dafc228cc8f2e8c6e169111abf03a6a50cdf58952863edc2b984a9578943
2023-12-13 18:14:10.847 [INF] FRTR: Outbound parcel with txid b158dafc228cc8f2e8c6e169111abf03a6a50cdf58952863edc2b984a9578943 now pending (num_inputs=1, num_outputs=2), delivering notification
2023-12-13 18:14:10.847 [INF] FRTR: ChainPorter executing state: SendStateWaitTxConf
2023-12-13 18:14:10.847 [INF] FRTR: Waiting for confirmation of transfer_txid=b158dafc228cc8f2e8c6e169111abf03a6a50cdf58952863edc2b984a9578943

Log outputs for asset ID f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914 (10 units):

2023-12-13 18:21:13.866 [INF] RPCS: Burning asset (asset_id=f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914, group_key=035d7df7ef47226a8940bd800963957f1faf275079abe4654822344d04e8b98ea0, burn_amount=10)
2023-12-13 18:21:13.936 [INF] FRTR: Identified 1 eligible asset inputs for send of 10 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-13 18:21:13.947 [INF] FRTR: Selected 1 asset inputs for send of 10 to f04c2820492d2cca4df053cbf83d93eb99e1bc34f51da6acbe8a85e3db5d5914
2023-12-13 18:21:13.977 [INF] FRTR: New signed delivery request with 2 outputs
2023-12-13 18:21:13.977 [INF] FRTR: ChainPorter executing state: SendStateAnchorSign
2023-12-13 18:21:13.986 [INF] FRTR: sending with fee rate: 1012 sat/kb
2023-12-13 18:21:13.986 [INF] FRTR: Constructing new Taproot Asset commitments for send to: 02dbbceca97ff18c16b60057d7a207da34724d23f2f745e81c42d3a9cfac964382
2023-12-13 18:21:14.167 [INF] FRTR: Received funded PSBT packet
2023-12-13 18:21:14.168 [INF] FRTR: Adjusting send pkt by delta of 59 from 155 sats to 214 sats
2023-12-13 18:21:14.174 [INF] FRTR: PSBT absolute fee: 214 sats
2023-12-13 18:21:14.175 [INF] FRTR: ChainPorter executing state: SendStateLogCommit
2023-12-13 18:21:14.517 [INF] FRTR: Committing pending parcel to disk
2023-12-13 18:21:14.521 [INF] FRTR: ChainPorter executing state: SendStateBroadcast
2023-12-13 18:21:14.525 [INF] FRTR: Broadcasting new transfer tx, txid=08e73b6c094ee7cbf714e5492a6deda5c0667742a7282202311c5586dbabf91a
2023-12-13 18:21:14.713 [INF] FRTR: Outbound parcel with txid 08e73b6c094ee7cbf714e5492a6deda5c0667742a7282202311c5586dbabf91a now pending (num_inputs=1, num_outputs=2), delivering notification
2023-12-13 18:21:14.713 [INF] FRTR: ChainPorter executing state: SendStateWaitTxConf
2023-12-13 18:21:14.713 [INF] FRTR: Waiting for confirmation of transfer_txid=08e73b6c094ee7cbf714e5492a6deda5c0667742a7282202311c5586dbabf91a

The bug is not reproducible in the latest commit on main. I'll stop investigating the bug at this point.

Thank you Leon for your help!

@ffranr ffranr closed this as completed Dec 13, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Taproot-Assets Project Board Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working burning gRPC
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants