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

fix: collection hash indexing #2

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

NicolasPennie
Copy link

Overview

  • DRAFT: DO NOT MERGE
  • Still testing out to ensure that the leaf hash is correct (see comments). Testing with the following devnet txn 5ZKjPxm3WAZzuqqkCDjgKpm9b5XjB9cuvv68JvXxWThvJaJxcMJgpSbYs4gDA9dGJyeLzsgNtnS6oubANF1KbBm" for asset 2WjoMU1hBGXv8sKcxQDGnu1tgMduzdZEmEEGjh8MZYfC. This txn sets and verifies a collection for a cNFT that does not have a collection.
  • I also tested with devnet txn 7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 and asset 2gEbvG3Cb6JRaGWAx5e85Bf5z4u37EURBeyPBqXDzZoY. This txn unverifies a cNFT with a verified collection.

Testing

  • In progress

Comment on lines +295 to +298
let collection_raw = keys
.get(collection_index)
.ok_or(BlockbusterError::InstructionParsingError)?
.0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just an FYI, that I also had a draft PR for blockbuster that added explicit support for Verify and Unverify collection: github.com/metaplex-foundation/pull/21.

But I ended up not needing the change for the ordering PR since I added a verify flag and additional sequence number to manage the data out of order.

I don't think this results in a change for what you are doing, I'm just telling you as more of an FYI.

I suppose one thing you could consider is just using index 8 from the accounts to get collection every time, since its always in the same accounts location for VerifyCollection, UnverifyCollection, and SetAndVerifyCollection.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a difference between the index 8 account and the one in the instruction args? Why do both exist?

Comment on lines -207 to -208
let _args: MetadataArgs = MetadataArgs::try_from_slice(ix_data)?;
let collection: Pubkey = Pubkey::try_from_slice(ix_data)?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this never had the right offset for MetadataArgs or collection, which you figured out, and yesterday I found that SetAndVerify doesn't pass this parsing on mainline at the moment.

@NicolasPennie NicolasPennie marked this pull request as ready for review July 27, 2023 06:06
@NicolasPennie NicolasPennie merged commit 9edd4ad into helius Jul 27, 2023
tahsintunan added a commit that referenced this pull request Jul 31, 2023
Co-authored-by: Nicolas Pennie <Nicolas.Pennie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants