From d7e31e01ca6fff88c64ee3846d517e2f32d7bbcf Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 6 Dec 2024 15:45:28 +0100 Subject: [PATCH] feat: support older forks (#846) --- .github/tests/altair-genesis.yaml | 24 +++++++++++++++++++ .github/tests/bellatrix-genesis.yaml | 23 ++++++++++++++++++ .github/tests/capella-genesis.yaml | 23 ++++++++++++++++++ ...dencun-genesis.yaml => deneb-genesis.yaml} | 6 +++++ .github/tests/deneb.yaml | 23 ++++++++++++++++++ .github/tests/fulu.yaml | 23 ++++++++++++++++++ .github/tests/phase0-genesis.yaml | 23 ++++++++++++++++++ README.md | 21 +++++++++++++++- src/network_launcher/kurtosis.star | 23 ++++-------------- src/package_io/constants.star | 5 ++-- src/package_io/input_parser.star | 13 ++++++---- src/package_io/sanity_check.star | 3 +++ .../el_cl_genesis_generator.star | 6 ++++- .../el-cl/values.env.tmpl | 5 +++- 14 files changed, 193 insertions(+), 28 deletions(-) create mode 100644 .github/tests/altair-genesis.yaml create mode 100644 .github/tests/bellatrix-genesis.yaml create mode 100644 .github/tests/capella-genesis.yaml rename .github/tests/{dencun-genesis.yaml => deneb-genesis.yaml} (67%) create mode 100644 .github/tests/deneb.yaml create mode 100644 .github/tests/fulu.yaml create mode 100644 .github/tests/phase0-genesis.yaml diff --git a/.github/tests/altair-genesis.yaml b/.github/tests/altair-genesis.yaml new file mode 100644 index 000000000..848ec4253 --- /dev/null +++ b/.github/tests/altair-genesis.yaml @@ -0,0 +1,24 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 1 + capella_fork_epoch: 2 + deneb_fork_epoch: 3 + electra_fork_epoch: 4 + fulu_fork_epoch: 5 + genesis_delay: 120 + diff --git a/.github/tests/bellatrix-genesis.yaml b/.github/tests/bellatrix-genesis.yaml new file mode 100644 index 000000000..a3251507c --- /dev/null +++ b/.github/tests/bellatrix-genesis.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 0 + capella_fork_epoch: 1 + deneb_fork_epoch: 2 + electra_fork_epoch: 3 + fulu_fork_epoch: 4 + genesis_delay: 120 diff --git a/.github/tests/capella-genesis.yaml b/.github/tests/capella-genesis.yaml new file mode 100644 index 000000000..ac3c320bb --- /dev/null +++ b/.github/tests/capella-genesis.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 0 + capella_fork_epoch: 0 + deneb_fork_epoch: 1 + electra_fork_epoch: 2 + fulu_fork_epoch: 3 + genesis_delay: 120 diff --git a/.github/tests/dencun-genesis.yaml b/.github/tests/deneb-genesis.yaml similarity index 67% rename from .github/tests/dencun-genesis.yaml rename to .github/tests/deneb-genesis.yaml index e4ba69438..61f9d6b70 100644 --- a/.github/tests/dencun-genesis.yaml +++ b/.github/tests/deneb-genesis.yaml @@ -12,4 +12,10 @@ participants: - el_type: ethereumjs cl_type: teku network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 0 + capella_fork_epoch: 0 deneb_fork_epoch: 0 + electra_fork_epoch: 1 + fulu_fork_epoch: 2 + genesis_delay: 120 diff --git a/.github/tests/deneb.yaml b/.github/tests/deneb.yaml new file mode 100644 index 000000000..a58daf8b5 --- /dev/null +++ b/.github/tests/deneb.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 0 + capella_fork_epoch: 0 + deneb_fork_epoch: 1 + electra_fork_epoch: 2 + fulu_fork_epoch: 3 + preset: minimal diff --git a/.github/tests/fulu.yaml b/.github/tests/fulu.yaml new file mode 100644 index 000000000..76c651fad --- /dev/null +++ b/.github/tests/fulu.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 0 + bellatrix_fork_epoch: 0 + capella_fork_epoch: 0 + deneb_fork_epoch: 0 + electra_fork_epoch: 0 + fulu_fork_epoch: 1 + preset: minimal diff --git a/.github/tests/phase0-genesis.yaml b/.github/tests/phase0-genesis.yaml new file mode 100644 index 000000000..be9c05ea9 --- /dev/null +++ b/.github/tests/phase0-genesis.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: reth + cl_type: prysm + - el_type: nethermind + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: nimbus + cl_type: lodestar + - el_type: erigon + cl_type: grandine +additional_services: + - dora +network_params: + altair_fork_epoch: 1 + bellatrix_fork_epoch: 2 + capella_fork_epoch: 3 + deneb_fork_epoch: 4 + electra_fork_epoch: 5 + fulu_fork_epoch: 6 + genesis_delay: 120 diff --git a/README.md b/README.md index 1a6c29b3b..f82e14bc7 100644 --- a/README.md +++ b/README.md @@ -536,14 +536,33 @@ network_params: # The epoch at which the deneb/electra/eip7594(peerdas) forks are set to occur. Note: PeerDAS and Electra clients are currently # working on forks. So set either one of the below forks. + # Altair fork epoch + # Defaults to 0 + altair_fork_epoch: 0 + + # Bellatrix fork epoch + # Defaults to 0 + bellatrix_fork_epoch: 0 + + # Capella fork epoch + # Defaults to 0 + capella_fork_epoch: 0 + + # Deneb fork epoch + # Defaults to 0 deneb_fork_epoch: 0 + # Electra fork epoch + # Defaults to 100000000 electra_fork_epoch: 100000000 + # Fulu fork epoch + # Defaults to 100000001 fulu_fork_epoch: 100000001 + # Eip7594 fork epoch + # Defaults to 100000002 eip7594_fork_epoch: 100000002 - # The fork version to set if the eip7594 fork is active eip7594_fork_version: "0x60000038" diff --git a/src/network_launcher/kurtosis.star b/src/network_launcher/kurtosis.star index 2a5e45884..252868747 100644 --- a/src/network_launcher/kurtosis.star +++ b/src/network_launcher/kurtosis.star @@ -57,30 +57,17 @@ def launch( plan.print("Generating EL CL data") - # we are running capella genesis - deprecated - if network_params.deneb_fork_epoch > 0: - ethereum_genesis_generator_image = shared_utils.docker_cache_image_calc( - args_with_right_defaults.docker_cache_params, - constants.ETHEREUM_GENESIS_GENERATOR.capella_genesis, - ) - # we are running deneb genesis - default behavior - elif network_params.deneb_fork_epoch == 0: - ethereum_genesis_generator_image = shared_utils.docker_cache_image_calc( - args_with_right_defaults.docker_cache_params, - constants.ETHEREUM_GENESIS_GENERATOR.deneb_genesis, - ) + ethereum_genesis_generator_image = shared_utils.docker_cache_image_calc( + args_with_right_defaults.docker_cache_params, + constants.ETHEREUM_GENESIS_GENERATOR.default_genesis_generator_image, + ) # we are running electra - experimental - elif network_params.electra_fork_epoch != None: + if network_params.electra_fork_epoch != None: if network_params.electra_fork_epoch == 0: ethereum_genesis_generator_image = shared_utils.docker_cache_image_calc( args_with_right_defaults.docker_cache_params, constants.ETHEREUM_GENESIS_GENERATOR.verkle_genesis, ) - else: - ethereum_genesis_generator_image = shared_utils.docker_cache_image_calc( - args_with_right_defaults.docker_cache_params, - constants.ETHEREUM_GENESIS_GENERATOR.verkle_support_genesis, - ) else: fail( "Unsupported fork epoch configuration, need to define either deneb_fork_epoch or electra_fork_epoch" diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 5f692b002..4100f455f 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -103,6 +103,7 @@ DEFAULT_MNEMONIC = "giant issue aisle success illegal bike spike question tent b PRIVATE_IP_ADDRESS_PLACEHOLDER = "KURTOSIS_IP_ADDR_PLACEHOLDER" GENESIS_FORK_VERSION = "0x10000038" +ALTAIR_FORK_VERSION = "0x20000038" BELLATRIX_FORK_VERSION = "0x30000038" CAPELLA_FORK_VERSION = "0x40000038" DENEB_FORK_VERSION = "0x50000038" @@ -123,9 +124,7 @@ CONTAINER_REGISTRY = struct( ETHEREUM_GENESIS_GENERATOR = struct( - capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated (no support for minimal config) - deneb_genesis="ethpandaops/ethereum-genesis-generator:3.4.1", # Default - verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis, waiting for rebase + default_genesis_generator_image="ethpandaops/ethereum-genesis-generator:3.4.3", # Default verkle_genesis="ethpandaops/ethereum-genesis-generator:verkle-gen-v1.0.0", ) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index a3ed80186..2f2956324 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -313,6 +313,9 @@ def input_parser(plan, input_args): churn_limit_quotient=result["network_params"]["churn_limit_quotient"], ejection_balance=result["network_params"]["ejection_balance"], eth1_follow_distance=result["network_params"]["eth1_follow_distance"], + altair_fork_epoch=result["network_params"]["altair_fork_epoch"], + bellatrix_fork_epoch=result["network_params"]["bellatrix_fork_epoch"], + 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"], fulu_fork_epoch=result["network_params"]["fulu_fork_epoch"], @@ -744,10 +747,6 @@ def parse_network_params(plan, input_args): + " is not supported, it can only be mainnet or minimal" ) - if result["network_params"]["preset"] == "minimal": - if result["network_params"]["deneb_fork_epoch"] > 0: - fail("minimal preset only supports deneb genesis fork epoch") - return result @@ -865,6 +864,9 @@ def default_network_params(): "eth1_follow_distance": 2048, "min_validator_withdrawability_delay": 256, "shard_committee_period": 256, + "altair_fork_epoch": 0, + "bellatrix_fork_epoch": 0, + "capella_fork_epoch": 0, "deneb_fork_epoch": 0, "electra_fork_epoch": constants.ELECTRA_FORK_EPOCH, "fulu_fork_epoch": constants.FULU_FORK_EPOCH, @@ -899,6 +901,9 @@ def default_minimal_network_params(): "eth1_follow_distance": 16, "min_validator_withdrawability_delay": 256, "shard_committee_period": 64, + "altair_fork_epoch": 0, + "bellatrix_fork_epoch": 0, + "capella_fork_epoch": 0, "deneb_fork_epoch": 0, "electra_fork_epoch": constants.ELECTRA_FORK_EPOCH, "fulu_fork_epoch": constants.FULU_FORK_EPOCH, diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index b79e4e464..72a403526 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -153,6 +153,9 @@ SUBCATEGORY_PARAMS = { "eth1_follow_distance", "min_validator_withdrawability_delay", "shard_committee_period", + "altair_fork_epoch", + "bellatrix_fork_epoch", + "capella_fork_epoch", "deneb_fork_epoch", "electra_fork_epoch", "fulu_fork_epoch", diff --git a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star index fbbeb8196..1fe188365 100644 --- a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star +++ b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star @@ -49,7 +49,7 @@ def generate_el_cl_genesis_data( genesis = plan.run_sh( name="run-generate-genesis", description="Creating genesis", - run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/metadata/* /network-configs/", + run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/metadata/* /network-configs/ && mv /data/parsed /network-configs/parsed", image=image, files=files, store=[ @@ -107,12 +107,16 @@ def new_env_file_for_el_cl_genesis_data( "ChurnLimitQuotient": network_params.churn_limit_quotient, "EjectionBalance": network_params.ejection_balance, "Eth1FollowDistance": network_params.eth1_follow_distance, + "AltairForkEpoch": network_params.altair_fork_epoch, + "BellatrixForkEpoch": network_params.bellatrix_fork_epoch, + "CapellaForkEpoch": network_params.capella_fork_epoch, "DenebForkEpoch": network_params.deneb_fork_epoch, "ElectraForkEpoch": network_params.electra_fork_epoch, "FuluForkEpoch": network_params.fulu_fork_epoch, "EIP7594ForkEpoch": network_params.eip7594_fork_epoch, "EIP7594ForkVersion": network_params.eip7594_fork_version, "GenesisForkVersion": constants.GENESIS_FORK_VERSION, + "AltairForkVersion": constants.ALTAIR_FORK_VERSION, "BellatrixForkVersion": constants.BELLATRIX_FORK_VERSION, "CapellaForkVersion": constants.CAPELLA_FORK_VERSION, "DenebForkVersion": constants.DENEB_FORK_VERSION, diff --git a/static_files/genesis-generation-config/el-cl/values.env.tmpl b/static_files/genesis-generation-config/el-cl/values.env.tmpl index 9eb01b2ea..d593ba1ee 100644 --- a/static_files/genesis-generation-config/el-cl/values.env.tmpl +++ b/static_files/genesis-generation-config/el-cl/values.env.tmpl @@ -7,9 +7,12 @@ export SLOT_DURATION_IN_SECONDS={{ .SecondsPerSlot }} export DEPOSIT_CONTRACT_BLOCK="0x0000000000000000000000000000000000000000000000000000000000000000" export NUMBER_OF_VALIDATORS={{ .NumValidatorKeysToPreregister }} export GENESIS_FORK_VERSION="{{ .GenesisForkVersion }}" -export ALTAIR_FORK_VERSION="0x20000038" +export ALTAIR_FORK_VERSION="{{ .AltairForkVersion }}" +export ALTAIR_FORK_EPOCH="{{ .AltairForkEpoch }}" export BELLATRIX_FORK_VERSION="{{ .BellatrixForkVersion }}" +export BELLATRIX_FORK_EPOCH="{{ .BellatrixForkEpoch }}" export CAPELLA_FORK_VERSION="{{ .CapellaForkVersion }}" +export CAPELLA_FORK_EPOCH="{{ .CapellaForkEpoch }}" export DENEB_FORK_VERSION="{{ .DenebForkVersion }}" export DENEB_FORK_EPOCH="{{ .DenebForkEpoch }}" export ELECTRA_FORK_VERSION="{{ .ElectraForkVersion }}"