Skip to content

Commit

Permalink
feat: add eof support (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jun 20, 2024
1 parent 75ed7e1 commit cb203ff
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 106 deletions.
12 changes: 12 additions & 0 deletions .github/tests/eof.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
2 changes: 2 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
22 changes: 1 addition & 21 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand All @@ -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
Expand Down Expand Up @@ -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
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit cb203ff

Please sign in to comment.