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 957 forks source link

eth_getBlockByHash RPC call failed #3450

Open imbenwolf opened 2 years ago

imbenwolf commented 2 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? using v0.26.0 docker image, graph-node fails with:

Apr 09 23:32:01.095 WARN Trying again after load block 0x7a35…fb8a failed (attempt #10) with result Err(Decoder error: Error("invalid length 64, expected a (both 0x-prefixed or not) hex string with length of 40", line: 0, column: 0)), sgd: 1, subgraph_id: QmXiZ4ZeVSCCdo3jHpj1oeGXtPPirfRSXjNXGjAJAnrCpr, component: BlockStream

Apr 09 23:32:01.100 ERRO Subgraph instance failed to run: Decoder error: Error("invalid length 64, expected a (both 0x-prefixed or not) hex string with length of 40", line: 0, column: 0), sgd: 1, subgraph_id: QmXiZ4ZeVSCCdo3jHpj1oeGXtPPirfRSXjNXGjAJAnrCpr, component: SubgraphInstanceManager

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. using alchemy archive node as the mainnet url in docker compose

What is the expected behavior? not failing

leoyvens commented 2 years ago

Thanks for reporting, could you please provide reproduction instructions? Either a subgraph we can build, or a subgraph id that can be found on a public IPFS gateway (such as the hosted service).

imbenwolf commented 2 years ago

Thanks for reporting, could you please provide reproduction instructions? Either a subgraph we can build, or a subgraph id that can be found on a public IPFS gateway (such as the hosted service).

hi, thanks for the reply! sure thing, here is a fork of this repo with the code changed to reproduce the issue: https://github.com/imbenwolf/graph-node-issue-3450

the steps are:

cd docker
export ARCHIVE_NODE=[alchemy archive node url]
docker-compose up -d

& wait for the block ingestor to start polling for eth_getBlockByHash to see the issue logged in graph-node docker service.

again, thanks for looking at this!

imbenwolf commented 2 years ago

Using the following versions:

imbenwolf commented 2 years ago

@leoyvens can you reproduce?

azf20 commented 2 years ago

@imbenwolf this looks like this is related to using a ganache mainnet fork rather than an Alchemy URL directly. Have you experienced this with Alchemy directly? And have you had success running regular ganache (i.e. not forking mainnet)?

imbenwolf commented 2 years ago

happening with anvil as well WARN Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #15) with result Err(Decoder error: Error("invalid length 1, expected a (both 0x-prefixed or not) hex string with length of 16", line: 0, column: 0)), provider: mainnet-rpc-0

imbenwolf commented 2 years ago

fails with/without fork enabled. just fails in general using ganache/anvil. how do you guys run a local graph node connected to a local testnet?

izzetemredemir commented 10 months ago

Same error for arbitrum goerli testnet