Commit 66c4e01a authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

Merge pull request #4 from kurtosis-tech/gyani/ontop-of-network

simple POJOs and the mev boost launcher
parents 79c06978 11f2b113
......@@ -4,6 +4,43 @@ ETH2-MERGE-STARTOSIS-MODULE
This is the Startosis version of the popular [eth2-merge-kurtosis-module](https://github.com/kurtosis-tech/eth2-merge-kurtosis-module/)
### Missing Tasks
### Parity Missing Tasks
- [ ] Setup Releaser
- [ ] Module IO (this is blocked on Startosis Args working)
- [ ] forkmon (this is blocked on CL clients running)
- [ ] prometheus (this is blocked on CL clients running)
- [ ] grafana (this is blocked on prometheus running)
- [ ] testnet_verifier (this is blocked on CL/EL clients running)
- [ ] transaction_spammer (this is blocked on EL clients running)
- [ ] participant_network/participant_network
- [ ] has most data generation things, needs to start EL/CL clients
- [x] participant_network/participant
- [x] pure POJO should be quick to implement NO BLOCKERS
- [x] mev_boost participant_network/mev_boost NO BLOCKERS - removed some attributes that aren't used
- [x] mev_boost_context pure POJO NO BLOCKERS
- [x] mev_boost_launcher NO BLOCKERS
- [ ] participant_network/pre_launch_data_generator (the only missing piece here is remove_service)
- [x] data generation
- [ ] remove services post generation
- [ ] participant_network/el (requires facts and waits)
- [ ] besu - facts and waits
- [ ] erigon - facts and waits
- [ ] geth - facts and waits
- [ ] nethermind - facts and waits
- [x] el_client_context pure POJO NO BLOCKERS
- [x] el_client_launcher interface not necessary
- [ ] el_availability_waiter - facts and waits
- [x] el_rest_client/api_response_objects.go DESCOPED as facts will do this
- [x] el_rest_client/el_rest_client - facts and waits DESCOPED as facts will do this
- [ ] participant_network/cl (requires facts and waits)
- [ ] lighthouse - facts and waits
- [ ] loadstar - facts and waits
- [ ] nymbus - facts and waits
- [ ] prysm - facts and waits
- [ ] teku - facts and waits
- [x] cl_client_context pure POJO NO BLOCKERS
- [x] cl_client_launcher interface not necessary
- [ ] cl_availability_waiter - facts and waits
- [x] cl_rest_client/api_response_objects.go DESCOPED as facts will do this
- [x] cl_rest_client/el_rest_client - DESCOPED as facts will do this
- [x] cl_node_metrics_info - pure POJO NO BLOCKERS
\ No newline at end of file
......@@ -4,6 +4,7 @@
- Changed the .circlei/config.yml to apply to Startosis
- Added genesis_constants
- Added a lot of participant_network/pre_launch_data_generator
- Added a lot of simple objects that just keep data
# 0.0.0
* Initial commit
......@@ -15,4 +15,5 @@ def new_network_params():
network_id = "3151908",
deposit_contract_address = "0x4242424242424242424242424242424242424242",
seconds_per_slot = 12,
mev_boost_relay_endpoints = []
)
# differs from eth2 in the sense it dosen't have the rest_client
def new_cl_client_context(client_name, enr, ip_addr, http_port_num, cl_nodes_metrics_info):
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,
)
# this is a dictionary as this will get serialzed to JSON
def new_cl_node_metrics_info(name, path, url):
return {
"name": name,
"path": path,
"url": url
}
def new_el_client_context(client_name, enr, enode, ip_addr, rpc_port_num, ws_port_num, engine_rpc_port_num):
return struct(
client_name = client_name,
enr = enr,
enode = enode,
ip_addr = ip_addr,
rpc_port_num = rpc_port_num,
ws_port_num = ws_port_num,
engine_rpc_port_num = engine_rpc_port_num
)
def new_mev_boost_context(private_ip_address, port):
return struct(
private_ip_address = private_ip_address,
port = port,
)
def mev_boost_endpoint(mev_boost_context):
return "http://{0}:{1}".format(mev_boost_context.private_ip_address, mev_boost_context.port)
load("github.com/kurtosis-tech/eth2-module/src/shared_utils/shared_utils.star", "new_port_spec")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/mev_boost/mev_boost_context.star", "new_mev_boost_context")
FLASHBOTS_MEV_BOOST_IMAGE = "flashbots/mev-boost"
FLASHBOTS_MEV_BOOST_PORT = 18550
FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP"
USED_PORTS = {
"api": new_port_spec(FLASHBOTS_MEV_BOOST_PORT, FLASHBOTS_MEV_BOOST_PROTOCOL)
}
NETWORK_ID_TO_NAME = {
"5": "goerli",
"11155111": "sepolia",
"3": "ropsten",
}
def launch(mev_boost_launcher, service_id, network_id):
service_config = get_service_config(mev_boost_launcher, network_id)
mev_boost_service = add_service(service_id, service_config)
return new_mev_boost_context(mev_boost_service.ip_address, FLASHBOTS_MEV_BOOST_PORT)
def get_service_config(mev_boost_launcher, network_id):
command = ["/app/mev-boost"]
network_name = NETWORK_ID_TO_NAME.get(network_id, "network-{0}".format(network_id))
command.append("-{0}".format(network_name))
if mev_boost_launcher.should_check_relay:
command.append("-relay-check")
if len(mev_boost_launcher.relay_end_points) != 0:
command.append("-relays")
command.append(",".join(mev_boost_launcher.relay_end_points))
return struct(
container_image_name = FLASHBOTS_MEV_BOOST_IMAGE,
used_ports = USED_PORTS,
cmd_args = command
)
def new_mev_boost_launcher(should_check_relay, relay_end_points):
return struct(should_check_relay=should_check_relay, relay_end_points=relay_end_points)
def new_participant(el_client_type, cl_client_type, el_client_context, cl_client_context, mev_boost_context):
return struct(
el_client_type = el_client_type,
cl_client_type = cl_client_type,
el_client_context = el_client_context,
cl_client_context = cl_client_context,
mev_boost_context = mev_boost_context
)
......@@ -2,6 +2,13 @@ load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_dat
load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_data_generator/el_genesis/el_genesis_data_generator.star", "generate_el_genesis_data")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_data_generator/cl_genesis/cl_genesis_data_generator.star", "generate_cl_genesis_data")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/mev_boost/mev_boost_context.star", "mev_boost_endpoint")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/mev_boost/mev_boost_launcher.star", launch_mevboost="launch", "new_mev_boost_launcher")
MEV_BOOST_SERVICE_ID_PREFIX = "mev-boost-"
MEV_BOOST_SHOULD_RELAY = True
def launch_participant_network(num_participants, network_params):
print("Generating cl validator key stores")
......@@ -46,3 +53,11 @@ def launch_participant_network(num_participants, network_params):
)
print(json.indent(json.encode(cl_data)))
print("launching mev boost")
# TODO make this launch only for participants that have the participants[i].builderNetworkParams.relayEndpoints defined
# At the moment this lies here just to test, and the relay end points is an empty list
mev_boost_launcher = new_mev_boost_launcher(MEV_BOOST_SHOULD_RELAY, network_params.mev_boost_relay_endpoints)
mev_boost_service_id = MEV_BOOST_SERVICE_ID_PREFIX.format(1)
mev_boost_context = launch_mevboost(mev_boost_launcher, mev_boost_service_id, network_params.network_id)
print(mev_boost_endpoint(mev_boost_context))
def new_template_and_data(template, template_data_json):
return {"template": template, "template_data_json": template_data_json}
def path_join(*args):
joined_path = "/".join(args)
return joined_path.replace("//", "/")
def path_base(path):
split_path = path.split("/")
return split_path[-1]
def new_port_spec(number, protocol):
return struct(number = number, protocol = protocol)
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