From 61b8361cc4887910d27fee277b2e59a4c0cf945f Mon Sep 17 00:00:00 2001 From: Liang Xu <24490353+lx3133584@users.noreply.github.com> Date: Wed, 25 Nov 2026 09:50:56 +0800 Subject: [PATCH] node, server/index-node: say when a node has no chain for a network `IndexNodeResolver::block_ptr_for_number` answered `Ok(None)` without a word when the network was not in the node's `BlockchainMap`, and the caller turns that into a `null` that reads the same as "no such block". A query node is the common case: `from_config_inner` gives it `Networks::noop()`, so it has no chains at all, and nothing at startup said so either. The resolver now logs the network and block number before answering, which matches the warning `resolve_cached_ethereum_calls` already emits for the same situation. `from_config_inner` logs that the node came up query-only, with its node id. The GraphQL answer is unchanged: still `null`, still `Ok(None)`. Only the silence is gone. Signed-off-by: Liang Xu <24490353+lx3133584@users.noreply.github.com> --- node/src/network_setup.rs | 6 ++++++ server/index-node/src/resolver.rs | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/node/src/network_setup.rs b/node/src/network_setup.rs index e1630786345..c0de49b4de8 100644 --- a/node/src/network_setup.rs +++ b/node/src/network_setup.rs @@ -165,6 +165,12 @@ impl Networks { chain_filter: &dyn ChainFilter, ) -> Result { if config.query_only(&config.node) { + info!( + logger, + "Node is query-only, so it has no chains"; + "node_id" => &config.node, + ); + return Ok(Networks::noop()); } diff --git a/server/index-node/src/resolver.rs b/server/index-node/src/resolver.rs index 5d23483265e..6b97a519e1a 100644 --- a/server/index-node/src/resolver.rs +++ b/server/index-node/src/resolver.rs @@ -690,7 +690,17 @@ where BlockchainKind::Ethereum | BlockchainKind::Near => (), } - // The given network does not exist. + // The given network does not exist. Say so: the caller answers `null`, + // which reads the same as "no such block", and a query node has no + // chains at all, so this is the first thing to check when + // `blockHashFromNumber` comes back empty. + warn!( + self.logger, + "No blockchain for network"; + "network" => &network, + "block_number" => block_number, + ); + Ok(None) } }