Skip to content

Commit

Permalink
feat: Add peerdas support (#591)
Browse files Browse the repository at this point in the history
Co-authored-by: Barnabas Busa <busa.barnabas@gmail.com>
  • Loading branch information
parithosh and barnabasbusa committed May 6, 2024
1 parent b789e17 commit 14296ca
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/tests/peerdas-fork.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
participants:
- el_type: geth
cl_type: teku
- el_type: nethermind
cl_type: prysm
- el_type: erigon
cl_type: nimbus
- el_type: besu
cl_type: lighthouse
- el_type: reth
cl_type: lodestar
- el_type: ethereumjs
cl_type: teku
network_params:
eip7594_fork_epoch: 1
additional_services: []
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,14 @@ network_params:
# Defaults to 256 epoch ~27 hours
shard_committee_period: 256

# The epoch at which the deneb/electra forks are set to occur.
# 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.
deneb_fork_epoch: 0
electra_fork_epoch: 500
eip7594_fork_epoch: 1000

# The fork version to set if the eip7594 fork is active
eip7594_fork_version: "0x70000038"

# Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks)
# Defaults to "https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/
Expand Down
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ network_params:
shard_committee_period: 256
deneb_fork_epoch: 0
electra_fork_epoch: 500
eip7594_fork_epoch: 1000
eip7594_fork_version: "0x70000038"
network_sync_base_url: https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/
additional_services:
- tx_spammer
Expand Down
5 changes: 5 additions & 0 deletions src/network_launcher/kurtosis.star
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def launch(plan, network_params, participants, parallel_keystore_generation):
ethereum_genesis_generator_image = (
constants.ETHEREUM_GENESIS_GENERATOR.capella_genesis
)
# we are running in deneb genesis, but only one fork is allowed to be active at a time
elif network_params.electra_fork_epoch == network_params.eip7594_fork_epoch:
fail(
"Unsupported fork epoch configuration, need to define either electra_fork_epoch or eip7594_fork_epoch"
)
# we are running deneb genesis - default behavior
elif network_params.deneb_fork_epoch == 0:
ethereum_genesis_generator_image = (
Expand Down
3 changes: 2 additions & 1 deletion src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ BELLATRIX_FORK_VERSION = "0x30000038"
CAPELLA_FORK_VERSION = "0x40000038"
DENEB_FORK_VERSION = "0x50000038"
ELECTRA_FORK_VERSION = "0x60000038"
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.0.5", # Default
deneb_genesis="ethpandaops/ethereum-genesis-generator:3.1.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
6 changes: 6 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ def input_parser(plan, input_args):
eth1_follow_distance=result["network_params"]["eth1_follow_distance"],
deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"],
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"],
network=result["network_params"]["network"],
min_validator_withdrawability_delay=result["network_params"][
"min_validator_withdrawability_delay"
Expand Down Expand Up @@ -692,6 +694,8 @@ def default_network_params():
"shard_committee_period": 256,
"deneb_fork_epoch": 0,
"electra_fork_epoch": 500,
"eip7594_fork_epoch": 1000,
"eip7594_fork_version": "0x70000038",
"network_sync_base_url": "https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/",
"preset": "mainnet",
}
Expand All @@ -714,6 +718,8 @@ def default_minimal_network_params():
"shard_committee_period": 64,
"deneb_fork_epoch": 0,
"electra_fork_epoch": 500,
"eip7594_fork_epoch": 1000,
"eip7594_fork_version": "0x70000038",
"network_sync_base_url": "https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/",
"preset": "minimal",
}
Expand Down
2 changes: 2 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def launch_participant_network(
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def generate_el_cl_genesis_data(
eth1_follow_distance,
deneb_fork_epoch,
electra_fork_epoch,
eip7594_fork_epoch,
eip7594_fork_version,
latest_block,
min_validator_withdrawability_delay,
shard_committee_period,
Expand All @@ -49,6 +51,8 @@ def generate_el_cl_genesis_data(
eth1_follow_distance,
deneb_fork_epoch,
electra_fork_epoch,
eip7594_fork_epoch,
eip7594_fork_version,
shadowfork_file,
min_validator_withdrawability_delay,
shard_committee_period,
Expand Down Expand Up @@ -129,6 +133,8 @@ def new_env_file_for_el_cl_genesis_data(
eth1_follow_distance,
deneb_fork_epoch,
electra_fork_epoch,
eip7594_fork_epoch,
eip7594_fork_version,
shadowfork_file,
min_validator_withdrawability_delay,
shard_committee_period,
Expand All @@ -147,6 +153,8 @@ def new_env_file_for_el_cl_genesis_data(
"Eth1FollowDistance": eth1_follow_distance,
"DenebForkEpoch": deneb_fork_epoch,
"ElectraForkEpoch": electra_fork_epoch,
"EIP7594ForkEpoch": eip7594_fork_epoch,
"EIP7594ForkVersion": eip7594_fork_version,
"GenesisForkVersion": constants.GENESIS_FORK_VERSION,
"BellatrixForkVersion": constants.BELLATRIX_FORK_VERSION,
"CapellaForkVersion": constants.CAPELLA_FORK_VERSION,
Expand Down
2 changes: 2 additions & 0 deletions static_files/genesis-generation-config/el-cl/values.env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export DENEB_FORK_VERSION="{{ .DenebForkVersion }}"
export DENEB_FORK_EPOCH="{{ .DenebForkEpoch }}"
export ELECTRA_FORK_VERSION="{{ .ElectraForkVersion }}"
export ELECTRA_FORK_EPOCH="{{ .ElectraForkEpoch }}"
export EIP7594_FORK_EPOCH="{{ .EIP7594ForkEpoch }}"
export EIP7594_FORK_VERSION="{{ .EIP7594ForkVersion }}"
export WITHDRAWAL_TYPE="0x00"
export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134
export GENESIS_TIMESTAMP={{ .UnixTimestamp }}
Expand Down

0 comments on commit 14296ca

Please sign in to comment.