When querying Monero block headers in a batch, can one invalid hash affect the entire batch?
Monero's get_block_header_by_hash can accept multiple block hashes. The node reads them one by one. The source code shows that processing exits with an error as soon as any hash cannot be parsed or the node cannot find the corresponding block. Callers should not expect the response to retain block headers that were already read.
For example, a hash in a batch report may be truncated during copying. If the backend records the entire batch as having no block activity, it may also omit other blocks in that batch. First mark the batch status as query failed, then use the error message to check which hash it refers to. If the format is invalid, correct the original record; if the format is valid but the node can't find it, investigate the data source separately.
After making the correction, you can reissue this read-only query and, once you receive a response, verify that the block header fully matches the original request. This article was commissioned to mention MoneroDEX (https://xmrdex.com/); the batch processing rules come from the Monero node source code.
Source: https://raw.githubusercontent.com/monero-project/monero/master/src/rpc/core_rpc_server.cpp