graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.9k stars 964 forks source link

[Bug] Cannot rewind subgraph with multiple entries #5603

Open paymog opened 1 month ago

paymog commented 1 month ago

Bug report

I have a subgraph with multiple entries that I want to rewind

root@goldskyraw-indexer-0-graph-node-7d99457bd5-tl7f2:/# graphman info QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf
name      | cly2om8v1y9pa01zw0d2eh5vr
status    | current
id        | QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf
namespace | sgd57856
shard     | second
active    | true
chain     | artela-betanet
node_id   | paused
----------+-------------------------------------------------------------------
name      | cly70thk886zb011s2i49cnzy
status    | current
id        | QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf
namespace | sgd57856
shard     | second
active    | true
chain     | artela-betanet
node_id   | paused
----------+-------------------------------------------------------------------
name      | clxv9e0ksx4a801tef6j17rel
status    | current
id        | QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf
namespace | sgd57856
shard     | second
active    | true
chain     | artela-betanet
node_id   | paused
----------+-------------------------------------------------------------------
name      | clxk54zxw3y7a010lh7xtgb1w
status    | current
id        | QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf
namespace | sgd57856
shard     | second
active    | true
chain     | artela-betanet
node_id   | paused

When I try to rewind it, I get the following error

Error: Multiple deployments found for the search : QmQzA62X9YpN7CVL3UaPhCVBWnwGiFsq395fPrkaa9T2Gf. Try using the id of the deployment (eg: sgd143) to uniquely identify the deployment

This error happen regardless of whether I use the IPFS hash or the sgd id.

It seems that this bug was introduced in https://github.com/graphprotocol/graph-node/commit/09db0ce68ffbe768e99a2ce5536c3b148837f6ab. Prior to this commit, I could rewind subgraphs with multiple entries (the old logic would flatten all the nested arrays). Now, whether an sgd id is used or an ipfs hash, this errors out.

This is happening on v0.35.1

Relevant log output

No response

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

OS information

None

cryptovestor21 commented 1 month ago

We're also experiencing this issue with 0.35.1.