From cb203ff1e9929529570f4dc59b7b3cb6022ff670 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 20 Jun 2024 11:41:10 +0200 Subject: [PATCH] feat: add eof support (#682) --- .github/tests/eof.yaml | 12 ++ README.md | 4 + src/package_io/constants.star | 2 +- src/package_io/input_parser.star | 2 + src/participant_network.star | 22 +--- .../el_cl_genesis_generator.star | 111 +++++------------- .../el-cl/values.env.tmpl | 1 + 7 files changed, 48 insertions(+), 106 deletions(-) create mode 100644 .github/tests/eof.yaml diff --git a/.github/tests/eof.yaml b/.github/tests/eof.yaml new file mode 100644 index 000000000..977e29c39 --- /dev/null +++ b/.github/tests/eof.yaml @@ -0,0 +1,12 @@ +participants: + - el_type: besu + el_image: ethpandaops/besu:shemnon-eof-cancunEOF-fork + count: 3 + cl_type: teku + cl_image: ethpandaops/teku:master +network_params: + electra_fork_epoch: 1 + eof_activation_epoch: 2 +additional_services: + - dora + - blockscout diff --git a/README.md b/README.md index 9c9a68663..83ec80426 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,10 @@ network_params: # The fork version to set if the eip7594 fork is active eip7594_fork_version: "0x70000038" + # EOF activation fork epoch (EL only fork) + # Defaults to null + eof_activation_fork_epoch: null + # Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks) # Defaults to "https://ethpandaops-ethereum-node-snapshots.ams3.cdn.digitaloceanspaces.com/ # If you have a local snapshot, you can set this to the local url: diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 8d6b5df10..435357c1e 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -88,7 +88,7 @@ EIP7594_FORK_VERSION = "0x70000038" 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.2.1", # Default + deneb_genesis="ethpandaops/ethereum-genesis-generator:3.3.0", # Default verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis, waiting for rebase 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 c466043c3..4ff8d7dae 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -279,6 +279,7 @@ def input_parser(plan, input_args): electra_fork_epoch=result["network_params"]["electra_fork_epoch"], eip7594_fork_epoch=result["network_params"]["eip7594_fork_epoch"], eip7594_fork_version=result["network_params"]["eip7594_fork_version"], + eof_activation_epoch=result["network_params"]["eof_activation_epoch"], network=result["network_params"]["network"], min_validator_withdrawability_delay=result["network_params"][ "min_validator_withdrawability_delay" @@ -786,6 +787,7 @@ def default_network_params(): "electra_fork_epoch": 100000000, "eip7594_fork_epoch": 100000001, "eip7594_fork_version": "0x70000038", + "eof_activation_epoch": "", "network_sync_base_url": "https://ethpandaops-ethereum-node-snapshots.ams3.cdn.digitaloceanspaces.com/", "data_column_sidecar_subnet_count": 32, "samples_per_slot": 8, diff --git a/src/participant_network.star b/src/participant_network.star index 239d5cc4b..34ed4f0c0 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -90,29 +90,9 @@ def launch_participant_network( ethereum_genesis_generator_image, el_cl_genesis_config_template, final_genesis_timestamp, - network_id, - network_params.deposit_contract_address, - network_params.seconds_per_slot, - network_params.preregistered_validator_keys_mnemonic, + network_params, total_number_of_validator_keys, - network_params.genesis_delay, - network_params.max_per_epoch_activation_churn_limit, - network_params.churn_limit_quotient, - network_params.ejection_balance, - network_params.eth1_follow_distance, - network_params.deneb_fork_epoch, - network_params.electra_fork_epoch, - network_params.eip7594_fork_epoch, - network_params.eip7594_fork_version, latest_block.files_artifacts[0] if latest_block != "" else "", - network_params.min_validator_withdrawability_delay, - network_params.shard_committee_period, - network_params.data_column_sidecar_subnet_count, - network_params.samples_per_slot, - network_params.custody_requirement, - network_params.target_number_of_peers, - network_params.preset, - network_params.additional_preloaded_contracts, ) elif network_params.network in constants.PUBLIC_NETWORKS: # We are running a public network 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 61e9c3497..9cb19f515 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 @@ -14,29 +14,9 @@ def generate_el_cl_genesis_data( image, genesis_generation_config_yml_template, genesis_unix_timestamp, - network_id, - deposit_contract_address, - seconds_per_slot, - preregistered_validator_keys_mnemonic, + network_params, total_num_validator_keys_to_preregister, - genesis_delay, - max_per_epoch_activation_churn_limit, - churn_limit_quotient, - ejection_balance, - eth1_follow_distance, - deneb_fork_epoch, - electra_fork_epoch, - eip7594_fork_epoch, - eip7594_fork_version, latest_block, - min_validator_withdrawability_delay, - shard_committee_period, - data_column_sidecar_subnet_count, - samples_per_slot, - custody_requirement, - target_number_of_peers, - preset, - additional_preloaded_contracts, ): files = {} shadowfork_file = "" @@ -46,29 +26,9 @@ def generate_el_cl_genesis_data( template_data = new_env_file_for_el_cl_genesis_data( genesis_unix_timestamp, - network_id, - deposit_contract_address, - seconds_per_slot, - preregistered_validator_keys_mnemonic, total_num_validator_keys_to_preregister, - genesis_delay, - max_per_epoch_activation_churn_limit, - churn_limit_quotient, - ejection_balance, - eth1_follow_distance, - deneb_fork_epoch, - electra_fork_epoch, - eip7594_fork_epoch, - eip7594_fork_version, shadowfork_file, - min_validator_withdrawability_delay, - shard_committee_period, - data_column_sidecar_subnet_count, - samples_per_slot, - custody_requirement, - target_number_of_peers, - preset, - additional_preloaded_contracts, + network_params, ) genesis_generation_template = shared_utils.new_template_and_data( genesis_generation_config_yml_template, template_data @@ -138,58 +98,41 @@ def generate_el_cl_genesis_data( def new_env_file_for_el_cl_genesis_data( genesis_unix_timestamp, - network_id, - deposit_contract_address, - seconds_per_slot, - preregistered_validator_keys_mnemonic, total_num_validator_keys_to_preregister, - genesis_delay, - max_per_epoch_activation_churn_limit, - churn_limit_quotient, - ejection_balance, - eth1_follow_distance, - deneb_fork_epoch, - electra_fork_epoch, - eip7594_fork_epoch, - eip7594_fork_version, shadowfork_file, - min_validator_withdrawability_delay, - shard_committee_period, - data_column_sidecar_subnet_count, - samples_per_slot, - custody_requirement, - target_number_of_peers, - preset, - additional_preloaded_contracts, + network_params, ): return { "UnixTimestamp": genesis_unix_timestamp, - "NetworkId": network_id, - "DepositContractAddress": deposit_contract_address, - "SecondsPerSlot": seconds_per_slot, - "PreregisteredValidatorKeysMnemonic": preregistered_validator_keys_mnemonic, + "NetworkId": network_params.network_id, + "DepositContractAddress": network_params.deposit_contract_address, + "SecondsPerSlot": network_params.seconds_per_slot, + "PreregisteredValidatorKeysMnemonic": network_params.preregistered_validator_keys_mnemonic, "NumValidatorKeysToPreregister": total_num_validator_keys_to_preregister, - "GenesisDelay": genesis_delay, - "MaxPerEpochActivationChurnLimit": max_per_epoch_activation_churn_limit, - "ChurnLimitQuotient": churn_limit_quotient, - "EjectionBalance": ejection_balance, - "Eth1FollowDistance": eth1_follow_distance, - "DenebForkEpoch": deneb_fork_epoch, - "ElectraForkEpoch": electra_fork_epoch, - "EIP7594ForkEpoch": eip7594_fork_epoch, - "EIP7594ForkVersion": eip7594_fork_version, + "GenesisDelay": network_params.genesis_delay, + "MaxPerEpochActivationChurnLimit": network_params.max_per_epoch_activation_churn_limit, + "ChurnLimitQuotient": network_params.churn_limit_quotient, + "EjectionBalance": network_params.ejection_balance, + "Eth1FollowDistance": network_params.eth1_follow_distance, + "DenebForkEpoch": network_params.deneb_fork_epoch, + "ElectraForkEpoch": network_params.electra_fork_epoch, + "EIP7594ForkEpoch": network_params.eip7594_fork_epoch, + "EIP7594ForkVersion": network_params.eip7594_fork_version, + "EOFActivationEpoch": network_params.eof_activation_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, "ShadowForkFile": shadowfork_file, - "MinValidatorWithdrawabilityDelay": min_validator_withdrawability_delay, - "ShardCommitteePeriod": shard_committee_period, - "DataColumnSidecarSubnetCount": data_column_sidecar_subnet_count, - "SamplesPerSlot": samples_per_slot, - "CustodyRequirement": custody_requirement, - "TargetNumberOfPeers": target_number_of_peers, - "Preset": preset, - "AdditionalPreloadedContracts": json.encode(additional_preloaded_contracts), + "MinValidatorWithdrawabilityDelay": network_params.min_validator_withdrawability_delay, + "ShardCommitteePeriod": network_params.shard_committee_period, + "DataColumnSidecarSubnetCount": network_params.data_column_sidecar_subnet_count, + "SamplesPerSlot": network_params.samples_per_slot, + "CustodyRequirement": network_params.custody_requirement, + "TargetNumberOfPeers": network_params.target_number_of_peers, + "Preset": network_params.preset, + "AdditionalPreloadedContracts": json.encode( + network_params.additional_preloaded_contracts + ), } 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 b25f4e4fe..97012b3d6 100644 --- a/static_files/genesis-generation-config/el-cl/values.env.tmpl +++ b/static_files/genesis-generation-config/el-cl/values.env.tmpl @@ -16,6 +16,7 @@ export ELECTRA_FORK_VERSION="{{ .ElectraForkVersion }}" export ELECTRA_FORK_EPOCH="{{ .ElectraForkEpoch }}" export EIP7594_FORK_EPOCH="{{ .EIP7594ForkEpoch }}" export EIP7594_FORK_VERSION="{{ .EIP7594ForkVersion }}" +export EOF_ACTIVATION_EPOCH="{{ .EOFActivationEpoch }}" export WITHDRAWAL_TYPE="0x00" export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134 export GENESIS_TIMESTAMP={{ .UnixTimestamp }}