Stop subgraphs passing max endBlock
Closes https://github.com/graphprotocol/graph-node/issues/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.
Aug 03 02:51:00.634 DEBG Starting or restarting subgraph, sgd: 8, test: end_block, subgraph_id: QmPL5J13p2652oit5umZZPQiNAvfV4E2KXkLNayguL9cJd
Aug 03 02:51:00.634 DEBG Starting block stream, sgd: 8, test: end_block, subgraph_id: QmPL5J13p2652oit5umZZPQiNAvfV4E2KXkLNayguL9cJd
Aug 03 02:51:00.635 INFO Stopping subgraph as we reached maximum endBlock, current_block: 9, max_end_block: 8, sgd: 8, test: end_block, subgraph_id: QmPL5J13p2652oit5umZZPQiNAvfV4E2KXkLNayguL9cJd
@fordN @leoyvens would appreciate a review on this.😊
Nice! I think it'd be a bit more cleaner if we just set the exisiting stop_block value instead of creating a new max_end_block And also stop the subgraph on start up by checking stop block early on, just like you did for max_end_block
@shuaibbapputty bump 😄
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!