`Scanning blocks [0, 0]` with `GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBE`R set to > 0 and dataSource without startBlock
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- blockchain, docker, rust
- Domain
- backend, blockchain
Research direction
Start with graph/src/blockchain/polling_block_stream.rs around lines 329-331, then reproduce with GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER set above 0 and a dataSource without startBlock using the docker-compose setup. Trace how the starting block is selected and verify that scanning begins at the configured genesis block rather than block 0.
Written by the indexing model from the issue text.
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Running the graph-node from the docker-compose file (v0.28.2) and have set the genesis block to 1 with GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER.
I'm deploying a subgraph without a start block and i get this log:
Nov 25 15:11:26.939 INFO Scanning blocks [0, 0], range_size: 1, sgd: 1, subgraph_id: QmeR431sHevtNDUq8LgHTJms9KHYEvzE5pA9kyYgWdkerr, component: BlockStream
Nov 25 15:11:26.939 DEBG Requesting logs for blocks [0, 0], contract 0x8a7fa94487d0d0460550e5f3f80a663c39ac8b10, 2 events, sgd: 1, subgraph_id: QmeR431sHevtNDUq8LgHTJms9KHYEvzE5pA9kyYgWdkerr, component: BlockStream
Nov 25 15:11:27.159 DEBG Block stream produced a non-fatal error, error: Failed to infer hash for block 0, sgd: 1, subgraph_id: QmeR431sHevtNDUq8LgHTJms9KHYEvzE5pA9kyYgWdkerr, component: SubgraphInstanceManager
I'm not sure if I'm looking at the right place, but here https://github.com/graphprotocol/graph-node/blob/master/graph/src/blockchain/polling_block_stream.rs#L329-L331 it states that it should start from the genesin block if (i assume) a start block is not set in the subgraph.yaml file, but on the next line the genesis block seem to be hardcoded to 0 and ignores the block set with GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Set GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER to > 0 in the docker-compose file
Deploy a subgraph with a dataSource without a startBlock
What is the expected behavior?
It should start scanning from the genesis block set with GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER instead of always starting from block 0
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
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.
More from graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphprotocol/graph-node#6719 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
graphprotocol/graph-node#6673 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
graphprotocol/graph-node#6650 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
graphprotocol/graph-node#6722 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
graphprotocol/graph-node#6721 ·
All issues in graphprotocol/graph-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100