IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.06k stars 720 forks source link

[BUG] - Invalid UTF-8 stream with special assets #3272

Closed 1000101 closed 2 years ago

1000101 commented 3 years ago

Internal/External External

Area Native Tokens Related to Native Tokens (Mary).

Summary cadano-cli crashes on addresses with assets which asset names seems to be already hex encoded.

Steps to reproduce Steps to reproduce the behavior:

  1. Query
    
    cardano-cli query utxo --mainnet --address addr1qyx4z4asr5qrpwelnqyrqke5g4de85rhrnayhaxpny4jzezsjmxvt760mc9p974xgr3qdt6z6rycxj077zev9ptdlzxsw2n0pd
                           TxHash                                 TxIx        Amount
    --------------------------------------------------------------------------------------

cardano-cli: Cannot decode byte '\xda': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream


**Expected behavior**
Return UTxOs

**System info (please complete the following information):**
- OS Name: NixOS
- OS Version: 21.05
- Node version: ```1.30.1```
- CLI version: ```1.30.1```

**Additional context**
This issue seems to be related to a specific subset of assets with name that seems to be already `hex`.
For example:
https://explorer.cardano.org/en/transaction?id=7ffa840579680db30b5a8b4aa25642198bf02fb63e265c9021ee48f17392f33d

Policy ID: e2bdb31c13a57d94934d01a4ca17cf3b2cac61d055637261b089c8f6 Asset Name: dada



Several others (same policy ID): `1010`, `def1` and also includes all time favourites, such as `1337`, `cafe` and many, many more!

I'm not sure if the assets were incorrectly minted or they're being incorrectly handled by the node (and they might also get incorrectly inserted into [db-sync)](https://github.com/input-output-hk/cardano-db-sync/) that's why I wanted to have a look through `cardano-cli`.

Might be related to https://github.com/input-output-hk/cardano-node/pull/3211
1000101 commented 2 years ago

Here's the output from cardano-cli query ledger-state --mainnet

                    "7ffa840579680db30b5a8b4aa25642198bf02fb63e265c9021ee48f17392f33d#1": {
                        "address": "010d5157b01d0030bb3f9808305b34455b93d0771cfa4bf4c1992b21645096ccc5fb4fde0a12faa640e206af42d0c98349fef0b2c2856df88d",
                        "datahash": null,
                        "value": {
                            "policies": {
                                "e2bdb31c13a57d94934d01a4ca17cf3b2cac61d055637261b089c8f6": {
                                    "dada": 1
                                }
                            },
                            "lovelace": 1444443
                        }
                    },
gitmachtl commented 2 years ago

this will be addresses via https://github.com/input-output-hk/cardano-node/pull/3211

mmahut commented 2 years ago

Can this be closed now?

1000101 commented 2 years ago

Seems to be working for some time now.

cardano-cli query utxo --mainnet --address addr1q9teum39ps976g6qxnk4e8ennhqszc7lkf44m7qy90f9vlc65uu3mvxjfd795z9tzknj2ugwndyhj8xq87uw2g3lszksae4a9m
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
7b2b43010f8bc4f719149ba074693cc28453d7005670023d96fd0d61ad679c6b     0        5000000 lovelace + TxOutDatumNone
7b2b43010f8bc4f719149ba074693cc28453d7005670023d96fd0d61ad679c6b     2        1420791 lovelace + TxOutDatumNone
9fdfd54b130dc13a19d41d4f8113275937d4d56cfce4cbc05519e7e32a78b764     1        86629705 lovelace + 5555555555 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 + 147854547 29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e + 1850479379 2b8822f7799f325e278991a244e7715591945b1c2a3589cc76035ca9.73637261746368 + 100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 + 518134226 4c17b7009448a33d1834b0946ea752ecd0cc61c7bb25cd9ff18cff58.426c6f6f6d + 1542066149 5ad8deb64bfec21ad2d96e1270b5873d0c4d0f231b928b4c39eb2435.61646f736961 + 185047937 682fe60c9918842b3323c43b5144bc3d52a23bd2fb81345560d73f63.4e45574d + 103 d894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0.7370616365636f696e73 + 1 e2bdb31c13a57d94934d01a4ca17cf3b2cac61d055637261b089c8f6.dada + TxOutDatumNone
a4fb13a33fba6f3a35da990421464d11024122b2cee9e0f1d09dd7d464d1a712     2        4511964 lovelace + TxOutDatumNone