Commit 853417ef authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add checkpoint sync capabilities to nimbus (#804)

parent fce1bf02
...@@ -3,7 +3,6 @@ participants: ...@@ -3,7 +3,6 @@ participants:
cl_type: teku cl_type: teku
- el_type: nethermind - el_type: nethermind
cl_type: prysm cl_type: prysm
cl_image: gcr.io/prysmaticlabs/prysm/beacon-chain:stable
- el_type: erigon - el_type: erigon
cl_type: nimbus cl_type: nimbus
- el_type: besu - el_type: besu
......
...@@ -5,78 +5,30 @@ participants: ...@@ -5,78 +5,30 @@ participants:
supernode: true supernode: true
cl_extra_params: cl_extra_params:
- --minimum-peers-per-subnet=1 - --minimum-peers-per-subnet=1
count: 3 count: 2
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: lighthouse - cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable cl_image: ethpandaops/lighthouse:unstable
supernode: true supernode: true
count: 3 count: 2
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: teku - cl_type: teku
cl_image: ethpandaops/teku:nashatyrev-das cl_image: ethpandaops/teku:nashatyrev-das
supernode: true supernode: true
count: 3 count: 2
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: nimbus - cl_type: nimbus
cl_image: ethpandaops/nimbus-eth2:pdsync cl_image: ethpandaops/nimbus-eth2:pdsync
supernode: true supernode: true
cl_extra_params: cl_extra_params:
- --sync-light-client=no - --sync-light-client=no
count: 3 count: 2
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: lodestar - cl_type: lodestar
cl_image: ethpandaops/lodestar:peerDAS cl_image: ethpandaops/lodestar:peerDAS
supernode: true supernode: true
cl_extra_params: cl_extra_params:
- --persistNetworkIdentity - --persistNetworkIdentity
count: 3 count: 2
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: grandine - cl_type: grandine
cl_image: ethpandaops/grandine:hangleang-fix-negotiation-timeout cl_image: ethpandaops/grandine:hangleang-fix-negotiation-timeout
supernode: true supernode: true
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
# Full nodes # Full nodes
- cl_type: prysm - cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:peerDAS cl_image: ethpandaops/prysm-beacon-chain:peerDAS
...@@ -84,71 +36,23 @@ participants: ...@@ -84,71 +36,23 @@ participants:
- --minimum-peers-per-subnet=1 - --minimum-peers-per-subnet=1
- --data-columns-withhold-count=64 - --data-columns-withhold-count=64
count: 3 count: 3
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: lighthouse - cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable cl_image: ethpandaops/lighthouse:unstable
count: 3 count: 3
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: lodestar - cl_type: lodestar
cl_image: ethpandaops/lodestar:peerDAS cl_image: ethpandaops/lodestar:peerDAS
cl_extra_params: [--persistNetworkIdentity] cl_extra_params: [--persistNetworkIdentity]
count: 3 count: 3
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: nimbus - cl_type: nimbus
cl_image: ethpandaops/nimbus-eth2:pdsync cl_image: ethpandaops/nimbus-eth2:pdsync
cl_extra_params: cl_extra_params:
- --sync-light-client=no - --sync-light-client=no
count: 3 count: 3
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: teku - cl_type: teku
cl_image: ethpandaops/teku:nashatyrev-das cl_image: ethpandaops/teku:nashatyrev-das
count: 3 count: 3
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
- cl_type: grandine - cl_type: grandine
cl_image: ethpandaops/grandine:hangleang-fix-negotiation-timeout cl_image: ethpandaops/grandine:hangleang-fix-negotiation-timeout
cl_min_cpu: 1000
cl_min_mem: 1024
cl_max_cpu: 4000
cl_max_mem: 8096
el_min_cpu: 1000
el_min_mem: 1024
el_max_cpu: 4000
el_max_mem: 8096
network_params: network_params:
eip7594_fork_epoch: 0 eip7594_fork_epoch: 0
eip7594_fork_version: "0x50000038" eip7594_fork_version: "0x50000038"
......
participants: participants:
# Supernodes # Supernodes
- cl_type: prysm - cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:peerDAS-df42f37 cl_image: ethpandaops/prysm-beacon-chain:peerDAS
supernode: true supernode: true
- cl_type: lighthouse - cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable-2792705 cl_image: ethpandaops/lighthouse:unstable
supernode: true supernode: true
- cl_type: teku - cl_type: teku
cl_image: ethpandaops/teku:nashatyrev-das-458f7e7 cl_image: ethpandaops/teku:nashatyrev-das
supernode: true supernode: true
- cl_type: nimbus - cl_type: nimbus
cl_image: ethpandaops/nimbus-eth2:pdsync-30f8ef9 cl_image: ethpandaops/nimbus-eth2:pdsync
supernode: true supernode: true
- cl_type: lodestar - cl_type: lodestar
cl_image: ethpandaops/lodestar:peerDAS-a3de70f cl_image: ethpandaops/lodestar:peerDAS
supernode: true supernode: true
- cl_type: grandine - cl_type: grandine
cl_image: ethpandaops/grandine:hangleang-feature-das-2c2f74b cl_image: ethpandaops/grandine:hangleang-feature-das
supernode: true supernode: true
# Fullnodes # Fullnodes
- cl_type: prysm - cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:peerDAS-df42f37 cl_image: ethpandaops/prysm-beacon-chain:peerDAS
- cl_type: lighthouse - cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable-2792705 cl_image: ethpandaops/lighthouse:unstable
- cl_type: teku - cl_type: teku
cl_image: ethpandaops/teku:nashatyrev-das-458f7e7 cl_image: ethpandaops/teku:nashatyrev-das
- cl_type: nimbus - cl_type: nimbus
cl_image: ethpandaops/nimbus-eth2:pdsync-30f8ef9 cl_image: ethpandaops/nimbus-eth2:pdsync
- cl_type: lodestar - cl_type: lodestar
cl_image: ethpandaops/lodestar:peerDAS-a3de70f cl_image: ethpandaops/lodestar:peerDAS
- cl_type: grandine - cl_type: grandine
cl_image: ethpandaops/grandine:hangleang-feature-das-2c2f74b cl_image: ethpandaops/grandine:hangleang-feature-das
network_params: network_params:
network: peerdas-devnet-2 network: peerdas-devnet-3
snooper_enabled: true snooper_enabled: true
additional_services: additional_services:
- dora - dora
...@@ -146,6 +146,21 @@ def launch( ...@@ -146,6 +146,21 @@ def launch(
snooper_engine_context snooper_engine_context
) )
) )
if checkpoint_sync_enabled:
if checkpoint_sync_url == "":
if (
network_params.network in constants.PUBLIC_NETWORKS
or network_params.network == constants.NETWORK_NAME.ephemery
):
checkpoint_sync_url = constants.CHECKPOINT_SYNC_URL[
network_params.network
]
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
all_snooper_engine_contexts.append(snooper_engine_context) all_snooper_engine_contexts.append(snooper_engine_context)
full_name = "{0}-{1}-{2}".format(index_str, el_type, cl_type) full_name = "{0}-{1}-{2}".format(index_str, el_type, cl_type)
if index == 0: if index == 0:
......
...@@ -237,23 +237,8 @@ def get_beacon_config( ...@@ -237,23 +237,8 @@ def get_beacon_config(
if participant.supernode: if participant.supernode:
cmd.extend(supernode_cmd) cmd.extend(supernode_cmd)
# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled: if checkpoint_sync_enabled:
if checkpoint_sync_url: cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if (
launcher.network in constants.PUBLIC_NETWORKS
or launcher.network == constants.NETWORK_NAME.ephemery
):
cmd.append(
"--checkpoint-sync-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
if launcher.network not in constants.PUBLIC_NETWORKS: if launcher.network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
......
...@@ -251,23 +251,8 @@ def get_beacon_config( ...@@ -251,23 +251,8 @@ def get_beacon_config(
if participant.supernode: if participant.supernode:
cmd.extend(supernode_cmd) cmd.extend(supernode_cmd)
# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled: if checkpoint_sync_enabled:
if checkpoint_sync_url: cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if (
launcher.network in constants.PUBLIC_NETWORKS
or launcher.network == constants.NETWORK_NAME.ephemery
):
cmd.append(
"--checkpoint-sync-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
if launcher.network not in constants.PUBLIC_NETWORKS: if launcher.network not in constants.PUBLIC_NETWORKS:
cmd.append("--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER) cmd.append("--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER)
......
...@@ -234,23 +234,8 @@ def get_beacon_config( ...@@ -234,23 +234,8 @@ def get_beacon_config(
if participant.supernode: if participant.supernode:
cmd.extend(supernode_cmd) cmd.extend(supernode_cmd)
# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled: if checkpoint_sync_enabled:
if checkpoint_sync_url: cmd.append("--checkpointSyncUrl=" + checkpoint_sync_url)
cmd.append("--checkpointSyncUrl=" + checkpoint_sync_url)
else:
if (
launcher.network in constants.PUBLIC_NETWORKS
or launcher.network == constants.NETWORK_NAME.ephemery
):
cmd.append(
"--checkpointSyncUrl="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
if launcher.network not in constants.PUBLIC_NETWORKS: if launcher.network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
......
...@@ -22,7 +22,7 @@ BEACON_MIN_CPU = 50 ...@@ -22,7 +22,7 @@ BEACON_MIN_CPU = 50
BEACON_MIN_MEMORY = 256 BEACON_MIN_MEMORY = 256
DEFAULT_BEACON_IMAGE_ENTRYPOINT = ["nimbus_beacon_node"] DEFAULT_BEACON_IMAGE_ENTRYPOINT = ["nimbus_beacon_node"]
BEACON_NODE_ENTRYPOINT = "/home/user/nimbus-eth2/build/nimbus_beacon_node"
BEACON_METRICS_PATH = "/metrics" BEACON_METRICS_PATH = "/metrics"
VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENTS = "/data/nimbus/validator-keys" VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENTS = "/data/nimbus/validator-keys"
...@@ -203,7 +203,17 @@ def get_beacon_config( ...@@ -203,7 +203,17 @@ def get_beacon_config(
} }
used_ports = shared_utils.get_port_specs(used_port_assignments) used_ports = shared_utils.get_port_specs(used_port_assignments)
nimbus_checkpoint_sync_subtask_str = "{0} trustedNodeSync --data-dir={1} --trusted-node-url={2} --network={3} --backfill=false".format(
BEACON_NODE_ENTRYPOINT,
BEACON_DATA_DIRPATH_ON_SERVICE_CONTAINER,
checkpoint_sync_url,
launcher.network
if launcher.network in constants.PUBLIC_NETWORKS
else constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER,
)
cmd = [ cmd = [
"{0}".format(BEACON_NODE_ENTRYPOINT),
"--non-interactive=true", "--non-interactive=true",
"--log-level=" + log_level, "--log-level=" + log_level,
"--udp-port={0}".format(discovery_port), "--udp-port={0}".format(discovery_port),
...@@ -306,13 +316,20 @@ def get_beacon_config( ...@@ -306,13 +316,20 @@ def get_beacon_config(
], ],
) )
cmd_str = " ".join(cmd)
if checkpoint_sync_enabled:
command_str = " && ".join([nimbus_checkpoint_sync_subtask_str, cmd_str])
else:
command_str = cmd_str
config_args = { config_args = {
"image": participant.cl_image, "image": participant.cl_image,
"ports": used_ports, "ports": used_ports,
"public_ports": public_ports, "public_ports": public_ports,
"cmd": cmd, "cmd": [command_str],
"files": files, "files": files,
"env_vars": participant.cl_extra_env_vars, "env_vars": participant.cl_extra_env_vars,
"entrypoint": ENTRYPOINT_ARGS,
"private_ip_address_placeholder": constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, "private_ip_address_placeholder": constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
"ready_conditions": cl_node_ready_conditions.get_ready_conditions( "ready_conditions": cl_node_ready_conditions.get_ready_conditions(
constants.HTTP_PORT_ID constants.HTTP_PORT_ID
......
...@@ -224,31 +224,9 @@ def get_beacon_config( ...@@ -224,31 +224,9 @@ def get_beacon_config(
if participant.supernode: if participant.supernode:
cmd.extend(supernode_cmd) cmd.extend(supernode_cmd)
# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled: if checkpoint_sync_enabled:
if checkpoint_sync_url: cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url) cmd.append("--genesis-beacon-api-url=" + checkpoint_sync_url)
cmd.append(
"--genesis-beacon-api-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
if (
launcher.network in constants.PUBLIC_NETWORKS
or launcher.network == constants.NETWORK_NAME.ephemery
):
cmd.append(
"--checkpoint-sync-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
cmd.append(
"--genesis-beacon-api-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
if launcher.preset == "minimal": if launcher.preset == "minimal":
cmd.append("--minimal-config=true") cmd.append("--minimal-config=true")
......
...@@ -254,23 +254,8 @@ def get_beacon_config( ...@@ -254,23 +254,8 @@ def get_beacon_config(
if participant.supernode: if participant.supernode:
cmd.extend(supernode_cmd) cmd.extend(supernode_cmd)
# If checkpoint sync is enabled, add the checkpoint sync url
if checkpoint_sync_enabled: if checkpoint_sync_enabled:
if checkpoint_sync_url: cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
cmd.append("--checkpoint-sync-url=" + checkpoint_sync_url)
else:
if (
launcher.network in constants.PUBLIC_NETWORKS
or launcher.network == constants.NETWORK_NAME.ephemery
):
cmd.append(
"--checkpoint-sync-url="
+ constants.CHECKPOINT_SYNC_URL[launcher.network]
)
else:
fail(
"Checkpoint sync URL is required if you enabled checkpoint_sync for custom networks. Please provide a valid URL."
)
if launcher.network not in constants.PUBLIC_NETWORKS: if launcher.network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
......
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