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

DISABLE_BLOCK_INGESTOR does not disable block ingestion

Open sandbochs opened this issue 3 years ago • 1 comments

Do you want to request a feature or report a bug? Report a bug

What is the current behavior? If the DISABLE_BLOCK_INGESTOR is set to true, 'true', or "true" the subgraph writer / block ingestion is still started when running graph-node

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Reproduction steps: Using the v.0.27.0 build or image from docker hubgraphprotocol:graph-node:v0.27.0

  • Set DISABLE_BLOCK_INGESTOR=true and start the graph node
  • Check the logs and see that the block ingestion and indexing still occurs.

What is the expected behavior? The expected behavior is that the graph node starts in 'query' only mode with block ingestion and indexing disabled.

Further Digging

I've found that the correct way to disable block ingestion is to set the env var node_id to something other than 'default'. If node_id is not provided, the node name is set to default and the graph-node assumes it needs to ingest and index. This can be verified by setting node_id=default.

Setting node_id to anything else start the graph-node with block ingestion and indexing disabled. Looking at the docker start script, you can also pass node_role=query-node which is sugar for setting DISABLE_BLOCK_INGESTOR=true. This has no effect either and leaving node_role unset has no effect on whether the node starts in query or indexing mode.

Proposed Fixes

Either update the env var readme and remove DISABLE_BLOCK_INGESTOR and describe the node_id behavior.

Respect DISABLE_BLOCK_INGESTOR flag.

I'm happy to open a PR to update the README if this should be the fix.

sandbochs avatar Sep 03 '22 00:09 sandbochs

@lutter @leoyvens making sure you see this, this looks like unexpected behaviour?

azf20 avatar Sep 04 '22 07:09 azf20

Same on v.0.29.0 DISABLE_BLOCK_INGESTOR=true does not work as expected

bussyjd avatar Jan 18 '23 19:01 bussyjd

Same on v0.31.0. I see we have a logic conflict now when using node_role as query_node and setting query pattern via general rule. The first approach is trying to disable block ingestion (but it doesn't work); the second is disabling chains network connecting. But when I checked the source code, we should add logic for stopping creating an IndexerServer if we add node_role is query_node. cc @leoyvens @lutter

huyngopt1994 avatar Jul 08 '23 18:07 huyngopt1994