Skip to content

Commit

Permalink
feat: make eth1 follow distance configurable (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jan 3, 2024
1 parent 4d4fac0 commit a40f7dc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ network_params:
# 16000000000 gwei
ejection_balance: 16000000000,
# ETH1 follow distance
# Defaults to 2048
eth1_follow_distance: 2048
# The epoch at which the capella and deneb forks are set to occur.
capella_fork_epoch: 0
deneb_fork_epoch: 500
Expand Down
1 change: 0 additions & 1 deletion src/cl/teku/teku_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ def get_beacon_config(
"--metrics-categories=BEACON,PROCESS,LIBP2P,JVM,NETWORK,PROCESS",
"--metrics-port={0}".format(BEACON_METRICS_PORT_NUM),
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
"--Xtrusted-setup=" + constants.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER,
]
validator_flags = [
"--validator-keys={0}:{1}".format(
Expand Down
1 change: 0 additions & 1 deletion src/el/besu/besu_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def get_config(
"--engine-rpc-port={0}".format(ENGINE_HTTP_RPC_PORT_NUM),
"--sync-mode=FULL",
"--data-storage-format=BONSAI",
"--kzg-trusted-setup=" + constants.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER,
"--metrics-enabled=true",
"--metrics-host=0.0.0.0",
"--metrics-port={0}".format(METRICS_PORT_NUM),
Expand Down
1 change: 0 additions & 1 deletion src/el/nethermind/nethermind_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def get_config(
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/chainspec.json",
"--Init.WebSocketsEnabled=true",
"--Init.KzgSetupPath=" + constants.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER,
"--config=none.cfg",
"--JsonRpc.Enabled=true",
"--JsonRpc.EnabledModules=net,eth,consensus,subscribe,web3,admin",
Expand Down
5 changes: 1 addition & 4 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER = (

JWT_AUTH_PATH = GENESIS_DATA_MOUNTPOINT_ON_CLIENTS + "/data/jwt/jwtsecret"

KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER = (
GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/trusted_setup.txt"
)

GENESIS_FORK_VERSION = "0x10000038"
BELLATRIX_FORK_VERSION = "0x30000038"
CAPELLA_FORK_VERSION = "0x40000038"
DENEB_FORK_VERSION = "0x50000038"
ELECTRA_FORK_VERSION = "0x60000038"
2 changes: 2 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def input_parser(plan, input_args):
genesis_delay=result["network_params"]["genesis_delay"],
max_churn=result["network_params"]["max_churn"],
ejection_balance=result["network_params"]["ejection_balance"],
eth1_follow_distance=result["network_params"]["eth1_follow_distance"],
capella_fork_epoch=result["network_params"]["capella_fork_epoch"],
deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"],
electra_fork_epoch=result["network_params"]["electra_fork_epoch"],
Expand Down Expand Up @@ -418,6 +419,7 @@ def default_network_params():
"genesis_delay": 120,
"max_churn": 8,
"ejection_balance": 16000000000,
"eth1_follow_distance": 2048,
"capella_fork_epoch": 0,
"deneb_fork_epoch": 500,
"electra_fork_epoch": None,
Expand Down
7 changes: 4 additions & 3 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ def launch_participant_network(
and network_params.electra_fork_epoch == None
):
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:2.0.6"
"ethpandaops/ethereum-genesis-generator:2.0.8"
)
# we are running electra - experimental
elif network_params.electra_fork_epoch != None:
if network_params.electra_fork_epoch == 0:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:4.0.0-rc.3"
"ethpandaops/ethereum-genesis-generator:4.0.0-rc.4"
)
else:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.17"
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.18"
)
else:
fail(
Expand All @@ -134,6 +134,7 @@ def launch_participant_network(
network_params.genesis_delay,
network_params.max_churn,
network_params.ejection_balance,
network_params.eth1_follow_distance,
network_params.capella_fork_epoch,
network_params.deneb_fork_epoch,
network_params.electra_fork_epoch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def generate_el_cl_genesis_data(
genesis_delay,
max_churn,
ejection_balance,
eth1_follow_distance,
capella_fork_epoch,
deneb_fork_epoch,
electra_fork_epoch,
Expand All @@ -35,6 +36,7 @@ def generate_el_cl_genesis_data(
genesis_delay,
max_churn,
ejection_balance,
eth1_follow_distance,
capella_fork_epoch,
deneb_fork_epoch,
electra_fork_epoch,
Expand Down Expand Up @@ -84,6 +86,7 @@ def new_env_file_for_el_cl_genesis_data(
genesis_delay,
max_churn,
ejection_balance,
eth1_follow_distance,
capella_fork_epoch,
deneb_fork_epoch,
electra_fork_epoch,
Expand All @@ -98,11 +101,13 @@ def new_env_file_for_el_cl_genesis_data(
"GenesisDelay": genesis_delay,
"MaxChurn": max_churn,
"EjectionBalance": ejection_balance,
"Eth1FollowDistance": eth1_follow_distance,
"CapellaForkEpoch": capella_fork_epoch,
"DenebForkEpoch": deneb_fork_epoch,
"ElectraForkEpoch": electra_fork_epoch,
"GenesisForkVersion": constants.GENESIS_FORK_VERSION,
"BellatrixForkVersion": constants.BELLATRIX_FORK_VERSION,
"CapellaForkVersion": constants.CAPELLA_FORK_VERSION,
"DenebForkVersion": constants.DENEB_FORK_VERSION,
"ElectraForkVersion": constants.ELECTRA_FORK_VERSION,
}
5 changes: 3 additions & 2 deletions static_files/genesis-generation-config/el-cl/values.env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export CAPELLA_FORK_VERSION="{{ .CapellaForkVersion }}"
export CAPELLA_FORK_EPOCH="{{ .CapellaForkEpoch }}"
export DENEB_FORK_VERSION="{{ .DenebForkVersion }}"
export DENEB_FORK_EPOCH="{{ .DenebForkEpoch }}"
export ELECTRA_FORK_VERSION="0x60000038"
export ELECTRA_FORK_VERSION="{{ .ElectraForkVersion }}"
export ELECTRA_FORK_EPOCH="{{ .ElectraForkEpoch }}"
export WITHDRAWAL_TYPE="0x00"
export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134
export GENESIS_TIMESTAMP={{ .UnixTimestamp }}
export GENESIS_DELAY={{ .GenesisDelay }}
export MAX_CHURN={{ .MaxChurn }}
export EJECTION_BALANCE=16000000000
export EJECTION_BALANCE={{ .EjectionBalance }}
export ETH1_FOLLOW_DISTANCE={{ .Eth1FollowDistance }}

0 comments on commit a40f7dc

Please sign in to comment.