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.89k stars 962 forks source link

[Bug] Reduce time between block fetches when deploying subgraph #5146

Open paymog opened 8 months ago

paymog commented 8 months ago

Bug report

It seems that deploying a subgraph with a block number that's too large takes ~4 minutes to fail. In the logs below we can see a deploy request come in at 12:05:48 and the final failure happens at 12:09:48. Waiting for 4 minutes is not an ideal UX. Is there a way to configure how long graph node waits between attempts to fetch/validate the start block of a subgraph?

Relevant log output

graph-node-1             | Jan 16 12:05:48.891 INFO Received subgraph_create request, params: SubgraphCreateParams { name: SubgraphName("clrgb597d001fytp215a1bgnh") }, component: JsonRpcServer
graph-node-1             | Jan 16 12:05:48.893 DEBG Created subgraph, subgraph_name: clrgb597d001fytp215a1bgnh, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:05:48.895 INFO Received subgraph_deploy request, params: SubgraphDeployParams { name: SubgraphName("clrgb597d001fytp215a1bgnh"), ipfs_hash: DeploymentHash("QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa"), node_id: None, debug_fork: None, history_blocks: None }, component: JsonRpcServer
graph-node-1             | Jan 16 12:05:48.897 DEBG Connecting to firehose to retrieve block for number 305959435, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:05:52.853 WARN Failed to get block number: Ingestor error: status: Cancelled, message: "Timeout expired", details: [], metadata: MetadataMap { headers: {} }: transport error: Timeout expired, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:05:52.857 DEBG Connecting to firehose to retrieve block for number 305959435, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:07:48.899 WARN Failed to get block number: Ingestor error: status: Cancelled, message: "Timeout expired", details: [], metadata: MetadataMap { headers: {} }: transport error: Timeout expired, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:07:48.902 DEBG Connecting to firehose to retrieve block for number 305959435, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:07:52.863 WARN Failed to get block number: Ingestor error: status: Cancelled, message: "Timeout expired", details: [], metadata: MetadataMap { headers: {} }: transport error: Timeout expired, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:07:52.864 ERRO subgraph_deploy failed, params: SubgraphDeployParams { name: SubgraphName("clrgb2rng000bytp20bn73ifa"), ipfs_hash: DeploymentHash("QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa"), node_id: None, debug_fork: None, history_blocks: None }, error: ManifestValidationError([BlockNotFound("305959436")]), component: JsonRpcServer
graph-node-1             | Jan 16 12:09:48.904 WARN Failed to get block number: Ingestor error: status: Cancelled, message: "Timeout expired", details: [], metadata: MetadataMap { headers: {} }: transport error: Timeout expired, sgd: 0, subgraph_id: QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa, component: SubgraphRegistrar
graph-node-1             | Jan 16 12:09:48.905 ERRO subgraph_deploy failed, params: SubgraphDeployParams { name: SubgraphName("clrgb597d001fytp215a1bgnh"), ipfs_hash: DeploymentHash("QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa"), node_id: None, debug_fork: None, history_blocks: None }, error: ManifestValidationError([BlockNotFound("305959436")]), component: JsonRpcServer

IPFS hash

QmbK34rztGcBSZpxHdEieMUtYFBCPRkNxtmgHYmRx7UYYa

Subgraph name or link to explorer

No response

Some information to help us out

OS information

Linux

paymog commented 8 months ago

@sduchesneau might this be a firehose timeout config and not a graph node config?

github-actions[bot] commented 4 weeks ago

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.