Try   HackMD

Dev notes - w/c 15 July 2024

Align with holesky additions

ephemery-geth local quickstart

  1. Download latest ephemery release

  2. Clear chain data in local geth directory

    rm -r chaindata

  3. Build and run geth branch locally

    make geth
    ./build/bin/geth --ephemery --verbosity 4

Updates

  1. Pushed ephemery-geth updates to my fork, created [draft PR] - not ready for peer review (https://github.com/ethereum/go-ethereum/pull/30210)

  2. Reviewed against holesky updates

  3. Noted that Misc struct added for holesky alloc data, need to make sure that ephemery alloc data is fully decoded too

    • Check in prog func decodePrealloc in core/genesis.go
    ​​​​func decodePrealloc(data string) types.GenesisAlloc {
    ​var p []struct {
    ​	Addr    *big.Int
    ​	Balance *big.Int
    ​	Misc    *struct {
    ​		Nonce uint64
    ​		Code  []byte
    ​		Slots []struct {
    ​			Key common.Hash
    ​			Val common.Hash
    ​		}
    ​	} `rlp:"optional"`
    ​}
    ​​​​...
    
    • Check in prog core/mkalloc.go
  4. More review against EIP


❗Updated: Draft PR closed by geth team, before review was requested - next steps / approach to be agreed with ephemery team; geth team feedback:

"We have discussed this PR within the team. We do not want to be responsible for maintaining an up-to-date definition of the Ephemery network and its genesis parameters (premine, etc.). Since the network is meant to be reset, and genesis configurations are provided by the project at https://github.com/ephemery-testnet/ephemery-genesis, the genesis block doesn't have to be generated by geth."


TODO:

  • Review holesky commit and ensure my updates follow a similar approach
  • Alloc data review Misc struct (see above)
  • Discovery list (see observations below)
  • Review config. Where to include minGenesisTimestamp and genesisDelay - should these be in genesis.go or in config.go?
  • Update ephemery params to correctly reflect EIP spec
  • Run with CL client (again) to verify starting correctly
  • Peer review
  • Share draft PR with geth team

Observations:

  • need to add ephemery here? https://github.com/ethereum/discv4-dns-lists
    • If so, add ephemery case in ephemery-geth params/bootnodes.go as follows:
    ​​​​// KnownDNSNetwork returns the address of a public DNS-based node list for the given
    ​​​​// genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more
    ​​​​// information.
    ​​​​func KnownDNSNetwork(genesis common.Hash, protocol string) string {
    ​​​​    var net string
    ​​​​    switch genesis {
    ​​​​    case MainnetGenesisHash:
    ​​​​        net = "mainnet"
    ​​​​    case GoerliGenesisHash:
    ​​​​        net = "goerli"
    ​​​​    case SepoliaGenesisHash:
    ​​​​        net = "sepolia"
    ​​​​    case HoleskyGenesisHash:
    ​​​​        net = "holesky"
    ​​​​    case EphemeryGenesisHash:
    ​​​​        net = "ephemery"
    ​​​​    default:
    ​​​​        return ""
    ​​​​    }
    ​​​​    return dnsPrefix + protocol + "." + net + ".ethdisco.net"
    ​​​​}