-
Notifications
You must be signed in to change notification settings - Fork 978
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
Stop subgraphs passing max endBlock #5583
Stop subgraphs passing max endBlock #5583
Conversation
Nice! I think it'd be a bit more cleaner if we just set the exisiting |
@shuaibbapputty bump 😄 |
@@ -419,6 +426,7 @@ impl<S: SubgraphStore> SubgraphInstanceManager<S> { | |||
start_blocks, | |||
end_blocks, | |||
stop_block, | |||
max_end_block, |
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 already have a stop_block, why not set it instead of a separate max_end_block?
@@ -331,6 +331,13 @@ impl<S: SubgraphStore> SubgraphInstanceManager<S> { | |||
}) | |||
.collect(); | |||
|
|||
let max_end_block: Option<BlockNumber> = if manifest.data_sources.len() == end_blocks.len() |
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.
A subgraph can also have offchain data sources, so we cant just compare it like this since offchain datasources dont have an end block
Sorry for the delay @alex-pakalniskis As per my discussion with @incrypto32 on discord, I will address the review changes and update the PR asap. Thankyou! |
289343c
to
9458fc5
Compare
Co-authored-by: Krishnanand V P <[email protected]>
Closes #5535.
Previously, subgraphs continued scanning even when all the data sources had passed the end block.
This update finds the maximum end block across the data sources and stops the subgraph from scanning once the
max_end_block
is reached.