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

feat: core indexing #168

Merged
merged 57 commits into from
Mar 28, 2024
Merged

feat: core indexing #168

merged 57 commits into from
Mar 28, 2024

Conversation

RequescoS
Copy link
Contributor

No description provided.

@RequescoS RequescoS marked this pull request as draft March 15, 2024 19:59
@RequescoS RequescoS marked this pull request as ready for review March 18, 2024 01:37
@StanChe StanChe added the reingest The change requires a re-ingestion of the history label Mar 18, 2024
Copy link
Collaborator

@StanChe StanChe left a comment

Choose a reason for hiding this comment

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

Great job. Aside from the main logic, just minor comments. And looks like we're 1 step away from dropping the sea_orm dependency altogether, just the enums are left to be removed.
Please don't forget to add reingest labels when we're modifying the data structures.

Also a question: should we reingest the existing database, or write a migration to modify those 2 columns? What'll be an effort to write such migration?

Copy link

@danenbm danenbm left a comment

Choose a reason for hiding this comment

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

Looks good just made some minor notes and questions!

Comment on lines 1009 to 1004
amount: 1,
amount: 0,
Copy link

Choose a reason for hiding this comment

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

Check: This seems unrelated to everything else in the PR. Was it supposed to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a small bug related to this test, so I was thinking that this change could fix it. But @StanChe already made PR for curing our tests, so these changes are unnecessary now

@@ -314,4 +319,161 @@ mod tests {
panic!("expected MasterEdition enum variant");
};
}

#[tokio::test]
async fn mpl_core_update_process() {
Copy link

Choose a reason for hiding this comment

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

Long term probably want to add a test with the Royalties plugin with Creators, as well as an item in a Collection. However I recommend waiting to add more tests until the CompressionProof type is replaced though with a newer type.

Comment on lines +199 to +218
plugins: dynamic_data
.plugins
.clone()
.map(|plugins| serde_json::from_str(&plugins.value).unwrap_or(serde_json::Value::Null)),
unknown_plugins: dynamic_data
.unknown_plugins
.clone()
.map(|plugins| serde_json::from_str(&plugins.value).unwrap_or(serde_json::Value::Null)),
num_minted: dynamic_data
.num_minted
.clone()
.map(|num_minted| num_minted.value),
current_supply: dynamic_data
.current_size
.clone()
.map(|current_size| current_size.value),
plugins_json_version: dynamic_data
.plugins_json_version
.clone()
.map(|plugins_json_version| plugins_json_version.value),
Copy link

Choose a reason for hiding this comment

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

Not sure if you want to prefex the mpl-core stuff with mpl_core_. I did that in the reference implementation demo and was planning on doing that in classic DAS so that it was clear that these fields did not have anything to do with Bubblegum or Token Metadata assets.

Copy link

@danenbm danenbm left a comment

Choose a reason for hiding this comment

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

Its looking good to me with the latest updates. Note I have ported the changes to the plublic repos now and plan to work on those implementations going forward.
Here is the classic DAS PR: metaplex-foundation/digital-asset-rpc-infrastructure#178

Once this Blockbuster PR gets merged I will release Blockbuster and then we will be able to use the released crate and remove it from this repo:
metaplex-foundation/blockbuster#41

tx_info: &plerkle::TransactionInfo,
) -> VecDeque<(IxPair, Option<Vec<IxPair>>)> {
order_instructions(
&KEY_SET,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we put here KEY_SET with Bubblegum, TokenMetadata, SPLToken and Core program keys if then we iterate throug all of this instructions and process only Bubblegum related?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, dropped unnecessary keys!

@@ -445,9 +448,7 @@ impl BubblegumTxProcessor {
let mut asset_update = AssetUpdateEvent {
..Default::default()
};
let tree_id = Pubkey::new_from_array(tree_id.to_owned());
// Pubkey::new_from_array(bundle.keys.get(3).unwrap().0.to_vec().try_into().unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: can we drop these comments?

RequescoS and others added 6 commits March 28, 2024 11:29
feat: rent_epoch field + rocks migrators + old DAS params compatibility
# Conflicts:
#	nft_ingester/src/bin/ingester/main.rs
@@ -0,0 +1,4 @@
COMMIT;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a very dirty hack.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree)) I'll try to find something better

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just as a suggestion: https://stackoverflow.com/a/56376907

Copy link
Collaborator

@StanChe StanChe Mar 28, 2024

Choose a reason for hiding this comment

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

but that'll be quite heavy on our db, may probably take over an hour given the indexes update (I'm not 100% sure of this)

@RequescoS RequescoS merged commit 4c1f867 into main Mar 28, 2024
1 check passed
@RequescoS RequescoS deleted the feat/mpl-core branch March 28, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reingest The change requires a re-ingestion of the history
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants