`Scanning blocks [0, 0]` with `GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBE`R set to > 0 and dataSource without startBlock

オープン
#4,223 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
blockchain, docker, rust

調査の方向性

graph/src/blockchain/polling_block_stream.rs の329〜331行付近から始め、docker-compose の設定を使用して、GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER を0より大きい値に設定し、startBlock のない dataSource で再現します。開始ブロックがどのように選択されるかを追跡し、スキャンがブロック0ではなく設定された genesis ブロックから始まることを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug configuration Stale

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

主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphprotocol/graph-node のほかの issue

graphprotocol/graph-node の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。