status-im / nimbus-eth1

Nimbus: an Ethereum Execution Client for Resource-Restricted Devices

Home Page:https://status-im.github.io/nimbus-eth1/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add era support to block importer

arnetheduck opened this issue · comments

The current version of the block importer only supports era1 files, meaning we can only cover the range of blocks up to the merge on mainnet.

After the merge, we can use consensus layer era blocks instead - this is slightly more involved:

  • we must decode the consensus layer block based on its fork schedule, meaning we need access to the consensus layer runtime configuration
  • we must map slot number to block number - slot numbers may have gaps in which there is no (execution) block, meaning that the slot will grow faster than the execution block number

We must also take into account networks which don't have a pre-merge period in era1.

To load era files, we should have a new --era-dir option similar to --era1-dir - the importer will then load the base state of the database, figure out whether to load era1 or era, then go about topping up blocks the same way as is done with era1.