graphprotocol / graphprotocol/graph-node

[Bug] Sorting subgraphs by nested FDS field throws error

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

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

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

説明

Bug report

Querying the graph-network arbitrum subgraph and sorting by metadata__displayName; throws an error (see log output).
There was a recent change to the network subgraph to support File Data Services; this change moved the displayName field from the top-level Subgraph entity to be in a nested SubgraphMetadata entity that is controlled by FDS.
Sorting by any field in the metadata entity throws this error.

Relevant log output
Results in this error message from graph-node


message: `Failed to get entities from store: column cc.block_range does not exist, query = /* controller='filter',application='sgd675036',route='d8217ff92881cd2a-9ef95e8b5fa290fd',action='174820478' */\nselect 'Subgraph' as entity, to_jsonb(c.*) as data from (select c.*\n from "sgd675036"."subgraph" c left join "sgd675036"."subgraph_metadata" as cc on (cc."id" = c."metadata" and cc."block_range" @> $1) \n where c.block_range @> $2 and (c."active" = $3 and c."entity_version" = $4 and exists (select 1 from "sgd675036"."subgraph_metadata" as i where i."id" = c."metadata" and i.block$ <= $5 and (left("display_name", 256) != left($6, 256))))\n\n order by cc."display_name" asc, c."id" asc\n limit 20) c -- binds: [174820478, 174820478, true, 2, 174820478, ""]
IPFS hash

No response

Subgraph name or link to explorer

https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-arbitrum

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

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

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

はじめの一歩

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

調査の方向性

まず、リンクされた GraphQL クエリを graph-network の arbitrum subgraph に対して再現し、ログに表示される graph-node のストアクエリを調査します。特に、subgraph_metadata への join とその block_range 条件を確認してください。ネストされたメタデータフィールドによるソートがどのように生成されるかを追跡します。完了条件は、ネストされたフィールドによるソートで missing-column error が発生しなくなり、報告されたクエリが結果を返すことです。

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

評価

技術スタック
graphql, rust
領域
backend, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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