graphprotocol / graphprotocol/graph-node
[Bug] blockHashFromNumber returns null with no log when the node doesn't have the network (e.g. query nodes)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 3.2k
- Fork
- 1.1k
- Merge medio
- 4g 1h
- PR unite (30g)
- 1
Descrizione
Bug report
IndexNodeResolver::block_ptr_for_number returns Ok(None) without logging when the network isn't in the node's BlockchainMap. blockHashFromNumber on a node without that network is therefore an instant null, and from outside that looks the same as "block not found".
The common case is a query node. A node whose id matches [general] query gets Networks::noop() in from_config_inner, so it has no chains at all. It still serves the index-node API on 8030 and answers version, and nothing at startup says it came up query-only.
indexer-agent pointed at that node reports IE070 no data returned, and people go chasing the RPC and the EBO subgraph. It's the same unanswered question as #4880.
resolve_cached_ethereum_calls already logs Failed to fetch cached Ethereum calls; nonexistent network for the same situation, so blockHashFromNumber is the odd one out.
Repro on v0.45.0:
[general] query = "index_node_0"with--node-id index_node_0, then{ blockHashFromNumber(network: "mainnet", blockNumber: 25961537) }returnsnullwithquery_time_ms: 0and no WARN- same result on a normal index node with
network: "nosuchchain"
Suggestion: a WARN (or a GraphQL error) naming the network and this node's id when the network isn't configured here, and an INFO at startup when a node comes up query-only. Same idea as #6718 for the ingestor.
Relevant log output
INFO Query timing (GraphQL), block: 0, query_time_ms: 0, variables: null, query: { version { version } blockHashFromNumber(network: "mainnet", blockNumber: 25961537) } , subgraph_id: indexnode, component: IndexNodeServer
IPFS hash
No response
Subgraph name or link to explorer
No response
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
macOS
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da IndexNodeResolver::block_ptr_for_number e segui il percorso senza rete attraverso Networks::noop() e from_config_inner. Confronta il suo comportamento con resolve_cached_ethereum_calls, quindi riproduci la query blockHashFromNumber su un nodo di sola interrogazione o di rete sconosciuta. Il lavoro è completato quando la rete mancante viene segnalata chiaramente insieme alla rete e all'ID del nodo, e l'avvio in modalità query-only è identificato nei log.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- graphql, rust
- Ambito
- backend-api-design, observability
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100