Skip to content

Commit

Permalink
feat: support older forks (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Dec 6, 2024
1 parent 6b7b019 commit d7e31e0
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 28 deletions.
24 changes: 24 additions & 0 deletions .github/tests/altair-genesis.yaml
Original file line number Diff line number Diff line change
@@ -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

23 changes: 23 additions & 0 deletions .github/tests/bellatrix-genesis.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/tests/capella-genesis.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions .github/tests/deneb.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/tests/fulu.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/tests/phase0-genesis.yaml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
23 changes: 5 additions & 18 deletions src/network_launcher/kurtosis.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
)

Expand Down
13 changes: 9 additions & 4 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion static_files/genesis-generation-config/el-cl/values.env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit d7e31e0

Please sign in to comment.