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

[Feature Request] Substrate Frontier runtime upgrade Compatibility #2919

Open hskang9 opened 2 years ago

hskang9 commented 2 years ago

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

Feature

What is the current behavior?

In a polkadot parachain where it uses Frontier for their WASM runtime, evm feature sometimes does not start from day 1(i.e. block 0). It might add EVM for testing its connection between relay chain or go through necessary tests before they add evm integration. Due to this, current graph node is not able to index evm since current code is set to index from block 0 here. I would like to suggest to get input from config to set genesis block of evm to index.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

The error shows in shiden with "Ethereum node could not find genesis block" with the following log

Oct 13 16:30:16.455 DEBG Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #1) with result Err(Ethereum node could not find genesis block), provider: shiden-rpc-0
Oct 13 16:30:16.811 DEBG Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #2) with result Err(Ethereum node could not find genesis block), provider: shiden-rpc-0
Oct 13 16:30:17.177 DEBG Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #3) with result Err(Ethereum node could not find genesis block), provider: shiden-rpc-0

What is the expected behavior?

I expect adding gen_block input in config and add that in ChainSection or stores so that genesis block argument can be used in ethereum_adapter.rs

azf20 commented 2 years ago

Hey @hskang9 thanks for this - @lutter do you think this would make sense to add as an advanced config option?

leoyvens commented 2 years ago

I think this would make sense.