Commit b8cd2b45 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add checkpoint_enabled and checkpoint_url flags (#689)

parent 6571a70b
......@@ -15,4 +15,4 @@ participants:
cl_type: grandine
additional_services: []
port_publisher:
public_port_start: 40000
public_port_start: 30000
......@@ -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
......
......@@ -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
......
......@@ -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,
)
......
......@@ -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
......
......@@ -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")
......@@ -176,6 +178,8 @@ def launch(
node_selectors,
participant.use_separate_vc,
participant.keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
else:
......@@ -210,6 +214,8 @@ def launch(
node_selectors,
participant.use_separate_vc,
participant.keymanager_enabled,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......
......@@ -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)
......@@ -150,6 +152,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......@@ -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 = ""
......@@ -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="
......@@ -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(
......@@ -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
......
......@@ -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)
......@@ -151,6 +153,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......@@ -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
......@@ -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 (
......@@ -341,9 +363,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(
......@@ -351,13 +370,6 @@ 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(
......@@ -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
......
......@@ -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)
......@@ -139,6 +141,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
launcher.preset,
)
......@@ -239,6 +243,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
preset,
):
......@@ -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="
......@@ -331,7 +353,6 @@ 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(
......@@ -339,13 +360,6 @@ 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(
"--checkpointSyncUrl=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--bootnodes="
+ shared_utils.get_devnet_enrs_list(
......@@ -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
......
......@@ -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)
......@@ -166,6 +168,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......@@ -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 = ""
......
......@@ -92,6 +92,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)
......@@ -147,6 +149,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
launcher.preset,
)
......@@ -226,6 +230,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
preset,
):
......@@ -284,6 +290,30 @@ 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("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if network in ["mainnet", "ephemery"]:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--genesis-beacon-api-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
else:
cmd.append(
"--checkpoint-sync-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
cmd.append(
"--genesis-beacon-api-url=https://checkpoint-sync.{0}.ethpandaops.io".format(
network
)
)
if preset == "minimal":
cmd.append("--minimal-config=true")
......@@ -311,36 +341,19 @@ def get_beacon_config(
cmd.append(
"--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"
+ "/bootstrap_nodes.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"
+ "/bootstrap_nodes.yaml"
)
else: # Public network
cmd.append("--{}".format(network))
cmd.append("--genesis-beacon-api-url=" + constants.CHECKPOINT_SYNC_URL[network])
cmd.append("--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network])
if len(extra_params) > 0:
# we do the for loop as otherwise its a proto repeated array
......
......@@ -93,6 +93,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)
......@@ -155,6 +157,8 @@ def launch(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......@@ -237,6 +241,8 @@ def get_beacon_config(
cl_volume_size,
tolerations,
node_selectors,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
validator_keys_dirpath = ""
......@@ -335,6 +341,22 @@ def get_beacon_config(
"--Xvalidator-api-unsafe-hosts-enabled=true",
]
# 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(
"--initial-state="
......@@ -356,9 +378,6 @@ def get_beacon_config(
)
)
elif network == constants.NETWORK_NAME.ephemery:
cmd.append(
"--checkpoint-sync-url=" + constants.CHECKPOINT_SYNC_URL[network]
)
cmd.append(
"--p2p-discovery-bootnodes="
+ shared_utils.get_devnet_enrs_list(
......@@ -373,21 +392,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(
"--p2p-discovery-bootnodes="
+ 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
......
......@@ -117,8 +117,6 @@ NETWORK_ID = {
CHECKPOINT_SYNC_URL = {
"mainnet": "https://beaconstate.info",
"sepolia": "https://checkpoint-sync.sepolia.ethpandaops.io",
"holesky": "https://checkpoint-sync.holesky.ethpandaops.io",
"ephemery": "https://checkpointz.bordel.wtf/",
}
......
......@@ -6,7 +6,7 @@ genesis_constants = import_module(
DEFAULT_EL_IMAGES = {
"geth": "ethereum/client-go:latest",
"erigon": "ethpandaops/erigon:main",
"erigon": "ethpandaops/erigon:main-6d80c0f",
"nethermind": "nethermindeth/nethermind:master",
"besu": "hyperledger/besu:latest",
"reth": "ghcr.io/paradigmxyz/reth",
......@@ -374,6 +374,8 @@ def input_parser(plan, input_args):
global_tolerations=result["global_tolerations"],
global_node_selectors=result["global_node_selectors"],
keymanager_enabled=result["keymanager_enabled"],
checkpoint_sync_enabled=result["checkpoint_sync_enabled"],
checkpoint_sync_url=result["checkpoint_sync_url"],
port_publisher=struct(
public_port_start=result["port_publisher"]["public_port_start"],
nat_exit_ip=result["port_publisher"]["nat_exit_ip"],
......@@ -761,6 +763,8 @@ def default_input_args(input_args):
"global_tolerations": [],
"global_node_selectors": {},
"keymanager_enabled": False,
"checkpoint_sync_enabled": False,
"checkpoint_sync_url": "",
"port_publisher": {
"nat_exit_ip": constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
"public_port_start": None,
......
......@@ -40,6 +40,8 @@ def launch_participant_network(
global_node_selectors,
keymanager_enabled,
parallel_keystore_generation,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
):
network_id = network_params.network_id
......@@ -176,6 +178,8 @@ def launch_participant_network(
validator_data,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
checkpoint_sync_enabled,
checkpoint_sync_url,
port_publisher,
)
......
......@@ -94,7 +94,7 @@ def get_devnet_enodes(plan, filename):
files={constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: filename},
wait=None,
run="""
with open("/network-configs/bootnode.txt") as bootnode_file:
with open("/network-configs/enodes.txt") as bootnode_file:
bootnodes = []
for line in bootnode_file:
line = line.strip()
......@@ -211,7 +211,7 @@ def calculate_devnet_url(network, repo):
devnet_name.split("-")[1] + "-" if len(devnet_name.split("-")) > 1 else ""
)
return "github.com/{0}/{1}-devnets/network-configs/{2}{3}-{4}".format(
return "github.com/{0}/{1}-devnets/network-configs/{2}{3}-{4}/metadata".format(
repo, devnet_category, devnet_subname, network_type, devnet_number
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment