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.91k stars 966 forks source link

[Bug] Error when pooling blocks #5668

Open 1aBcD1234aBcD1 opened 1 day ago

1aBcD1234aBcD1 commented 1 day ago

Bug report

Hi everyone. Im trying to sync some subgraphs using the latest ftm-sonic ethereum client. However, im getting the following error invalid argument 0: hex number with leading zero digits when starting up the graphprotocol/graph-node

I guess the issue is with how the requests are been build by the graph service, since I can make the requests as follows without any type of error

curl http://localhost:8545 \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_getBlockReceipts","params":["0xc5043f"],"id":1,"jsonrpc":"2.0"}' Is there any workaround for this?

Thanks!

Relevant log output

sonicgraph-node-1  | 2024-10-15T14:54:27.150261885Z Oct 15 14:54:27.150 WARN Trying again after eth_getBlockReceipts RPC call for block 0x0004bf7400000328f6ab54bf7b9b288bbde58f74653d727d8ddc92de73443d61 failed (att
empt #10) with result Err(Rpc(Error { code: InvalidParams, message: "invalid argument 0: hex number with leading zero digits", data: None })), provider: sonic-mainnet-rpc-0, component: EthereumPollingBlockIngestor

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

OS information

Linux

1aBcD1234aBcD1 commented 1 day ago

So Im looking into how the requests are made with tcpdump and Im seen that is asking for the blockHash instead of the blockNumber. You can check it as follows what my node is receiving from the graphService.

{"jsonrpc":"2.0","method":"eth_getBlockReceipts","params":["0x0004bf7d000002ccf52e4774d1a88fc89e8f4307eed45202630e8627d1f446e0"],"id":60}
1aBcD1234aBcD1 commented 20 hours ago

Okay, I have figured out that it is indeed a problem on how the sonic node manages this request. I have already opened a pull request in their github to fix this issue: https://github.com/Fantom-foundation/Sonic/pull/232