Skip to content

Commit

Permalink
feat: enable syncing ephemery (ethpandaops#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jan 19, 2024
1 parent b9523cb commit f8289cb
Show file tree
Hide file tree
Showing 23 changed files with 190 additions and 215 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ participants:
- el_client_type: nethermind
el_client_image: ethpandaops/nethermind:master
cl_client_type: prysm
cl_client_image: ethpandaops/prysm:develop,ethpandaops/prysm-validator:develop
cl_client_image: gcr.io/prysmaticlabs/prysm/beacon-chain:latest,gcr.io/prysmaticlabs/prysm/validator:latest
- el_client_type: erigon
el_client_image: ethpandaops/erigon:devel
cl_client_type: nimbus
Expand All @@ -24,5 +24,5 @@ participants:
cl_client_type: teku
cl_client_image: ethpandaops/teku:master
network_params:
network: "dencun-devnet-12"
network: "ephemery"
additional_services: []
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,7 @@ This note is from 2023-10-05
`flashbots/mev-boost-relay:0.27` and later support `capella_fork_epoch` at `0` but this seems to require a few flags enabled
on the `lighthouse` beacon client including `--always-prefer-builder-payload` and `--disable-peer-scoring`
Users are recommended to use [`examples/capella-mev.yaml`](./examples/capella-mev.yaml); as inspiration for reliable payload
delivery.
Users are recommended to browse the example tests [`./.github/tests`](./.github/tests); as inspiration for different ways to use the package.
## Pre-funded accounts at Genesis
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please find the example configurations in the [../.github/tests](../.github/tests) directory.
18 changes: 0 additions & 18 deletions examples/capella-mev.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions examples/dencun.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions examples/verkle-gen-nethermind.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions examples/verkle-gen.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions examples/verkle.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def run(plan, args={}):
all_cl_client_contexts,
args_with_right_defaults.participants,
)
if network_params.network == "kurtosis":
if network_params.network == constants.NETWORK_NAME.kurtosis:
if network_params.deneb_fork_epoch != 0:
plan.print("Launching 4788 contract deployer")
el_uri = "http://{0}:{1}".format(
Expand Down
71 changes: 42 additions & 29 deletions src/cl/lighthouse/lighthouse_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -353,46 +353,59 @@ def get_beacon_config(
"--metrics-allow-origin=*",
"--metrics-port={0}".format(BEACON_METRICS_PORT_NUM),
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
# Enable this flag once we have https://github.com/sigp/lighthouse/issues/5054 fixed
# "--allow-insecure-genesis-sync",
]

if network not in constants.PUBLIC_NETWORKS:
cmd.append("--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER)
else:
cmd.append("--network=" + network)
cmd.append("--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network])

if network == "kurtosis":
if boot_cl_client_ctxs != None:
if network == constants.NETWORK_NAME.kurtosis:
if boot_cl_client_ctxs != None:
cmd.append(
"--boot-nodes="
+ ",".join(
[
ctx.enr
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
)
)
cmd.append(
"--trusted-peers="
+ ",".join(
[
ctx.peer_id
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
)
)
elif network == constants.NETWORK_NAME.ephemery:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--boot-nodes="
+ ",".join(
[
ctx.enr
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
else: # Devnets
# TODO Remove once checkpoint sync is working for verkle
if constants.NETWORK_NAME.verkle not in network:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--trusted-peers="
+ ",".join(
[
ctx.peer_id
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
"--boot-nodes="
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--boot-nodes="
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
else: # Public networks
cmd.append("--network=" + network)
cmd.append("--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network])

if len(extra_params) > 0:
# this is a repeated<proto type>, we convert it into Starlark
Expand Down
20 changes: 15 additions & 5 deletions src/cl/lodestar/lodestar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def get_beacon_config(
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/genesis.ssz"
)
if network == "kurtosis": # kurtosis
if network == constants.NETWORK_NAME.kurtosis:
if bootnode_contexts != None:
cmd.append(
"--bootnodes="
Expand All @@ -338,19 +338,29 @@ def get_beacon_config(
]
)
)
else: # devnet
elif network == constants.NETWORK_NAME.ephemery:
cmd.append("--checkpointSyncUrl=" + constants.CHECKPOINT_SYNC_URL[network])
cmd.append(
"--checkpointSyncUrl=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
"--bootnodes="
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
else: # Devnets
# TODO Remove once checkpoint sync is working for verkle
if constants.NETWORK_NAME.verkle not in network:
cmd.append(
"--checkpointSyncUrl=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--bootnodes="
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
else: # public testnet
else: # Public testnet
cmd.append("--network=" + network)
cmd.append("--checkpointSyncUrl=" + constants.CHECKPOINT_SYNC_URL[network])

Expand Down
23 changes: 11 additions & 12 deletions src/cl/nimbus/nimbus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def launch(
)

# Holesky has a bigger memory footprint, so it needs more memory
if launcher.network == "holesky":
if launcher.network == constants.NETWORK_NAME.holesky:
holesky_beacon_memory_limit = 4096
bn_max_mem = (
int(bn_max_mem) if int(bn_max_mem) > 0 else holesky_beacon_memory_limit
Expand All @@ -160,7 +160,7 @@ def launch(

network_name = (
"devnets"
if launcher.network != "kurtosis"
if launcher.network != constants.NETWORK_NAME.kurtosis
and launcher.network not in constants.PUBLIC_NETWORKS
else launcher.network
)
Expand Down Expand Up @@ -374,21 +374,20 @@ def get_beacon_config(
if node_keystore_files != None and not split_mode_enabled:
cmd.extend(validator_flags)

if network == "kurtosis":
if bootnode_contexts == None:
# Copied from https://github.com/status-im/nimbus-eth2/blob/67ab477a27e358d605e99bffeb67f98d18218eca/scripts/launch_local_testnet.sh#L417
# See explanation there
cmd.append("--subscribe-all-subnets")
else:
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]:
cmd.append("--bootstrap-node=" + ctx.enr)
cmd.append("--direct-peer=" + ctx.multiaddr)
elif network not in constants.PUBLIC_NETWORKS:
if network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--bootstrap-file="
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/bootstrap_nodes.txt"
)
if network == constants.NETWORK_NAME.kurtosis:
if bootnode_contexts == None:
cmd.append("--subscribe-all-subnets")
else:
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]:
cmd.append("--bootstrap-node=" + ctx.enr)
cmd.append("--direct-peer=" + ctx.multiaddr)

if len(extra_params) > 0:
cmd.extend([param for param in extra_params])

Expand Down
30 changes: 25 additions & 5 deletions src/cl/prysm/prysm_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def get_beacon_config(
"--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM)
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
]

if network not in constants.PUBLIC_NETWORKS:
cmd.append("--p2p-static-id=true")
cmd.append(
Expand All @@ -336,22 +337,41 @@ def get_beacon_config(
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/genesis.ssz",
)
if network == "kurtosis": # Kurtosis
if network == constants.NETWORK_NAME.kurtosis:
if bootnode_contexts != None:
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]:
cmd.append("--peer=" + ctx.multiaddr)
cmd.append("--bootstrap-node=" + ctx.enr)
else: # Devnet
elif network == constants.NETWORK_NAME.ephemery:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
"--genesis-beacon-api-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--bootstrap-node="
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/boot_enr.yaml"
)
else: # Devnets
# TODO Remove once checkpoint sync is working for verkle
if constants.NETWORK_NAME.verkle not in network:
cmd.append(
"--genesis-beacon-api-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--bootstrap-node="
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/boot_enr.yaml"
)
else: # Public network
cmd.append("--{}".format(network))
cmd.append("--genesis-beacon-api-url=" + constants.CHECKPOINT_SYNC_URL[network])
Expand Down
Loading

0 comments on commit f8289cb

Please sign in to comment.