Commit 85a559fa authored by Gyanendra Mishra's avatar Gyanendra Mishra

do a wait / fact for finalized epoch

parent 201c8caf
......@@ -8,7 +8,8 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
- [x] main.star
- [x] launch forkmon, prometheus, grafana, testnet_verifier, transaction_spammer
- [ ] do a wait for epoch finalization
- [x] do a wait for epoch finalization
- [ ] assert that finalization epoch > 0
- [x] Module IO (this is blocked on Startosis Args working)
- [x] forkmon (this is blocked on CL clients running)
- [x] prometheus (this is blocked on CL clients running)
......
......@@ -16,6 +16,8 @@ GRAFANA_USER = "admin"
GRAFANA_PASSWORD = "admin"
GRAFANA_DASHBOARD_PATH_URL = "/d/QdTOwy-nz/eth2-merge-kurtosis-module-dashboard?orgId=1"
FIRST_NODE_FINALIZATION_FACT = "cl-boot-finalization-fact"
HTTP_PORT_ID_FOR_FACT = "http"
def main(input_args):
input_args_with_right_defaults = module_io.ModuleInput(parse_input(input_args))
......@@ -66,8 +68,6 @@ def main(input_args):
if input_args_with_right_defaults.wait_for_verifications:
print("Running synchrnous testnet verifier")
# As we don't get the verification output we can't print it
# TODO verify if this behavior is okay
run_synchronous_testnet_verification(input_args_with_right_defaults, all_el_client_contexts, all_cl_client_contexts)
print("Verification succeeded")
else:
......@@ -77,7 +77,10 @@ def main(input_args):
if input_args_with_right_defaults.wait_for_finalization:
print("Waiting for the first finalized epoch")
first_cl_client = all_cl_client_contexts[0]
# TODO add fact and wait to emulate this behavior
first_cl_client_id = first_cl_client.beacon_service_id
define_fact(service_id = first_cl_client.first_cl_client_id, fact_name = FIRST_NODE_FINALIZATION_FACT, fact_recipe = struct(method= "GET", endpoint = "eth/v1/beacon/states/head/finality_checkpoints", content_type = "application/json", port_id = HTTP_PORT_ID_FOR_FACT, field_extractor = ".data.finalized.epoch"))
finalized_epoch = wait(service_id = first_cl_client_id, fact_name = FIRST_NODE_FINALIZATION_FACT)
# TODO make an assertion on the finalized_epoch > 0
print("First finalized epoch occurred successfully")
......
# differs from kurtosis-tech/eth2-merge-kurtosis-module in the sense it dosen't have the rest_client
# broader use of the rest client allows for waiting for the first cl context to be heahty in module.go
# TODO remove the above comment when things are working
def new_cl_client_context(client_name, enr, ip_addr, http_port_num, cl_nodes_metrics_info):
def new_cl_client_context(client_name, enr, ip_addr, http_port_num, cl_nodes_metrics_info, beacon_service_id):
return struct(
client_name = client_name,
enr = enr,
ip_addr = ip_addr,
http_port_num = http_port_num,
cl_nodes_metrics_info = cl_nodes_metrics_info,
beacon_service_id = beacon_service_id
)
......@@ -149,6 +149,7 @@ def launch(
beacon_service.ip_address,
BEACON_HTTP_PORT_NUM,
nodes_metrics_info,
beacon_node_service_id,
)
return result
......
......@@ -135,6 +135,7 @@ def launch(
beacon_service.ip_address,
HTTP_PORT_NUM,
nodes_metrics_info,
beacon_node_service_id
)
return result
......
......@@ -116,6 +116,7 @@ def launch(
beacon_service.ip_address,
HTTP_PORT_NUM,
nodes_metrics_info,
service_id,
)
return result
......
......@@ -161,6 +161,7 @@ def launch(
beacon_service.ip_address,
HTTP_PORT_NUM,
nodes_metrics_info,
beacon_node_service_id
)
return result
......
......@@ -122,6 +122,7 @@ def launch(
beacon_service.ip_address,
HTTP_PORT_NUM,
nodes_metrics_info,
service_id
)
return result
......
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