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

[Bug] Subgraph with endBlock on all datasources keeps synching with unfiltered firehose request #5535

Closed
1 of 3 tasks
sduchesneau opened this issue Jul 15, 2024 · 0 comments · Fixed by #5583
Closed
1 of 3 tasks
Assignees
Labels
bug Something isn't working

Comments

@sduchesneau
Copy link
Contributor

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:

+++ b/examples/ethereum-basic-event-handlers/subgraph.yaml
@@ -1,4 +1,4 @@
-specVersion: 0.0.5
+specVersion: 0.0.9
 description: Gravatar for Ethereum
 repository: https://github.com/graphprotocol/graph-tooling
 schema:
@@ -6,9 +6,11 @@ schema:
 dataSources:
   - kind: ethereum/contract
     name: Gravity
-    network: test
+    network: mainnet
     source:
-      address: '0x5FbDB2315678afecb367f032d93F642f64180aa3'
+      address: '0x2e645469f354bb4f5c8a05b3b30a929361cf77ec'
+      startBlock: 6175244
+      endBlock: 6175300
       abi: Gravity
     mapping:
       kind: ethereum/events
  • stop it after a while and restart it.
  • Observe this log:
    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

  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

OS information

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants