[Bug] Subgraph with endBlock on all datasources keeps synching with unfiltered firehose request #5535
Closed
1 of 3 tasks
Labels
bug
Something isn't working
Bug report
When running a subgraph with a single datasource bounded by an 'endBlock', the subgraph will continue indexing forever passed that endBlock.
This is a costly operation if the graph-node is using firehose, because the filter will be EMPTY.
Either we should stop the indexing of the subgraph at that point, or just the blockstream, or at least, make sure that the firehose filters are set to "not match anything".
To reproduce:
On a local graph-node, take an existing subgraph like this one:
https://github.com/graphprotocol/graph-tooling/blob/main/examples/ethereum-basic-event-handlers/subgraph.yaml
Apply these few changes:
Blockstream disconnected, connecting, provider_err_count: 0, cursor: (...), start_block: 6243715, endpoint_uri: firehose, provider: firehose, deployment: Qmc5kz5vA4kXWDHmrvMXkxyTgEUX4xHNsNRWX5pnjSVcST, sgd: 1, subgraph_id: Qmc5kz5vA4kXWDHmrvMXkxyTgEUX4xHNsNRWX5pnjSVcST, component: FirehoseBlockStream
The issue with the firehose filter is here:
https://github.com/graphprotocol/graph-node/blob/v0.35.1/chain/ethereum/src/adapter.rs#L316-L318
A way to get around the issue would be to apply a "never-matching" filter, example by having a "log filter" with a single address of "0x0000000000000..."
But I'm wondering if the solution should be around the handling of the "end block" situation ?
Relevant log output
No response
IPFS hash
No response
Subgraph name or link to explorer
No response
Some information to help us out
OS information
None
The text was updated successfully, but these errors were encountered: