Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate assertoor as an additional service #331

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ethereum.star
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def run(plan, args):
"el_type": "geth",
"cl_type": "lighthouse",
"el_extra_params": ["--gcmode archive"],
"cl_extra_params": [
"--disable-optimistic-finalized-sync",
"--disable-backfill-rate-limiting",
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
],
"count": args["l1_participants_count"],
}
],
"network_params": {
Expand All @@ -21,6 +26,12 @@ def run(plan, args):
],
"preset": args["l1_preset"],
"seconds_per_slot": args["l1_seconds_per_slot"],
"eth1_follow_distance": args["l1_eth1_follow_distance"],
"min_validator_withdrawability_delay": args[
"l1_min_validator_withdrawability_delay"
],
"shard_committee_period": args["l1_shard_committee_period"],
"genesis_delay": args["l1_genesis_delay"],
},
"additional_services": args["l1_additional_services"],
},
Expand Down
21 changes: 17 additions & 4 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ DEFAULT_ACCOUNTS = {
# proofsigner
"zkevm_l2_proofsigner_address": "0x7569cc70950726784c8D3bB256F48e43259Cb445",
"zkevm_l2_proofsigner_private_key": "0x77254a70a02223acebf84b6ed8afddff9d3203e31ad219b2bf900f4780cf9b51",
# l1testing
"l1_deposit_account": "0xC196E8d1D15e15e5703f5Dba9F2b5d6ec35b5bbf",
"l1_deposit_account_private_key": "7ffefe81df12e9aeebba4f3671ece167c72aa0fe519a4e66e4c6f7630617b8c3",
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
}

DEFAULT_L1_ARGS = {
Expand Down Expand Up @@ -125,7 +128,7 @@ DEFAULT_L1_ARGS = {
# - apache
# - tracoor
# Check the ethereum-package for more details: https://github.com/ethpandaops/ethereum-package
"l1_additional_services": [],
"l1_additional_services": ["assertoor"],
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
# Preset for the network.
# Default: "mainnet"
# Options:
Expand All @@ -134,12 +137,22 @@ DEFAULT_L1_ARGS = {
# "minimal" preset will spin up a network with minimal preset. This is useful for rapid testing and development.
# 192 seconds to get to finalized epoch vs 1536 seconds with mainnet defaults
# Please note that minimal preset requires alternative client images.
"l1_preset": "minimal",
"l1_preset": "mainnet",
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
# Number of seconds per slot on the Beacon chain
# Default: 12
"l1_seconds_per_slot": 1,
# The amount of ETH sent to the admin, sequence, aggregator and sequencer addresses.
"l1_funding_amount": "100ether",
# The amount of ETH sent to the admin, sequence, aggregator, sequencer and other chosen addresses.
"l1_funding_amount": "1000000ether",
# Default: 2
"l1_participants_count": 1,
# Default: 2048
"l1_eth1_follow_distance": 1,
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
# Default: 256
"l1_min_validator_withdrawability_delay": 1,
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
# Default: 256
"l1_shard_committee_period": 1,
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
# Default: 12
"l1_genesis_delay": 12,
}

DEFAULT_ROLLUP_ARGS = {
Expand Down
3 changes: 3 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ panoptichain_package = "./src/additional_services/panoptichain.star"
pless_zkevm_node_package = "./src/additional_services/pless_zkevm_node.star"
prometheus_package = "./src/additional_services/prometheus.star"
tx_spammer_package = "./src/additional_services/tx_spammer.star"
assertoor_package = "./src/additional_services/assertoor.star"


def run(plan, args={}):
Expand Down Expand Up @@ -159,6 +160,8 @@ def run(plan, args={}):
deploy_additional_service(plan, "grafana", grafana_package, args)
elif additional_service == "tx_spammer":
deploy_additional_service(plan, "tx_spammer", tx_spammer_package, args)
elif additional_service == "assertoor":
deploy_additional_service(plan, "assertoor", assertoor_package, args)
else:
fail("Invalid additional service: %s" % (additional_service))

Expand Down
54 changes: 54 additions & 0 deletions src/additional_services/assertoor.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
HTTP_PORT_NUMBER = 8080

ASSERTOOR_IMAGE = "ethpandaops/assertoor:latest"
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved

ASSERTOOR_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config"

VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE = "/validator-ranges"
VALIDATOR_RANGES_ARTIFACT_NAME = "validator-ranges"


def run(plan, args):
assertoor_config_artifact = get_assertoor_config(plan, args)
plan.add_service(
name="assertoor" + args["deployment_suffix"],
config=ServiceConfig(
image=ASSERTOOR_IMAGE,
ports={
"http": PortSpec(
number=8080,
jhkimqd marked this conversation as resolved.
Show resolved Hide resolved
transport_protocol="TCP",
application_protocol="http",
)
},
files={
ASSERTOOR_CONFIG_MOUNT_DIRPATH_ON_SERVICE: assertoor_config_artifact,
VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME,
},
cmd=["--config", "/config/config.yaml"],
),
description="Starting assertoor service",
)


def get_assertoor_config(plan, args):
assertoor_config_template = read_file(
src="../../static_files/additional_services/assertoor-config/config.yaml"
)

assertoor_data = {
"assertoor_endpoint_name": "assertoor_web_ui",
"execution_client_url": args["l1_rpc_url"],
"consensus_client_url": args["l1_conensus_rpc_url"],
"http_port_number": HTTP_PORT_NUMBER,
}

return plan.render_templates(
name="assertoor-config",
config={
"config.yaml": struct(
template=assertoor_config_template,
data=assertoor_data | args,
)
},
)
14 changes: 14 additions & 0 deletions static_files/additional_services/assertoor-config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

endpoints:
- name: "{{.assertoor_endpoint_name}}"
executionUrl: "{{.execution_client_url}}"
consensusUrl: "{{.consensus_client_url}}"

web:
server:
host: "0.0.0.0"
port: "{{.http_port_number}}"
frontend:
enabled: true
debug: true
pprof: true
Loading