graphprotocol / graphprotocol/graph-node
[Bug] `net_version` change error when switching from `RPC` provider to a Firehose provider
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Bug report
Steps:
-
Fresh
graph-nodestart from fresh database with config below. This creates a chain for mainnet withnet_version: 1in the database.[general] [store] [store.primary] connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node" weight = 1 pool_size = 10 [chains] ingestor = "block_ingestor_node" [chains.mainnet] shard = "primary" protocol = "ethereum" provider = [ { label = "peering", url = "$RPC_NODE", features = [ "archive", "traces" ] }, ] [deployment] [[deployment.rule]] shard = "primary" indexers = [ "default" ] -
Stop
graph-nodeinstance. -
Start it back with a Firehose only provider
[general] [store] [store.primary] connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node" weight = 1 pool_size = 10 [chains] ingestor = "block_ingestor_node" [chains.mainnet] shard = "primary" protocol = "ethereum" provider = [ { label = "firehose", details = { type = "firehose", url = "$FIREHOSE_ENDPOINT", token = "$STREAMING_FAST_API_TOKEN", features = [ "compression", "filters" ] }}, ] [deployment] [[deployment.rule]] shard = "primary" indexers = [ "default" ]
Yields error message Apr 27 16:03:14.931 ERRO the net version for chain mainnet has changed from 1 to 0 since the last time we ran, component: BlockStore.
Weirdly, the network seems to still be configured correctly, so maybe it's more a warning or maybe we should just ignore net_version and keep only genesis_hash check.
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
macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the BlockStore logic that compares the stored net_version when a chain provider is changed, using the two configuration examples to reproduce the failure. Determine whether the provider switch should preserve the existing network identity or report a warning, then verify the resulting behavior against the existing chain configuration checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, rust
- Domain
- backend, blockchain, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100