metaboss: Unable to update data in 0.6.0

Hello! Long time user here, really appreciate the hard work you’ve put into this project. Thank you!

I’m writing because I appear to be unable to update my token data using v0.6.0 of metaboss.

  metaboss update data -l debug \
    -r [REDACTED] \
    -k [REDACTED] \
    -a $nft \
    -n data/$nft.json

Yields the following message:

[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client] -32002 Transaction simulation failed: Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   1: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   2: Program log: (Deprecated as of 1.1.0) Instruction: Update Metadata Accounts
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   3: Program log: Error: BorshIoError
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   4: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 8654 of 200000 compute units
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   5: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Failed to serialize or deserialize account data: Unknown
[2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]

Two things stand out to me here:

  1. “Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown”
  2. “Program log: (Deprecated as of 1.1.0) Instruction: Update Metadata Accounts”

My guess is that number 2 is causing number 1 by virtue of the fact that data is not being serialized due to the fact that updating metadata is deprecated?

Should I take the error message at face value and invoke a different method to update token data?

Any guidance you can provide would be much appreciated! Thank you again for your hard work!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@nonfungible-dev @omarkilani Sorry you’re having this issue. It’s not the deprecated function that’s causing the problem (though that warning will go away next Metaboss version when I update to the update_metadata_accounts_v2 handler). The issue is that some of the Pesky Penguins NFT data is corrupted in that it has data at the end of the struct that shouldn’t be there and it’s being interpreted by explorers as data for the new metadata fields in v1.1. We seen this with a few NFTs and that’s what prompted my exploratory PR that Omar linked.

It’s not exactly clear why this happens. One idea is this might be caused by the creators array being updated to go from having more creators to less leaving extra data at the end of the struct due to the way Borshi serialization/deserialization works. However, that doesn’t explain an NFT like this one that only has three txs and no update data tx.

Ultimately, this needs to be solved at the Metaplex contract level as all the current handlers will fail to properly deserialize the data, so it can’t be fixed by calling one of them to update the data. I’ll bring this topic up again at the Metaplex engineering meeting tomorrow to see if we can assign some resources to fixing this.

@samuelvanderwaal can verify that a collections set-and-verify with metaboss is able to update the on-chain metadata:

https://explorer.solana.com/address/CH4X6QQfRTaAFm2kGnqJEPoQrfoHa1cP2jcPm4Z7rjF/metadata

The update tx is here:

https://explorer.solana.com/tx/43zLtCECuFrwVXab6LULZMR9KgHaJyeaLkq7RRVn3X8HQARSq9g1ZcD6BYrYrUdwbWxVzuZktruCiVcZCHewFFNR

And shows a:

> Program logged: "Corrupted metadata discovered: setting values to None"

Log message.

Thanks again!

Deploying the updates to token-metadata on mainnet should happen early next week and I plan to get Metaboss upgraded to use the update_metadata_accounts_v2 by then so you’ll be able to fix the Noot NFTs.

Perhaps “corrupted” data is not the best description. If you create a NFT with a creators array with five creators you have a total data length of 561 bytes and the rest are zero filled (679 total). If you then update the creators array to have only three creators you’re overwriting the array with 493 bytes of data but due the way borsh handles this and the way token-metadata is set up, that extra 68 bytes of data is still populated, just at the end of the array. So when we added the new metadata fields they overlapped with this extra data on some NFTs causing the data to be deserialized incorrectly.

You can see our fix for this here. We create a new custom deserialization function to handle the invalid data at the end of the array and then we also now zero out the full byte array in the update_metadata_accounts_v2 call which should fix any NFTs that have this extra data and prevent it from happening in the future.

I’m helping @nonfungible-dev with this issue.

After talking to @blockiosaurus, they referenced this PR in metaplex-program-library:

https://github.com/metaplex-foundation/metaplex-program-library/pull/319

Which will fix this issue if/once deployed (?).

I was just about to report in with our success, but it looks like Omar beat me to it!

Confirming that, using the v2 patch that Omar sent over, I was able to invoke metaboss collections set-and-verify on an NFT with corrupt metadata to kill two birds with one stone and assign a collection + repair the metadata.

Thanks everybody for resolving this issue so quickly! Appreciate the support and positive energy you bring to the space.

Please feel free to close this issue, and if there’s any additional information or testing you’d like from me, please don’t hesitate to reach out!

Thanks for the details, @samuelvanderwaal!

The hypothesis about trailing data after a creators change makes sense; back in November 2021 we changed the creators array to consolidate royalties into a single “ppTeam” address.

I’m a little surprised we never noticed the corruption until now, especially because the creators change was the 2nd (of 5) changes we’ve made to our metadata, and none of the other changes ever failed to deserialize. But I am intimately familiar with the dynamic nature of software development, so I’m going to chock this one up to “an evolving ecosystem” and call it good 😁

Thank you again for taking the time to describe the issue in detail, and for working with Metaplex to further the standard. You and Omar are perfect examples of people working to advance the space, and I appreciate very much the time and energy you put in to advancing the “state of the art” for all of us ❤️