graphprotocol / graphprotocol/graph-node

[Feature Request] Substrate Frontier runtime upgrade Compatibility

Open
#2,919 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chains/ethereum
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with chain/ethereum/src/ethereum_adapter.rs at the referenced genesis-block lookup, then trace how chain configuration reaches ChainSection or stores. Determine how a configurable gen_block should be represented and passed to the adapter. Done means Frontier runtimes whose EVM starts after block 0 can index from the configured block without the missing-genesis error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.