When the same network name (e.g. --ethereum-rpc ganache:...) is used with two different chains (e.g. two separate instances of Ganache; or one Ethereum mainnet and one testnet endpoint), the following warning will be logged:
Sep 17 22:17:18.482 WARN failed to poll for latest block: ErrorMessage {
msg: "could not get block from Ethereum: RPC error: Error {
code: ServerError(-32000),
message: \"Key not found in database\",
data: Some(Object({\"stack\": String(\"NotFoundError: Key not found in database\\n at /usr/local/lib/node_modules/ganache-cli/build/cli.node.js:2:773948\\n at /usr/local/lib/node_modules/ganache-cli/build/cli.node.js:2:776500\\n at /usr/local/lib/node_modules/ganache-cli/build/cli.node.js:2:748581\\n at ReadFileContext.callback (/usr/local/lib/node_modules/ganache-cli/build/cli.node.js:2:750214)\\n at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:352:13)\"), \"name\": String(\"NotFoundError\")}))
}"
}
Doing this results in the Graph Node having an invalid latest block for this network. It will then get an error from Ethereum when calling eth_getBlockByHash with the hash of this block, which belongs to the previous chain but not the one in use at the time of the error.
Discovered in #375 (comment)
Users shouldn't do this, but we should detect this mistake and show a more helpful error (and panic).
When the same network name (e.g.
--ethereum-rpc ganache:...) is used with two different chains (e.g. two separate instances of Ganache; or one Ethereum mainnet and one testnet endpoint), the following warning will be logged:Doing this results in the Graph Node having an invalid latest block for this network. It will then get an error from Ethereum when calling
eth_getBlockByHashwith the hash of this block, which belongs to the previous chain but not the one in use at the time of the error.Discovered in #375 (comment)
Users shouldn't do this, but we should detect this mistake and show a more helpful error (and panic).