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

Track handlers in subgraph_features table #4820

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

incrypto32
Copy link
Member

Closes #4772

@@ -47,6 +49,20 @@ impl blockchain::DataSource<Chain> for DataSource {
self.source.start_block
}

fn handler_kinds(&self) -> HashSet<&str> {
let mut kinds = HashSet::new();
Copy link
Member Author

Choose a reason for hiding this comment

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

Wondering if this should be a HashSet or just a Vec. But in ethereum we have blockHandlers with filters so its needed to iterate over it and add it to a HashSet to avoid duplication.

At the end way up in the call path, we convert this to a HashSet anyway.

@@ -80,6 +80,11 @@ impl blockchain::DataSource<Chain> for DataSource {
None
}

fn handler_kinds(&self) -> HashSet<&str> {
// This is placeholder, substreams do not have a handler kind.
vec![SUBSTREAMS_HANDLER_KIND].into_iter().collect()
Copy link
Member Author

Choose a reason for hiding this comment

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

This was added as a placeholder to prevent having using an Option

@@ -0,0 +1,6 @@
truncate table subgraphs.subgraph_features;
Copy link
Member Author

Choose a reason for hiding this comment

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

truncating the table so that the new columns values will get populated, subgraph_features table is populated during build_subgraph_runner so it will repopulate all the entries on startup

@incrypto32 incrypto32 force-pushed the incrypto32/add-handlers-to-subgraph-features branch from 3fb6c64 to a90c656 Compare August 29, 2023 08:19
@incrypto32 incrypto32 marked this pull request as ready for review August 29, 2023 08:20
Copy link
Collaborator

@lutter lutter 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!

@incrypto32 incrypto32 merged commit cb7d78e into master Sep 13, 2023
6 checks passed
@incrypto32 incrypto32 deleted the incrypto32/add-handlers-to-subgraph-features branch September 13, 2023 10:44
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.

[Feature] Track handlers in subgraph_features table
2 participants