-
Notifications
You must be signed in to change notification settings - Fork 39
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
Change creator and collection verification to use upserts to support out of order #87
Conversation
…erification occurs
* This allows out-of-order Bubblegum transactions to create and update the asset table. * Upsert leaf schema, owner, delegate, and seq separately since those are updated by all instructions and gated by sequence number to ensure freshest value. * Mint, burn, and decompress happen without regard to sequence number because they operate on unique fields. * Mint and burn have been updated but Decompress still needs to be fixed to handle out of order transactions. * Also remove unused 'filling' variable.
Also remove not null constraints for asset fields without defaults.
Also update redeem and decompress to not use leaf schema events.
compressed_seq won't work because decompression doesn't create a cl_event.
f678f24
to
2bc2946
Compare
nft_ingester/src/program_transformers/token_metadata/v1_asset.rs
Outdated
Show resolved
Hide resolved
e4af3a2
to
c91977a
Compare
7514ed6
to
c55f7a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment on the updating of position
.to_owned(), | ||
) | ||
.build(DbBackend::Postgres); | ||
txn.execute(query).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this query need a where check for example on SlotUpdated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it cannot be reordered, then is the update needed atg all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still needed to be an update because if 'verify_creator` is processed first, then there will be a record but it won't actually have all this base information from the time of minting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this query need a where check for example on SlotUpdated?
It does not need protection because the base creator info is ONLY filled in at time of mint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will likely be updating this to support changes to creator array and collection.
…of order processing (#90) * Adding verified flag to asset_grouping table * Regenerate Sea ORM types * Remove null constraints on asset_grouping table * Regenerate Sea ORM types * Update digital asset types and ingester based on new Sea ORM objects * Setting new verified flag in asset_grouping table to be non null with default Also regenerating Sea ORM types * Separate out collection insert in mintV1 into separate upserts * Fix error message * Separate update collection base info from collection verified * Add group info seq to asset_grouping table * Regenerate Sea ORM types * Add group_info_seq checks to collection base info upsert * Add check for verified = true in grouping for Read API * Fix conditions for asset grouping updates * Require grouping to verified to be returned from API in all cases
…x-foundation#88) This reverts commit cfe2672.
Notes
verified
flag toasset_grouping
to support out-of-order.Testing
getAsset
returns empty grouping. Then after the collection is verified,getAsset
returns the collection as a grouping. This is to remain consistent with existing API behavior.asset
table #77 (comment) for more info on overall testing process.getAsset
resultCreateTree
/Mint
,VerifyCreator
asset
,asset_creators
,cl_items
match when instructions run forwards and backwards using PR code. PR code'scl_items
table consistent with mainline code when instructions run forwards.asset
andasset_creators
incorrect on main when instructions run backwards.CreateTree
/Mint
,VerifyCollection
asset
,asset_grouping
,cl_items
match when instructions run forwards and backwards using PR code. PR code'sasset
andcl_items
tables consistent with mainline code when instructions run forwards.asset_grouping
incorrect on main.CreateTree
/Mint
,VerifyCollection
,UnverifyCollection
asset
,asset_grouping
,cl_items
match when instructions run forwards and backwards using PR code.CreateTree
/Mint
,SetAndVerifyCollection
SetAndVerifyCollection
does not parse properly due to Blockbuster error. Not a regression.SetAndVerifyCollection
does not parse properly due to Blockbuster error. Not a regression.CreateTree
/MintToCollection
,UnverifyCollection
asset
,asset_grouping
,cl_items
match when instructions run forwards and backwards using PR code.