graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Stop subgraphs passing max endBlock

Open shuaibbapputty opened this issue 1 year ago • 2 comments

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

shuaibbapputty avatar Aug 03 '24 02:08 shuaibbapputty

@fordN @leoyvens would appreciate a review on this.😊

shuaibbapputty avatar Aug 07 '24 14:08 shuaibbapputty

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

incrypto32 avatar Aug 12 '24 09:08 incrypto32

@shuaibbapputty bump 😄

alex-pakalniskis avatar Oct 21 '24 15:10 alex-pakalniskis

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!

shuaibbapputty avatar Nov 12 '24 15:11 shuaibbapputty