From 3717c5279fd5d2e4c18d84cd8423bab9ec469533 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 7 Jul 2023 12:43:56 +0200 Subject: [PATCH 1/4] Update entrypoint.sh to support capella as the the starting state Signed-off-by: Barnabas Busa --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index afb9d1c..833933f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -54,7 +54,7 @@ gen_cl_config(){ envsubst < /config/cl/mnemonics.yaml > $tmp_dir/mnemonics.yaml # Generate genesis genesis_args=( - bellatrix + capella --config /data/custom_config_data/config.yaml --mnemonics $tmp_dir/mnemonics.yaml --tranches-dir /data/custom_config_data/tranches From a2ca4f695b224bfd7488ebbf2b699d3f59457d7a Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 7 Jul 2023 13:53:23 +0200 Subject: [PATCH 2/4] update bellatrix to capella --- apps/el-gen/genesis_besu.py | 2 +- apps/el-gen/genesis_chainspec.py | 8 ++++---- apps/el-gen/genesis_geth.py | 2 +- config-example/cl/config.yaml | 2 +- config-example/el/genesis-config.yaml | 1 - config-example/values.env | 5 ++--- entrypoint.sh | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/el-gen/genesis_besu.py b/apps/el-gen/genesis_besu.py index 1d5b792..e39cdca 100644 --- a/apps/el-gen/genesis_besu.py +++ b/apps/el-gen/genesis_besu.py @@ -44,7 +44,7 @@ "londonBlock":0, "preMergeForkBlock":0, "terminalTotalDifficulty":0, - "shanghaiTime": int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds'])), + "shanghaiTime":0, }, "alloc": { # Allocate 1 wei to all possible pre-compiles. diff --git a/apps/el-gen/genesis_chainspec.py b/apps/el-gen/genesis_chainspec.py index 0be1c4c..d7a05bd 100644 --- a/apps/el-gen/genesis_chainspec.py +++ b/apps/el-gen/genesis_chainspec.py @@ -70,10 +70,10 @@ "eip3198Transition": "0x0", "eip3529Transition": "0x0", "eip3541Transition": "0x0", - "eip4895TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds']))), - "eip3855TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds']))), - "eip3651TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds']))), - "eip3860TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds']))), + "eip4895TransitionTimestamp": "0x0", + "eip3855TransitionTimestamp": "0x0", + "eip3651TransitionTimestamp": "0x0", + "eip3860TransitionTimestamp": "0x0", "terminalTotalDifficulty":"0x0" }, "genesis": { diff --git a/apps/el-gen/genesis_geth.py b/apps/el-gen/genesis_geth.py index cdbf225..3d752a9 100644 --- a/apps/el-gen/genesis_geth.py +++ b/apps/el-gen/genesis_geth.py @@ -45,7 +45,7 @@ "mergeForkBlock":0, "terminalTotalDifficulty":0, "terminalTotalDifficultyPassed": True, - "shanghaiTime": int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds'])), + "shanghaiTime":0, }, "alloc": { # Allocate 1 wei to all possible pre-compiles. diff --git a/config-example/cl/config.yaml b/config-example/cl/config.yaml index f420625..fc0f599 100644 --- a/config-example/cl/config.yaml +++ b/config-example/cl/config.yaml @@ -31,7 +31,7 @@ TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 # Capella CAPELLA_FORK_VERSION: $CAPELLA_FORK_VERSION -CAPELLA_FORK_EPOCH: $CAPELLA_FORK_EPOCH +CAPELLA_FORK_EPOCH: 0 # DENEB DENEB_FORK_VERSION: $DENEB_FORK_VERSION diff --git a/config-example/el/genesis-config.yaml b/config-example/el/genesis-config.yaml index d8c68ed..954c665 100644 --- a/config-example/el/genesis-config.yaml +++ b/config-example/el/genesis-config.yaml @@ -12,5 +12,4 @@ el_premine_addrs: {} genesis_timestamp: ${GENESIS_TIMESTAMP} genesis_delay: ${GENESIS_DELAY} slot_duration_in_seconds: ${SLOT_DURATION_IN_SECONDS} -capella_fork_epoch: ${CAPELLA_FORK_EPOCH} deneb_fork_epoch: ${DENEB_FORK_EPOCH} diff --git a/config-example/values.env b/config-example/values.env index 8156293..57a7bf4 100644 --- a/config-example/values.env +++ b/config-example/values.env @@ -9,12 +9,11 @@ export GENESIS_FORK_VERSION="0x10000000" export ALTAIR_FORK_VERSION="0x20000000" export BELLATRIX_FORK_VERSION="0x30000000" export CAPELLA_FORK_VERSION="0x40000000" -export CAPELLA_FORK_EPOCH="100000" export DENEB_FORK_VERSION="0x50000000" -export DENEB_FORK_EPOCH="200000" +export DENEB_FORK_EPOCH="5" export WITHDRAWAL_TYPE="0x00" export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134 export BEACON_STATIC_ENR="enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" #export SHADOW_FORK_RPC="http://docker.for.mac.localhost:8545" -export GENESIS_TIMESTAMP=0 +export GENESIS_TIMESTAMP=1688730952 export GENESIS_DELAY=60 diff --git a/entrypoint.sh b/entrypoint.sh index 833933f..82becae 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -69,7 +69,7 @@ gen_cl_config(){ genesis_args+=(--eth1-config /data/custom_config_data/genesis.json) fi /usr/local/bin/eth2-testnet-genesis "${genesis_args[@]}" - /usr/local/bin/zcli pretty bellatrix BeaconState /data/custom_config_data/genesis.ssz > /data/custom_config_data/parsedBeaconState.json + /usr/local/bin/zcli pretty capella BeaconState /data/custom_config_data/genesis.ssz > /data/custom_config_data/parsedBeaconState.json jq -r '.eth1_data.block_hash' /data/custom_config_data/parsedBeaconState.json > /data/custom_config_data/deposit_contract_block_hash.txt else echo "cl genesis already exists. skipping generation..." From 2ef618c0a0d022c93d5802dfb4478a08f9e9d695 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 7 Jul 2023 16:50:18 +0200 Subject: [PATCH 3/4] revert shanghai time from 0 to genesis time --- apps/el-gen/genesis_besu.py | 2 +- apps/el-gen/genesis_chainspec.py | 8 ++++---- apps/el-gen/genesis_geth.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/el-gen/genesis_besu.py b/apps/el-gen/genesis_besu.py index e39cdca..205e2dc 100644 --- a/apps/el-gen/genesis_besu.py +++ b/apps/el-gen/genesis_besu.py @@ -44,7 +44,7 @@ "londonBlock":0, "preMergeForkBlock":0, "terminalTotalDifficulty":0, - "shanghaiTime":0, + "shanghaiTime": int(data['genesis_timestamp'] + data['genesis_delay']), }, "alloc": { # Allocate 1 wei to all possible pre-compiles. diff --git a/apps/el-gen/genesis_chainspec.py b/apps/el-gen/genesis_chainspec.py index d7a05bd..2617077 100644 --- a/apps/el-gen/genesis_chainspec.py +++ b/apps/el-gen/genesis_chainspec.py @@ -70,10 +70,10 @@ "eip3198Transition": "0x0", "eip3529Transition": "0x0", "eip3541Transition": "0x0", - "eip4895TransitionTimestamp": "0x0", - "eip3855TransitionTimestamp": "0x0", - "eip3651TransitionTimestamp": "0x0", - "eip3860TransitionTimestamp": "0x0", + "eip4895TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay'])), + "eip3855TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay'])), + "eip3651TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay'])), + "eip3860TransitionTimestamp": hex(int(data['genesis_timestamp']) + int(data['genesis_delay'])), "terminalTotalDifficulty":"0x0" }, "genesis": { diff --git a/apps/el-gen/genesis_geth.py b/apps/el-gen/genesis_geth.py index 3d752a9..ebe3cb3 100644 --- a/apps/el-gen/genesis_geth.py +++ b/apps/el-gen/genesis_geth.py @@ -45,7 +45,7 @@ "mergeForkBlock":0, "terminalTotalDifficulty":0, "terminalTotalDifficultyPassed": True, - "shanghaiTime":0, + "shanghaiTime": int(data['genesis_timestamp'] + data['genesis_delay']), }, "alloc": { # Allocate 1 wei to all possible pre-compiles. From 30706150cf454a94d276b5d0d7515df45d4ff6a1 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 13 Jul 2023 17:13:38 +0200 Subject: [PATCH 4/4] revert the defaults --- config-example/values.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config-example/values.env b/config-example/values.env index 57a7bf4..fab30dd 100644 --- a/config-example/values.env +++ b/config-example/values.env @@ -10,10 +10,10 @@ export ALTAIR_FORK_VERSION="0x20000000" export BELLATRIX_FORK_VERSION="0x30000000" export CAPELLA_FORK_VERSION="0x40000000" export DENEB_FORK_VERSION="0x50000000" -export DENEB_FORK_EPOCH="5" +export DENEB_FORK_EPOCH="20000" export WITHDRAWAL_TYPE="0x00" export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134 export BEACON_STATIC_ENR="enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" #export SHADOW_FORK_RPC="http://docker.for.mac.localhost:8545" -export GENESIS_TIMESTAMP=1688730952 +export GENESIS_TIMESTAMP=0 export GENESIS_DELAY=60