Skip to content

Commit

Permalink
feat: add checkpoint_enabled and checkpoint_url flags (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jun 24, 2024
1 parent 6571a70 commit b8cd2b4
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/tests/mix-public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ participants:
cl_type: grandine
additional_services: []
port_publisher:
public_port_start: 40000
public_port_start: 30000
1 change: 1 addition & 0 deletions .github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:

assertoor:
runs-on: self-hosted-ghr-size-l-x64
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,12 @@ global_node_selectors: {}
# Defaults to false
keymanager_enabled: false
# Global flag to enable checkpoint sync across the network
checkpoint_sync_enabled: false
# Global flag to set checkpoint sync url
checkpoint_sync_url: ""
# Global paarameter to set the exit ip address of services and public ports
port_publisher:
# if you have a service that you want to expose on a specific interfact; set that IP here
Expand Down
2 changes: 2 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def run(plan, args={}):
global_node_selectors,
keymanager_enabled,
parallel_keystore_generation,
args_with_right_defaults.checkpoint_sync_enabled,
args_with_right_defaults.checkpoint_sync_url,
args_with_right_defaults.port_publisher,
)

Expand Down
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ network_params:
custody_requirement: 1
target_number_of_peers: 70
additional_preloaded_contracts: {}
devnet_repo: ethpandaops
checkpoint_sync_enabled: false
additional_services:
- tx_spammer
- blob_spammer
Expand Down
6 changes: 6 additions & 0 deletions src/cl/cl_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def launch(
validator_data,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
plan.print("Launching CL network")
Expand Down Expand Up @@ -176,6 +178,8 @@ def launch(
node_selectors,
participant.use_separate_vc,
participant.keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
else:
Expand Down Expand Up @@ -210,6 +214,8 @@ def launch(
node_selectors,
participant.use_separate_vc,
participant.keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)

Expand Down
34 changes: 22 additions & 12 deletions src/cl/grandine/grandine_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def launch(
node_selectors,
use_separate_vc,
keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
beacon_service_name = "{0}".format(service_name)
Expand Down Expand Up @@ -150,6 +152,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)

Expand Down Expand Up @@ -230,6 +234,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
validator_keys_dirpath = ""
Expand Down Expand Up @@ -311,6 +317,22 @@ def get_beacon_config(
# "--validator-api-bearer-file=" + constants.KEYMANAGER_MOUNT_PATH_ON_CONTAINER, Not yet supported
]

# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled:
if checkpoint_sync_url:
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if network in ["mainnet", "ephemery"]:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
else:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)

if network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--configuration-directory="
Expand All @@ -331,9 +353,6 @@ def get_beacon_config(
)
)
elif network == constants.NETWORK_NAME.ephemery:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--boot-nodes="
+ shared_utils.get_devnet_enrs_list(
Expand All @@ -348,21 +367,12 @@ def get_beacon_config(
)
)
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(
"--boot-nodes="
+ shared_utils.get_devnet_enrs_list(
plan, el_cl_genesis_data.files_artifact_uuid
)
)
else: # Public networks
cmd.append("--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network])

if len(extra_params) > 0:
# we do the list comprehension as the default extra_params is a proto repeated string
Expand Down
33 changes: 22 additions & 11 deletions src/cl/lighthouse/lighthouse_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def launch(
node_selectors,
use_separate_vc,
keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
beacon_service_name = "{0}".format(service_name)
Expand Down Expand Up @@ -151,6 +153,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)

Expand Down Expand Up @@ -246,6 +250,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
# If snooper is enabled use the snooper engine context, otherwise use the execution client context
Expand Down Expand Up @@ -324,6 +330,22 @@ def get_beacon_config(
"--enable-private-discovery",
]

# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled:
if checkpoint_sync_url:
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if network in ["mainnet", "ephemery"]:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
else:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)

if network not in constants.PUBLIC_NETWORKS:
cmd.append("--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER)
if (
Expand All @@ -341,23 +363,13 @@ def get_beacon_config(
)
)
elif network == constants.NETWORK_NAME.ephemery:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--boot-nodes="
+ 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(
"--boot-nodes="
+ shared_utils.get_devnet_enrs_list(
Expand All @@ -366,7 +378,6 @@ def get_beacon_config(
)
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
31 changes: 22 additions & 9 deletions src/cl/lodestar/lodestar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def launch(
node_selectors,
use_separate_vc,
keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
beacon_service_name = "{0}".format(service_name)
Expand Down Expand Up @@ -139,6 +141,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
launcher.preset,
)
Expand Down Expand Up @@ -239,6 +243,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
preset,
):
Expand Down Expand Up @@ -305,6 +311,22 @@ def get_beacon_config(
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
]

# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled:
if checkpoint_sync_url:
cmd.append("--checkpointSyncUrl=" + checkpoint_sync_url)
else:
if network in ["mainnet", "ephemery"]:
cmd.append(
"--checkpointSyncUrl=" + constants.CHECKPOINT_SYNC_URL[network]
)
else:
cmd.append(
"--checkpointSyncUrl=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)

if network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--paramsFile="
Expand All @@ -331,21 +353,13 @@ def get_beacon_config(
)
)
elif network == constants.NETWORK_NAME.ephemery:
cmd.append("--checkpointSyncUrl=" + constants.CHECKPOINT_SYNC_URL[network])
cmd.append(
"--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(
Expand All @@ -354,7 +368,6 @@ def get_beacon_config(
)
else: # Public testnet
cmd.append("--network=" + network)
cmd.append("--checkpointSyncUrl=" + constants.CHECKPOINT_SYNC_URL[network])

if len(extra_params) > 0:
# this is a repeated<proto type>, we convert it into Starlark
Expand Down
6 changes: 6 additions & 0 deletions src/cl/nimbus/nimbus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def launch(
node_selectors,
use_separate_vc,
keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
beacon_service_name = "{0}".format(service_name)
Expand Down Expand Up @@ -166,6 +168,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)

Expand Down Expand Up @@ -246,6 +250,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
validator_keys_dirpath = ""
Expand Down
Loading

0 comments on commit b8cd2b4

Please sign in to comment.