DEV Community

Cover image for How to merge an Ethereum network right from the genesis block

How to merge an Ethereum network right from the genesis block

Afri on December 21, 2022

The merge is arguably the most significant milestone of the Ethereum research and development roadmap. By attaching a proof-of-stake consensus beac...
Collapse
 
johnrisk profile image
John Risk • Edited

Thanks @q9 for this elaborate article with the github commits. It would help us a lot.
It was very easy to follow up and understand things along the way.

I got an error in the beacon and the validator when it publishes its first block at slot 0:
Error on submitPoolSyncCommitteeSignatures [0] slot=1, validatorIndex=0 PublishError.InsufficientPeers
but it looks like a normal error in lodestar that is waiting for a fix and not affecting the process.

I had another issue where the nodes stopped syncing after reproducing a couple of blocks, and it was fixed by your suggestion to put --syncmode full

Collapse
 
nietpham profile image
Niet

I got the same issue. How can I fix this?

Collapse
 
seanconneryadigium profile image
Sean Connery

Hi Afri,

First of all, thanks for this awesome tutorial and repository. It helped me understand a lot of things about the merge configurations.

I was trying to follow along with the article and I'm stuck at the point where the network won't kick off - I'm using Geth/Prysm (running two geth nodes connected to two beacon nodes, with the 8 validators connected to the first beacon node)

I'm using pretty much the same execution/beacon configurations in the article.
The only change I made was the GENESIS_DELAY: 3600

Here's a screenshot of the beacon logs:
ibb.co/DCrQTNX

All the commands, and configs that I'm using are in this repo:
github.com/oone-world/merge-from-g...

Could you please help me with this?

Collapse
 
seanconneryadigium profile image
Sean Connery

Turns out the issue was that the timestamp (in genesis.json) + GENESIS_DELAY (in config.yaml) is in the past!

This just torpedoes the whole thing!

Collapse
 
mxmar profile image
Matt • Edited

For the timestamp in genesis.json have you used MIN_GENESIS_TIME or sum of MIN_GENESIS_TIME+GENESIS_DELAY?

Thread Thread
 
q9 profile image
Afri

The timestamp in genesis.json is not important, you could also set it to January 1st, 1970. Important is MIN_GENESIS_TIME and GENESIS_DELAY.

Collapse
 
avenbreaks profile image
Cici Sabrina

how to setup genesis delay and timestap in your genesis? im trying to change genesis delay 3200 and timestap the day now but its not synced.

Collapse
 
avenbreaks profile image
Cici Sabrina

eth. getBlockByNumber(0)

i took from the hash: "0x56c9b4417bafc42766888bae53959de8f0e5ac898eec6b30880c340f45d6ede9", and put this hash in deposit_contract_block.txt

then I tried to execute everything and run as you provide but I get a notification like this:
Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Failed to obtain attester duty.

in the beacon node they get peer :
info: Searching peers - peers: 1 - slot: 3264964 (skipped 3264964) - head: 0 0 0x9e15…5549 - execution: valid(0x56c9…ede9) - finalized: 0x0000…0000:0

in geth I get something like this:
Beacon client online, but never received consensus updates. Please ensure your beacon client is operational to follow the chain!

Collapse
 
q9 profile image
Afri

slot: 3264964 (skipped 3264964) indicates that something is wrong with your genesis timestamp. it should be less than 32 ideally.

Collapse
 
avenbreaks profile image
Cici Sabrina

sorry, sir, what do you mean, can I just change my timestamp to number 32?

Thread Thread
 
nflaig profile image
Nico Flaig

Genesis time should not be more than 32 slots behind current time. For example if your SECONDS_PER_SLOT value is 12, then genesis time must not be more than 384 seconds in the past when starting the network.

There is a known issue (github.com/ChainSafe/lodestar/issu...) were Lodestar won't be able to sync due to a genesis time to far in the past and no peers to range sync historical data from.

Collapse
 
aakash4dev profile image
Aakash Singh Rajput

sir, can you also tell how to make rollups for blockchains ?