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

Update to new Kurtosis Ethereum Package #6

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0bd29dd
fix: Update nethermind to expose host on 0.0.0.0 (#467)
barnabasbusa Jan 17, 2024
b9523cb
feat: Add Xatu Sentry (#466)
samcm Jan 18, 2024
f8289cb
feat: enable syncing ephemery (#459)
barnabasbusa Jan 19, 2024
e36027b
fix: add CL genesis delay to final genesis time (#469)
barnabasbusa Jan 22, 2024
26384ea
chore(main): release 1.3.0 (#436)
github-actions[bot] Jan 23, 2024
5db6611
feat: enable custom resource limit per network (#471)
barnabasbusa Jan 29, 2024
01868fc
fix: add more prefund addresses for verkle-gen (#482)
barnabasbusa Jan 31, 2024
2d8a143
feat: add support for custom assertoor images & use assertoor image w…
pk910 Feb 1, 2024
bbe0b16
fix: use latest stable image for assertoor (#484)
pk910 Feb 1, 2024
abdfc2c
feat: we no longer need 4788 deployer (#485)
barnabasbusa Feb 1, 2024
79dc5e1
fix: bump verkle genesis generator (#486)
parithosh Feb 1, 2024
1e543e8
feat: add verkle-gen-devnet-3 (#487)
barnabasbusa Feb 2, 2024
b3418cf
feat: blockscout support with sc verification (#481)
franjoespejo Feb 2, 2024
d596699
feat: improve built-in assertoor tests (#488)
pk910 Feb 8, 2024
631eaf3
feat: Add suave-enabled geth support (#489)
0x416e746f6e Feb 9, 2024
b788b18
feat: enable shadowforking (#475)
barnabasbusa Feb 9, 2024
5602a02
chore(main): release 1.4.0 (#473)
github-actions[bot] Feb 12, 2024
316d42f
feat!: add node selectors features (#491)
barnabasbusa Feb 12, 2024
9ceae9c
feat: enable api in assertoor config (#495)
pk910 Feb 20, 2024
e48483a
feat: parameterize mev-boost args (#400)
bharath-123 Feb 20, 2024
fe2de7e
feat: allow more detailed additional test configurations in assertoor…
pk910 Feb 22, 2024
90da2c3
feat: separate validator clients from CL clients (#497)
eth2353 Feb 27, 2024
d599729
feat: add nimbus-eth1 (#496)
barnabasbusa Feb 27, 2024
1d5a779
fix: nimbus-eth1 advertise proper extip (#501)
barnabasbusa Feb 27, 2024
beb764f
feat: enable dencun-genesis (#500)
barnabasbusa Feb 27, 2024
181dd04
fix: use the cl as the default validator image if none are defined (#…
barnabasbusa Feb 29, 2024
f9343a2
fix: README global node selector (#504)
barnabasbusa Mar 1, 2024
836eda4
feat: add keymanager to all validator processes (#502)
barnabasbusa Mar 4, 2024
bc5e725
fix: lh vc flag logic (#506)
barnabasbusa Mar 5, 2024
6fa0475
feat: make snapshot url configurable (#507)
barnabasbusa Mar 5, 2024
da55be8
fix: fix end index in validator ranges file (#509)
pk910 Mar 6, 2024
fab341b
refactor!: participant_network & rename participant fields. (#508)
barnabasbusa Mar 8, 2024
a96953d
chore(main): release 2.0.0 (#493)
github-actions[bot] Mar 8, 2024
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
Prev Previous commit
Next Next commit
feat: Add Xatu Sentry (ethpandaops#466)
Adds support for [Xatu](https://github.com/ethpandaops/xatu) in Sentry
mode. Similarly to Ethereum Metrics Exporter, Xatu Sentry can be enabled
globally, or per client pair.

Note: This PR only enables "Sentry". Xatu Server/Clickhouse etc will
need to run outside of Kurtosis for this to be useful.

---------

Co-authored-by: Barnabas Busa <[email protected]>
  • Loading branch information
samcm and barnabasbusa authored Jan 18, 2024
commit b9523cb7083be78c96bb88a7ca86d142cb0eec1d
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ participants:
# Defaults to false
ethereum_metrics_exporter_enabled: false

# Enables Xatu Sentry for this participant. Can be set globally.
# Defaults to false
xatu_sentry_enabled: false

# Count of nodes to spin up for this participant
# Default to 1
count: 1
Expand Down Expand Up @@ -466,6 +470,31 @@ mev_params:
# Optional parameters to send to the custom_flood script that sends reliable payloads
custom_flood_params:
interval_between_transactions: 1

# Enables Xatu Sentry for all participants
# Defaults to false
xatu_sentry_enabled: false

# Xatu Sentry params
xatu_sentry_params:
# The image to use for Xatu Sentry
xatu_sentry_image: ethpandaops/xatu:latest
# GRPC Endpoint of Xatu Server to send events to
xatu_server_addr: localhost:8080
# Enables TLS to Xatu Server
xatu_server_tls: false
# Headers to add on to Xatu Server requests
xatu_server_headers: {}
# Beacon event stream topics to subscribe to
beacon_subscriptions:
- attestation
- block
- chain_reorg
- finalized_checkpoint
- head
- voluntary_exit
- contribution_and_proof
- blob_sidecar
```

#### Example configurations
Expand Down
5 changes: 5 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def run(plan, args={}):
mev_params = args_with_right_defaults.mev_params
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation
persistent = args_with_right_defaults.persistent
xatu_sentry_params = args_with_right_defaults.xatu_sentry_params

grafana_datasource_config_template = read_file(
static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH
Expand Down Expand Up @@ -94,6 +95,7 @@ def run(plan, args={}):
args_with_right_defaults.global_client_log_level,
jwt_file,
persistent,
xatu_sentry_params,
parallel_keystore_generation,
)

Expand All @@ -107,12 +109,14 @@ def run(plan, args={}):
all_el_client_contexts = []
all_cl_client_contexts = []
all_ethereum_metrics_exporter_contexts = []
all_xatu_sentry_contexts = []
for participant in all_participants:
all_el_client_contexts.append(participant.el_client_context)
all_cl_client_contexts.append(participant.cl_client_context)
all_ethereum_metrics_exporter_contexts.append(
participant.ethereum_metrics_exporter_context
)
all_xatu_sentry_contexts.append(participant.xatu_sentry_context)

# Generate validator ranges
validator_ranges_config_template = read_file(
Expand Down Expand Up @@ -405,6 +409,7 @@ def run(plan, args={}):
all_cl_client_contexts,
prometheus_additional_metrics_jobs,
all_ethereum_metrics_exporter_contexts,
all_xatu_sentry_contexts,
)

plan.print("Launching grafana...")
Expand Down
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ participants:
validator_count: null
snooper_enabled: false
ethereum_metrics_exporter_enabled: false
xatu_sentry_enabled: false
el_min_cpu: 0
el_max_cpu: 0
el_min_mem: 0
Expand Down Expand Up @@ -76,3 +77,4 @@ mev_params:
mev_flood_seconds_per_bundle: 15
grafana_additional_dashboards: []
persistent: false
xatu_sentry_enabled: false
43 changes: 43 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
"goomy_blob_params",
"tx_spammer_params",
"custom_flood_params",
"xatu_sentry_params",
)


Expand All @@ -75,6 +76,7 @@ def input_parser(plan, input_args):
result["disable_peer_scoring"] = False
result["goomy_blob_params"] = get_default_goomy_blob_params()
result["assertoor_params"] = get_default_assertoor_params()
result["xatu_sentry_params"] = get_default_xatu_sentry_params()
result["persistent"] = False

for attr in input_args:
Expand Down Expand Up @@ -103,6 +105,10 @@ def input_parser(plan, input_args):
for sub_attr in input_args["assertoor_params"]:
sub_value = input_args["assertoor_params"][sub_attr]
result["assertoor_params"][sub_attr] = sub_value
elif attr == "xatu_sentry_params":
for sub_attr in input_args["xatu_sentry_params"]:
sub_value = input_args["xatu_sentry_params"][sub_attr]
result["xatu_sentry_params"][sub_attr] = sub_value

if result.get("disable_peer_scoring"):
result = enrich_disable_peer_scoring(result)
Expand Down Expand Up @@ -165,6 +171,7 @@ def input_parser(plan, input_args):
ethereum_metrics_exporter_enabled=participant[
"ethereum_metrics_exporter_enabled"
],
xatu_sentry_enabled=participant["xatu_sentry_enabled"],
prometheus_config=struct(
scrape_interval=participant["prometheus_config"]["scrape_interval"],
labels=participant["prometheus_config"]["labels"],
Expand Down Expand Up @@ -249,10 +256,18 @@ def input_parser(plan, input_args):
mev_type=result["mev_type"],
snooper_enabled=result["snooper_enabled"],
ethereum_metrics_exporter_enabled=result["ethereum_metrics_exporter_enabled"],
xatu_sentry_enabled=result["xatu_sentry_enabled"],
parallel_keystore_generation=result["parallel_keystore_generation"],
grafana_additional_dashboards=result["grafana_additional_dashboards"],
disable_peer_scoring=result["disable_peer_scoring"],
persistent=result["persistent"],
xatu_sentry_params=struct(
xatu_sentry_image=result["xatu_sentry_params"]["xatu_sentry_image"],
xatu_server_addr=result["xatu_sentry_params"]["xatu_server_addr"],
xatu_server_headers=result["xatu_sentry_params"]["xatu_server_headers"],
beacon_subscriptions=result["xatu_sentry_params"]["beacon_subscriptions"],
xatu_server_tls=result["xatu_sentry_params"]["xatu_server_tls"],
),
)


Expand Down Expand Up @@ -333,6 +348,8 @@ def parse_network_params(input_args):
"ethereum_metrics_exporter_enabled"
]

xatu_sentry_enabled = participant["xatu_sentry_enabled"]

blobber_enabled = participant["blobber_enabled"]
if blobber_enabled:
# unless we are running lighthouse, we don't support blobber
Expand All @@ -352,6 +369,11 @@ def parse_network_params(input_args):
"ethereum_metrics_exporter_enabled"
] = default_ethereum_metrics_exporter_enabled

if xatu_sentry_enabled == False:
default_xatu_sentry_enabled = result["xatu_sentry_enabled"]
if default_xatu_sentry_enabled:
participant["xatu_sentry_enabled"] = default_xatu_sentry_enabled

validator_count = participant["validator_count"]
if validator_count == None:
default_validator_count = result["network_params"][
Expand Down Expand Up @@ -442,6 +464,7 @@ def default_input_args():
"global_client_log_level": "info",
"snooper_enabled": False,
"ethereum_metrics_exporter_enabled": False,
"xatu_sentry_enabled": False,
"parallel_keystore_generation": False,
"disable_peer_scoring": False,
}
Expand Down Expand Up @@ -501,6 +524,7 @@ def default_participant():
"validator_count": None,
"snooper_enabled": False,
"ethereum_metrics_exporter_enabled": False,
"xatu_sentry_enabled": False,
"count": 1,
"prometheus_config": {
"scrape_interval": "15s",
Expand Down Expand Up @@ -551,6 +575,25 @@ def get_default_assertoor_params():
}


def get_default_xatu_sentry_params():
return {
"xatu_sentry_image": "ethpandaops/xatu:latest",
"xatu_server_addr": "localhost:8080",
"xatu_server_headers": {},
"xatu_server_tls": False,
"beacon_subscriptions": [
"attestation",
"block",
"chain_reorg",
"finalized_checkpoint",
"head",
"voluntary_exit",
"contribution_and_proof",
"blob_sidecar",
],
}


def get_default_custom_flood_params():
# this is a simple script that increases the balance of the coinbase address at a cadence
return {"interval_between_transactions": 1}
Expand Down
2 changes: 2 additions & 0 deletions src/participant.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def new_participant(
cl_client_context,
snooper_engine_context,
ethereum_metrics_exporter_context,
xatu_sentry_context,
):
return struct(
el_client_type=el_client_type,
Expand All @@ -13,4 +14,5 @@ def new_participant(
cl_client_context=cl_client_context,
snooper_engine_context=snooper_engine_context,
ethereum_metrics_exporter_context=ethereum_metrics_exporter_context,
xatu_sentry_context=xatu_sentry_context,
)
32 changes: 32 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ ethereum_metrics_exporter = import_module(
"./ethereum_metrics_exporter/ethereum_metrics_exporter_launcher.star"
)

xatu_sentry = import_module("./xatu_sentry/xatu_sentry_launcher.star")

genesis_constants = import_module(
"./prelaunch_data_generator/genesis_constants/genesis_constants.star"
)
Expand Down Expand Up @@ -61,6 +63,7 @@ def launch_participant_network(
global_log_level,
jwt_file,
persistent,
xatu_sentry_params,
parallel_keystore_generation=False,
):
num_participants = len(participants)
Expand Down Expand Up @@ -365,6 +368,7 @@ def launch_participant_network(
all_snooper_engine_contexts = []
all_cl_client_contexts = []
all_ethereum_metrics_exporter_contexts = []
all_xatu_sentry_contexts = []
preregistered_validator_keys_for_nodes = (
validator_data.per_node_keystores
if network_params.network == "kurtosis"
Expand Down Expand Up @@ -513,6 +517,29 @@ def launch_participant_network(

all_ethereum_metrics_exporter_contexts.append(ethereum_metrics_exporter_context)

xatu_sentry_context = None

if participant.xatu_sentry_enabled:
pair_name = "{0}-{1}-{2}".format(index_str, cl_client_type, el_client_type)

xatu_sentry_service_name = "xatu-sentry-{0}".format(pair_name)

xatu_sentry_context = xatu_sentry.launch(
plan,
xatu_sentry_service_name,
cl_client_context,
xatu_sentry_params,
network_params,
pair_name,
)
plan.print(
"Successfully added {0} xatu sentry participants".format(
xatu_sentry_context
)
)

all_xatu_sentry_contexts.append(xatu_sentry_context)

plan.print("Successfully added {0} CL participants".format(num_participants))

all_participants = []
Expand All @@ -533,6 +560,10 @@ def launch_participant_network(
ethereum_metrics_exporter_context = all_ethereum_metrics_exporter_contexts[
index
]
xatu_sentry_context = None

if participant.xatu_sentry_enabled:
xatu_sentry_context = all_xatu_sentry_contexts[index]

participant_entry = participant_module.new_participant(
el_client_type,
Expand All @@ -541,6 +572,7 @@ def launch_participant_network(
cl_client_context,
snooper_engine_context,
ethereum_metrics_exporter_context,
xatu_sentry_context,
)

all_participants.append(participant_entry)
Expand Down
20 changes: 20 additions & 0 deletions src/prometheus/prometheus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ def launch_prometheus(
cl_client_contexts,
additional_metrics_jobs,
ethereum_metrics_exporter_contexts,
xatu_sentry_contexts,
):
metrics_jobs = get_metrics_jobs(
el_client_contexts,
cl_client_contexts,
additional_metrics_jobs,
ethereum_metrics_exporter_contexts,
xatu_sentry_contexts,
)
prometheus_url = prometheus.run(
plan, metrics_jobs, MIN_CPU, MAX_CPU, MIN_MEMORY, MAX_MEMORY
Expand All @@ -44,6 +46,7 @@ def get_metrics_jobs(
cl_client_contexts,
additional_metrics_jobs,
ethereum_metrics_exporter_contexts,
xatu_sentry_contexts,
):
metrics_jobs = []
# Adding execution clients metrics jobs
Expand Down Expand Up @@ -159,6 +162,23 @@ def get_metrics_jobs(
},
)
)
# Adding Xatu Sentry metrics jobs
for context in xatu_sentry_contexts:
if context != None:
metrics_jobs.append(
new_metrics_job(
job_name="xatu-sentry-{0}".format(context.pair_name),
endpoint="{}:{}".format(
context.ip_addr,
context.metrics_port_num,
),
metrics_path="/metrics",
labels={
"pair": context.pair_name,
},
)
)

# Adding additional metrics jobs
for job in additional_metrics_jobs:
if job == None:
Expand Down
6 changes: 6 additions & 0 deletions src/static_files/static_files.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ ASSERTOOR_TESTS_CONFIG_DIRPATH = (
STATIC_FILES_DIRPATH + ASSERTOOR_CONFIG_DIRPATH + "/tests"
)

# xatu-sentry config
XATU_SENTRY_CONFIG_DIRPATH = "/xatu-sentry-config"
XATU_SENTRY_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + XATU_SENTRY_CONFIG_DIRPATH + "/config.yaml.tmpl"
)

# Grafana config
GRAFANA_CONFIG_DIRPATH = "/grafana-config"
GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH = (
Expand Down
10 changes: 10 additions & 0 deletions src/xatu_sentry/xatu_sentry_context.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def new_xatu_sentry_context(
ip_addr,
metrics_port_num,
pair_name,
):
return struct(
ip_addr=ip_addr,
metrics_port_num=metrics_port_num,
pair_name=pair_name,
)
Loading