Try   HackMD

Adding Ephemery to Lodestar: writing the genesis

Had a go at an outline genesis script that I can run manually from command line at the moment.

Things that are taking a bit of time:

  • learning about ssz and Chainsafe's ssz package
  • adding to Lodestar ChainConfig type
  • aligning with Adedamola on our approach to Lodestar as a whole, taking into account reset functionality (originally a stretch goal of mine)
  • merging latest changes from Lodestar (which include Holesky testnet configuration) and reviewing these updates

GENESIS

  • understanding the order in which the genesis steps must be undertaken with respect to the existing Lodestar codebase
  • planning for the latest change to the Ephemery EIP to reflect how genesis should be generated:
When the testnet flag is provided, automatically use the hardcoded checkpoint to download the latest genesis state using checkpoint sync feature
If user provides a custom checkpoint sync flag, override the default option and use the endpoint provided by user
Include a backup download option pointing to testnet releases which are publicly distributed and trigger this option if the checkpoint state sync fails
If the client includes a feature for generating the genesis, use it to verify parameters in the downloaded state and issue an error if values don’t correspond
  • where do we want the generated output for genesis inside Lodestar?
  • still need to do ssz implementation
  • wanting to create a 'reusable' ephemery package containing the genesis generation - if useful

RESET
reviewing with Adedamola the best way to migrate ephemery retention.sh
- what is the optimum way to stop ephemery and restart it from inside the reset mechanism? Is this the correct approach?

git notes

Set git config to merge (not rebase)
git config pull.rebase false

Add remote upstream (i.e. for grabbing Lodestar latest):
git remote add upstream git@github.com:ChainSafe/lodestar.git

Pull Lodestar latest
git pull upstream unstable

Running generate script

Inside packages/ephemery run:
node --loader ts-node/esm ./src/genesis/generate.ts