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

#5085 optimize subgraph synced check #5198

Merged

Conversation

seem-less
Copy link
Contributor

Closes #5085

@leoyvens
Copy link
Collaborator

Hey @seem-less, I have to say I'm impressed, this code is subtle and your PR is to the point! Thank you for this contribution. Mind if I ask how you tested this?

And mind if I also ask what has brought you to contribute?

@leoyvens
Copy link
Collaborator

This code looks good and tests pass so I'm merging.

@leoyvens leoyvens merged commit 3ac3cdd into graphprotocol:master Feb 20, 2024
7 checks passed
@seem-less
Copy link
Contributor Author

thanks @leoyvens !
Apologies for the late reply. I only really tested this by using the example-subgraph and logging the amount of times that the chain_head_ptr() method was called before and after my changes. I was considering writing unit/integration tests but instead just pushed to see what the feedback would be.

I contributed because I am exploring opportunities to contribute to web3 infrastructure, and this project seems cool :)

leoyvens added a commit that referenced this pull request Feb 28, 2024
This takes a different approach to PR #5198.
Importantly, it will properly disable batching if
the subgraph is caught up with the chain,
regardless of the 'synced' flag status.

It separates the related concepts of synced and caught-up,
and moves handling that into transact_block_operations`.
leoyvens added a commit that referenced this pull request Feb 29, 2024
This takes a different approach to PR #5198.
Importantly, it will properly disable batching if
the subgraph is caught up with the chain,
regardless of the 'synced' flag status.

It separates the related concepts of synced and caught-up,
and moves handling that into transact_block_operations`.
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.

Optimize subgraph synced check
2 participants