indexer icon indicating copy to clipboard operation
indexer copied to clipboard

indexer-service: not returning the attestation field in the response when it finds an indexing_error

Open alex-pakalniskis opened this issue 1 year ago • 1 comments

Notes from the team

Lorenzo:

  • The indexer is not returning any attestation field in the response the GW is getting.
  • The indexer response contains an error: indexing_error

Adam:

  • I think indeed this is an edge case which may not be accounted for by the indexer service - in this case query responses should still be deterministic so there should still be attestations. however this is complicated by the fact that this requires a new indexer service version and all indexers to update etc.

Theo:

  • It seems to me that the indexer-service should return an indexing_error in the payload but also an attestation if graph-node marks the error as deterministic.

From E&N tech support:

This query works on development URL, but fails on Production URL. deployment id: QmWyn1viw1sk6YqhJAfi1DqPNqXsMZcijHdXtMnG5w4xPP Subgraph URL: https://thegraph.com/explorer/subgraphs/CC4yWRffRLhjp9CmYtehDuJu8EPxzGZWzpaYJMcFbQFM?view=Query&chain=arbitrum-one Note:- This subgraph uses nonFatalError feature.

{
    factories(subgraphError:allow) {
    id
  }
}

This is the error message

{
  "errors": [
    {
      "message": "bad indexers: {0xbdfb5ee5a2abf4fc7bb1bd1221067aef7f9de491: BadResponse(no attestation: indexing_error)}"
    }
  ]
}

alex-pakalniskis avatar Jun 13 '24 18:06 alex-pakalniskis

Started with a bug report on the indexer-service issue 910 (no attestation returned when there's an error, even with nonFatalErrors enabled, and subgraphError: allow in the query)

I created and deployed a subgraph that has nonFatalErrors enabled, and logs a critical error in it's per-block handler. I then registered this deployment with the GNS contract.

Then I queried the gateway through it's paid query path:

curl "http://localhost:7700/api/deployments/id/QmZWnSPPUgLCwj2K9Mv62K5DLuqB1BwDrUwgWWPBPhxaHj" \  
 -H 'content-type: application/json' -H "Authorization: Bearer deadbeefdeadbeefdeadbeefdeadbeef" \  
 -d '{"query": "{ gravatars(subgraphError:allow) { id  } }"}'  
{"errors":[{"message":"bad indexers: {0xf4ef6650e48d099a4972ea5b414dab86e1998bd3: BadResponse(\"no attestation: indexing_error\")}"}]}

So here I was able to reproduce the issue with my test stack.

Looking then at the gateway paid query/attestation handler in the gateway and following it to the indexer-service's attestation generation here, it seems that indexer-service is getting the header graph-attestable: false in it's response, leading the indexer-service to return null for the attestation field.

Hopping over to the graph-node to explore things, in as_http_response() link- is_attestable() is determined from the errors during the query.

Submitted a PR in graph-node.

dwerner avatar Aug 08 '24 16:08 dwerner

Closing as the typescript indexer-service has been officially deprecated on the network, so we will not continue to add features for it.

fordN avatar Dec 09 '24 17:12 fordN