Skip to content

Commit

Permalink
Merge pull request #46 from ethpandaops/barnabasbusa-patch-1
Browse files Browse the repository at this point in the history
Set Capella as the the starting state
  • Loading branch information
barnabasbusa authored Jul 13, 2023
2 parents 5b0268f + 3070615 commit 8d45ff7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/el-gen/genesis_besu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": int(data['genesis_timestamp'] + data['genesis_delay']),
},
"alloc": {
# Allocate 1 wei to all possible pre-compiles.
Expand Down
8 changes: 4 additions & 4 deletions apps/el-gen/genesis_chainspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": 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": {
Expand Down
2 changes: 1 addition & 1 deletion apps/el-gen/genesis_geth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": int(data['genesis_timestamp'] + data['genesis_delay']),
},
"alloc": {
# Allocate 1 wei to all possible pre-compiles.
Expand Down
2 changes: 1 addition & 1 deletion config-example/cl/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion config-example/el/genesis-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
3 changes: 1 addition & 2 deletions config-example/values.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ 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="20000"
export WITHDRAWAL_TYPE="0x00"
export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134
export BEACON_STATIC_ENR="enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk"
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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..."
Expand Down

0 comments on commit 8d45ff7

Please sign in to comment.