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

Update to use Token Metadata (and latest Bubblegum) Rust clients #35

Merged
merged 4 commits into from
Feb 2, 2024

Conversation

danenbm
Copy link
Contributor

@danenbm danenbm commented Jan 30, 2024

Notes

  • Left the serde feature for token-metadata in but I think it could be removed in a follow-on PR.
  • Removed ReservationListV1 and ReservationListV2 as they aren't parsed in DAS.
  • Used Metadata:safe_deserialize as it looks like it can handle some edge cases where metadata is the wrong size due to previous changes in Token Metadata.
  • As part of this PR I noticed that MasterEditionV1 and MasterEditionV2 were switched in the parsing.
    • I think it only works because the first fields are the same and it's using try_from_slice_unchecked which doesn't check the whole buffer is used.
    • Looking at how this error propagated into DAS, it resulted in incorrect key being used in DAS (see below) which will be fixed after this blockbuster is used. Note that attachment_type is also set to master_edition_v1, but that is actually a DAS issue that will be fixed as part of Update to use Token Metadata (and latest Bubblegum) Rust clients digital-asset-rpc-infrastructure#168.

MasterEditionV2 data indexed by DAS before this change

solana=# select * from asset_v1_account_attachments;
                                 id                                 | asset_id |  attachment_type  | initialized |                           data                           | slot_updated 
--------------------------------------------------------------------+----------+-------------------+-------------+----------------------------------------------------------+--------------
 \x0959c32095ea8e4efe3cd3085da48fe76315fb964d75adb35ef77385c4824e8b |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           10
 \x2536a1214ca39b157ced46c63e811af89533a0bbb50138dbfd55116caa25dc04 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           16
 \xdf01db9dae8c86894a11e82a5613628009e2adcecf2f1fc370396c9e350a3a84 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |            4
 \x038c060efc5b0d94a7e9e3b18a5412d3f8f8ae2f6f2696bf4397db66577d2d77 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           22
 \x1e03d3ca5cc64798343f89b7b2cfabdd1812da638c8e68c7e667b8e452de35e1 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           29
 \x448647109f2d2fde9328d77e24ff6105b751e3ae45b1f31ac277ecb41a66c561 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           35
 \xcf2138727f907817109103c14605015fcde92629aeed463a836cfc8c27a2a15b |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           41
 \xa494deba3d99b376a507c729055775ce88cb16a0d9724743e9975858ef86a03f |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           47
 \x92abf2c0864539ace0afa35001574fdf68f9fd31f5cd532c349ddd40149cb0bc |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           53
 \x0e170152ff4c0c4e29bd56e74ecf0bcea026ca45203ff274ccd00167e9d46305 |          | master_edition_v1 | f           | {"key": "MasterEditionV1", "supply": 0, "max_supply": 0} |           60

@danenbm danenbm force-pushed the danenbm/tm-rust-client branch from f246000 to 1c31c54 Compare January 31, 2024 23:11
@danenbm danenbm marked this pull request as ready for review January 31, 2024 23:20
@danenbm danenbm force-pushed the danenbm/tm-rust-client branch from 1c31c54 to 07117b9 Compare January 31, 2024 23:44
Also remove redundant re-export of Bubblegum types in Token
Metadata code
@danenbm danenbm force-pushed the danenbm/tm-rust-client branch from 07117b9 to 421272e Compare February 1, 2024 03:47
@danenbm danenbm requested a review from niks3089 February 1, 2024 04:14
@danenbm danenbm changed the title Update to use Token Metadata (and latest Blockbuster) Rust clients Update to use Token Metadata (and latest Bubblegum) Rust clients Feb 1, 2024
@danenbm danenbm merged commit c972393 into main Feb 2, 2024
1 check passed
@danenbm danenbm deleted the danenbm/tm-rust-client branch February 2, 2024 19:20
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