hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
316 stars 138 forks source link

tokenGetAccountNftInfos is broken #2054

Closed bugbytesinc closed 3 years ago

bugbytesinc commented 3 years ago

Description

Getting NFT Infos is broken in previewnet, it does not return nft information

Steps to reproduce

create an NFT token Mint Some Tokens Try to get the info for the tokens

Additional context

Log snippit of failing integration test

    8/21/2021 2:10:27 PM  QX ASK → { "transactionGetRecord": { "header": { "payment": { }, "responseType": "COST_ANSWER" }, "transactionID": { "transactionValidStart": { "seconds": "1629555026", "nanos": 254869000 }, "accountID": { "accountNum": "1088" } } } }
    8/21/2021 2:10:27 PM  RX:(00)  { "transactionGetRecord": { "header": { "responseType": "COST_ANSWER", "cost": "8" } } }
    8/21/2021 2:10:27 PM  QX PYMT  { "transactionID": { "transactionValidStart": { "seconds": "1629555027", "nanos": 634507900 }, "accountID": { "accountNum": "1088" } }, "nodeAccountID": { "accountNum": "3" }, "transactionFee": "6000000000", "transactionValidDuration": { "seconds": "120" }, "cryptoTransfer": { "transfers": { "accountAmounts": [ { "accountID": { "accountNum": "1088" }, "amount": "-8" }, { "accountID": { "accountNum": "3" }, "amount": "8" } ] } } }
    8/21/2021 2:10:27 PM  ├─ SIG → { "sigPair": [ { "ed25519": "UtiCgIbqDKN0eprJzH0pVHcwOJBoAH1iMOxvjIRKCAJg6VFDwmsEPP3ReLim1TyD2DSPKPuVIllQ1wek3QY/Aw==" } ] }
    8/21/2021 2:10:27 PM  └─ QRY → { "transactionGetRecord": { "header": { "payment": { "signedTransactionBytes": "CjgKEwoMCNOShIkGEPykx64CEgMYwAgSAhgDGID4gq0WIgIIeHITChEKBwoDGMAIEA8KBgoCGAMQEBJECkIaQFLYgoCG6gyjdHqaycx9KVR3MDiQaAB9YjDsb4yESggCYOlRQ8JrBDz90Xi4ptU8g9g0jyj7lSJZUNcHpN0GPwM=" } }, "transactionID": { "transactionValidStart": { "seconds": "1629555026", "nanos": 254869000 }, "accountID": { "accountNum": "1088" } } } }

// Note: Record shows 7 minted NFTs

    8/21/2021 2:10:27 PM  RX:(00)  { "transactionGetRecord": { "header": { }, "transactionRecord": { "receipt": { "status": "SUCCESS", "exchangeRate": { "currentRate": { "hbarEquiv": 1, "centEquiv": 12, "expirationTime": { "seconds": "4102444800" } }, "nextRate": { "hbarEquiv": 1, "centEquiv": 15, "expirationTime": { "seconds": "4102444800" } } }, "serialNumbers": [ "1", "2", "3", "4", "5", "6", "7" ] }, "transactionHash": "WmPBNiC8SFuxwH+hGJbazEEeOtw3znjFhOZ297OWJ/deL9RfeJFIZ3UmuwKvHZsG", "consensusTimestamp": { "seconds": "1629555026", "nanos": 896442000 }, "transactionID": { "transactionValidStart": { "seconds": "1629555026", "nanos": 254869000 }, "accountID": { "accountNum": "1088" } }, "transactionFee": "1441036", "transferList": { "accountAmounts": [ { "accountID": { "accountNum": "3" }, "amount": "35626" }, { "accountID": { "accountNum": "98" }, "amount": "1405410" }, { "accountID": { "accountNum": "1088" }, "amount": "-1441036" } ] }, "tokenTransferLists": [ { "token": { "tokenNum": "7757" }, "nftTransfers": [ { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "1" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "2" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "3" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "4" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "5" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "6" }, { "senderAccountID": { }, "receiverAccountID": { "accountNum": "7755" }, "serialNumber": "7" } ] } ] } } }
    8/21/2021 2:10:27 PM  TX     → { "tokenGetAccountNftInfos": { "header": { "payment": { }, "responseType": "COST_ANSWER" }, "accountID": { "accountNum": "7755" }, "end": "7" } }
    8/21/2021 2:10:27 PM  RX:(00)  { "tokenGetAccountNftInfos": { "header": { "responseType": "COST_ANSWER", "cost": "24" } } }
    8/21/2021 2:10:27 PM  TX     → { "tokenGetAccountNftInfos": { "header": { "payment": { "signedTransactionBytes": "CjgKEwoMCNOShIkGELyw+8wCEgMYwAgSAhgDGID4gq0WIgIIeHITChEKBwoDGMAIEC8KBgoCGAMQMBJECkIaQKxxnB8MVY2b3w9KJVl2/tVK3T+5Q1b11ZiZGa4gFBDGxuiUNAbYPSecuXBdYETUBoTRXbysLnESrDCwswHxDAM=" } }, "accountID": { "accountNum": "7755" }, "end": "7" } }

// Note: Get Account NFT Infos Fails to return the newly minted nft information

    8/21/2021 2:10:27 PM  RX:(00)  { "tokenGetAccountNftInfos": { "header": { "cost": "24" } } }

Hedera network

previewnet

Version

previewnet

Operating system

Windows

tinker-michaelj commented 3 years ago

Hi @bugbytesinc, thanks for catching this!

We actually meant for getAccountNftInfos and getTokenNftInfos to be disabled in this release (as they are on testnet), for two reasons:

  1. With many (20M+) NFTs in state, the cost of providing these queries could have a performance impact on other parts of the system.
  2. The product team is still collecting data on whether the mirror node may be a better source of this information.

We have several big performance improvements coming in release 0.18.0, so if these queries are determined to be important, we will re-enable them then.

For now, I have disabled them on previewnet (i.e., the ANSWER_ONLY versions of the queries will immediately return NOT_SUPPORTED instead of empty lists).