Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ethereum-package
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
ethereum-package
Commits
b824cac8
Unverified
Commit
b824cac8
authored
Jul 09, 2024
by
Barnabas Busa
Committed by
GitHub
Jul 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add sanity check (#710)
parent
2d1cab53
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
317 additions
and
4 deletions
+317
-4
mev.yaml
.github/tests/mev.yaml
+0
-1
README.md
README.md
+2
-2
network_params.yaml
network_params.yaml
+2
-1
input_parser.star
src/package_io/input_parser.star
+3
-0
sanity_check.star
src/package_io/sanity_check.star
+310
-0
No files found.
.github/tests/mev.yaml
View file @
b824cac8
...
@@ -11,7 +11,6 @@ additional_services:
...
@@ -11,7 +11,6 @@ additional_services:
-
dora
-
dora
-
prometheus_grafana
-
prometheus_grafana
mev_params
:
mev_params
:
launch_custom_flood
:
true
mev_relay_image
:
flashbots/mev-boost-relay:latest
mev_relay_image
:
flashbots/mev-boost-relay:latest
network_params
:
network_params
:
seconds_per_slot
:
3
seconds_per_slot
:
3
README.md
View file @
b824cac8
...
@@ -286,7 +286,7 @@ participants:
...
@@ -286,7 +286,7 @@ participants:
# Whether to use a separate validator client attached to the CL client.
# Whether to use a separate validator client attached to the CL client.
# Defaults to false for clients that can run both in one process (Teku, Nimbus)
# Defaults to false for clients that can run both in one process (Teku, Nimbus)
use_separate_vc
:
fals
e
use_separate_vc
:
tru
e
# VC (Validator Client) Specific flags
# VC (Validator Client) Specific flags
# The type of validator client that should be used
# The type of validator client that should be used
...
@@ -501,7 +501,7 @@ network_params:
...
@@ -501,7 +501,7 @@ network_params:
# EOF activation fork epoch (EL only fork)
# EOF activation fork epoch (EL only fork)
# Defaults to null
# Defaults to null
eof_activation_
fork_
epoch
:
null
eof_activation_epoch
:
null
# Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks)
# Network sync base url for syncing public networks from a custom snapshot (mostly useful for shadowforks)
# Defaults to "https://ethpandaops-ethereum-node-snapshots.ams3.cdn.digitaloceanspaces.com/
# Defaults to "https://ethpandaops-ethereum-node-snapshots.ams3.cdn.digitaloceanspaces.com/
...
...
network_params.yaml
View file @
b824cac8
...
@@ -83,7 +83,6 @@ network_params:
...
@@ -83,7 +83,6 @@ network_params:
target_number_of_peers
:
70
target_number_of_peers
:
70
additional_preloaded_contracts
:
{}
additional_preloaded_contracts
:
{}
devnet_repo
:
ethpandaops
devnet_repo
:
ethpandaops
checkpoint_sync_enabled
:
false
additional_services
:
[]
additional_services
:
[]
dora_params
:
dora_params
:
image
:
"
"
image
:
"
"
...
@@ -146,6 +145,8 @@ apache_port: 40000
...
@@ -146,6 +145,8 @@ apache_port: 40000
global_tolerations
:
[]
global_tolerations
:
[]
global_node_selectors
:
{}
global_node_selectors
:
{}
keymanager_enabled
:
false
keymanager_enabled
:
false
checkpoint_sync_enabled
:
false
checkpoint_sync_url
:
"
"
port_publisher
:
port_publisher
:
nat_exit_ip
:
KURTOSIS_IP_ADDR_PLACEHOLDER
nat_exit_ip
:
KURTOSIS_IP_ADDR_PLACEHOLDER
el
:
el
:
...
...
src/package_io/input_parser.star
View file @
b824cac8
...
@@ -4,6 +4,8 @@ genesis_constants = import_module(
...
@@ -4,6 +4,8 @@ genesis_constants = import_module(
"../prelaunch_data_generator/genesis_constants/genesis_constants.star"
"../prelaunch_data_generator/genesis_constants/genesis_constants.star"
)
)
sanity_check = import_module("./sanity_check.star")
DEFAULT_EL_IMAGES = {
DEFAULT_EL_IMAGES = {
"geth": "ethereum/client-go:latest",
"geth": "ethereum/client-go:latest",
"erigon": "ethpandaops/erigon:main",
"erigon": "ethpandaops/erigon:main",
...
@@ -78,6 +80,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
...
@@ -78,6 +80,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
def input_parser(plan, input_args):
def input_parser(plan, input_args):
sanity_check.sanity_check(plan, input_args)
result = parse_network_params(plan, input_args)
result = parse_network_params(plan, input_args)
# add default eth2 input params
# add default eth2 input params
...
...
src/package_io/sanity_check.star
0 → 100644
View file @
b824cac8
PARTICIPANT_CATEGORIES = {
"participants": [
"el_type",
"el_image",
"el_log_level",
"el_extra_env_vars",
"el_extra_labels",
"el_extra_params",
"el_tolerations",
"el_volume_size",
"el_min_cpu",
"el_max_cpu",
"el_min_mem",
"el_max_mem",
"cl_type",
"cl_image",
"cl_log_level",
"cl_extra_env_vars",
"cl_extra_labels",
"cl_extra_params",
"cl_tolerations",
"cl_volume_size",
"cl_min_cpu",
"cl_max_cpu",
"cl_min_mem",
"cl_max_mem",
"use_separate_vc",
"vc_type",
"vc_image",
"vc_count",
"vc_log_level",
"vc_extra_env_vars",
"vc_extra_labels",
"vc_extra_params",
"vc_tolerations",
"vc_min_cpu",
"vc_max_cpu",
"vc_min_mem",
"vc_max_mem",
"validator_count",
"node_selectors",
"tolerations",
"count",
"snooper_enabled",
"ethereum_metrics_exporter_enabled",
"xatu_sentry_enabled",
"prometheus_config",
"blobber_enabled",
"blobber_extra_params",
"builder_network_params",
"keymanager_enabled",
],
}
PARTICIPANT_MATRIX_PARAMS = {
"participants_matrix": {
"el": [
"el_type",
"el_image",
"el_log_level",
"el_extra_env_vars",
"el_extra_labels",
"el_extra_params",
"el_tolerations",
"el_volume_size",
"el_min_cpu",
"el_max_cpu",
"el_min_mem",
"el_max_mem",
],
"cl": [
"cl_type",
"cl_image",
"cl_log_level",
"cl_extra_env_vars",
"cl_extra_labels",
"cl_extra_params",
"cl_tolerations",
"cl_volume_size",
"cl_min_cpu",
"cl_max_cpu",
"cl_min_mem",
"cl_max_mem",
"use_separate_vc",
],
"vc": [
"vc_type",
"vc_image",
"vc_count",
"vc_log_level",
"vc_extra_env_vars",
"vc_extra_labels",
"vc_extra_params",
"vc_tolerations",
"vc_min_cpu",
"vc_max_cpu",
"vc_min_mem",
"vc_max_mem",
],
},
}
SUBCATEGORY_PARAMS = {
"network_params": [
"network",
"network_id",
"deposit_contract_address",
"seconds_per_slot",
"num_validator_keys_per_node",
"preregistered_validator_keys_mnemonic",
"preregistered_validator_count",
"genesis_delay",
"max_per_epoch_activation_churn_limit",
"churn_limit_quotient",
"ejection_balance",
"eth1_follow_distance",
"min_validator_withdrawability_delay",
"shard_committee_period",
"deneb_fork_epoch",
"electra_fork_epoch",
"eip7594_fork_epoch",
"eip7594_fork_version",
"eof_activation_epoch",
"network_sync_base_url",
"data_column_sidecar_subnet_count",
"samples_per_slot",
"custody_requirement",
"target_number_of_peers",
"preset",
"additional_preloaded_contracts",
"devnet_repo",
],
"dora_params": [
"image",
"env",
],
"tx_spammer_params": [
"tx_spammer_extra_args",
],
"goomy_blob_params": [
"goomy_blob_args",
],
"assertoor_params": [
"image",
"run_stability_check",
"run_block_proposal_check",
"run_transaction_test",
"run_blob_transaction_test",
"run_opcodes_transaction_test",
"run_lifecycle_test",
"tests",
],
"mev_params": [
"mev_relay_image",
"mev_builder_image",
"mev_builder_cl_image",
"mev_boost_image",
"mev_boost_args",
"mev_relay_api_extra_args",
"mev_relay_housekeeper_extra_args",
"mev_relay_website_extra_args",
"mev_builder_extra_args",
"mev_builder_prometheus_config",
"mev_flood_image",
"mev_flood_extra_args",
"mev_flood_seconds_per_bundle",
"custom_flood_params",
],
"xatu_sentry_params": [
"xatu_sentry_image",
"xatu_server_addr",
"xatu_server_tls",
"xatu_server_headers",
"beacon_subscriptions",
],
"port_publisher": [
"nat_exit_ip",
"el",
"cl",
"vc",
"additional_services",
],
}
ADDITIONAL_SERVICES_PARAMS = [
"assertoor",
"broadcaster",
"tx_spammer",
"blob_spammer",
"custom_flood",
"goomy_blob",
"el_forkmon",
"blockscout",
"beacon_metrics_gazer",
"dora",
"full_beaconchain_explorer",
"prometheus_grafana",
"blobscan",
"dugtrio",
"blutgang",
"forky",
"apache",
"tracoor",
]
ADDITIONAL_CATEGORY_PARAMS = {
"wait_for_finalization": "",
"global_log_level": "",
"snooper_enabled": "",
"ethereum_metrics_exporter_enabled": "",
"parallel_keystore_generation": "",
"disable_peer_scoring": "",
"grafana_additional_dashboards": "",
"persistent": "",
"mev_type": "",
"xatu_sentry_enabled": "",
"apache_port": "",
"global_tolerations": "",
"global_node_selectors": "",
"keymanager_enabled": "",
"checkpoint_sync_enabled": "",
"checkpoint_sync_url": "",
}
def deep_validate_params(plan, input_args, category, allowed_params):
if category in input_args:
for item in input_args[category]:
for param in item.keys():
if param not in allowed_params:
fail(
"Invalid parameter {0} for {1}. Allowed fields: {2}".format(
param, category, allowed_params
)
)
def validate_params(plan, input_args, category, allowed_params):
if category in input_args:
for param in input_args[category].keys():
if param not in allowed_params:
fail(
"Invalid parameter {0} for {1}. Allowed fields: {2}".format(
param, category, allowed_params
)
)
def sanity_check(plan, input_args):
# Checks participants
deep_validate_params(
plan, input_args, "participants", PARTICIPANT_CATEGORIES["participants"]
)
# Checks participants_matrix
if "participants_matrix" in input_args:
for sub_matrix_participant in input_args["participants_matrix"]:
if (
sub_matrix_participant
not in PARTICIPANT_MATRIX_PARAMS["participants_matrix"]
):
fail(
"Invalid parameter {0} for participants_matrix, allowed fields: {1}".format(
sub_matrix_participant,
PARTICIPANT_MATRIX_PARAMS["participants_matrix"].keys(),
)
)
else:
deep_validate_params(
plan,
input_args["participants_matrix"],
sub_matrix_participant,
PARTICIPANT_MATRIX_PARAMS["participants_matrix"][
sub_matrix_participant
],
)
# Checks additional services
if "additional_services" in input_args:
for additional_services in input_args["additional_services"]:
if additional_services not in ADDITIONAL_SERVICES_PARAMS:
fail(
"Invalid additional_services {0}, allowed fields: {1}".format(
additional_services, ADDITIONAL_SERVICES_PARAMS
)
)
# Checks subcategories
for subcategories in SUBCATEGORY_PARAMS.keys():
validate_params(
plan, input_args, subcategories, SUBCATEGORY_PARAMS[subcategories]
)
# Checks everything else
for param in input_args.keys():
combined_root_params = (
PARTICIPANT_CATEGORIES.keys()
+ PARTICIPANT_MATRIX_PARAMS.keys()
+ SUBCATEGORY_PARAMS.keys()
+ ADDITIONAL_CATEGORY_PARAMS.keys()
)
combined_root_params.append("additional_services")
if param not in combined_root_params:
fail(
"Invalid parameter {0}, allowed fields {1}".format(
param, combined_root_params
)
)
# If everything passes, print a message
plan.print("Sanity check passed")
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment