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
010644c1
Commit
010644c1
authored
Nov 09, 2022
by
Gyanendra Mishra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this looks alright
parent
58cd247c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
19 deletions
+81
-19
README.md
README.md
+2
-1
main.star
main.star
+3
-2
participant_network.star
src/participant_network/participant_network.star
+76
-16
No files found.
README.md
View file @
010644c1
...
...
@@ -15,8 +15,9 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
-
[
x
]
testnet_verifier (this is blocked on CL/EL clients running)
-
[
x
]
transaction_spammer (this is blocked on EL clients running)
-
[
]
participant_network/participant_network DEMO
-
[
]
has most data generation things, needs to start EL/CL clients
-
[
x
]
has most data generation things, needs to start EL/CL clients
-
[
x
]
needs upload files to be implemented
-
[
]
need to fill in the dictionary with all el / cl types
-
[
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
...
...
main.star
View file @
010644c1
...
...
@@ -7,8 +7,9 @@ def main(input_args):
input_args_with_right_defaults = module_io.ModuleInput(parse_input(input_args))
num_participants = len(input_args_with_right_defaults.participants)
print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, input_args_with_right_defaults.network_params))
launch_participant_network(input_args_with_right_defaults.participants, input_args_with_right_defaults.network_params, input_args_with_right_defaults.global_log_level)
#TODO replace with actual values
all_participants, cl_gensis_timestamp = launch_participant_network(input_args_with_right_defaults.participants, input_args_with_right_defaults.network_params, input_args_with_right_defaults.global_log_level)
print(all_participants)
print(cl_gensis_timestamp)
grafana_info = module_io.GrafanaInfo(
dashboard_path = "dummy_path",
user = "user",
...
...
src/participant_network/participant_network.star
View file @
010644c1
...
...
@@ -8,9 +8,10 @@ load("github.com/kurtosis-tech/eth2-module/src/participant_network/mev_boost/mev
load("github.com/kurtosis-tech/eth2-module/src/static_files/static_files.star", "GETH_PREFUNDED_KEYS_DIRPATH")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/el/geth/geth_launcher.star", launch_geth="launch", "new_geth_launcher")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/cl/lighthouse/lighthouse_launcher.star", l
ighthouse_launcher
="launch", "new_lighthouse_launcher")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/cl/lighthouse/lighthouse_launcher.star", l
aunch_lighthouse
="launch", "new_lighthouse_launcher")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_data_generator/genesis_constants/genesis_constants.star", "PRE_FUNDED_ACCOUNTS")
load("github.com/kurtosis-tech/eth2-module/src/participant_network/participant.star", "new_participant")
module_io = import_types("github.com/kurtosis-tech/eth2-module/types.proto")
...
...
@@ -37,25 +38,25 @@ CL_CLIENT_CONTEXT_BOOTNODE = None
def launch_participant_network(participants, network_params, global_log_level):
num_participants = len(participants)
genesis_timestamp = time.now().unix
el_
genesis_timestamp = time.now().unix
print("Generating cl validator key stores")
keystore_result
= generate_cl_validator_keystores(
cl_validator_data
= generate_cl_validator_keystores(
network_params.preregistered_validator_keys_mnemonic,
num_participants,
network_params.num_validators_per_keynode
)
print(json.indent(json.encode(
keystore_result
)))
print(json.indent(json.encode(
cl_validator_data
)))
print("Generating EL data")
el_genesis_generation_config_template = read_file("github.com/kurtosis-tech/eth2-module/static_files/genesis-generation-config/el/genesis-config.yaml.tmpl")
el_genesis_data = generate_el_genesis_data(
el_genesis_generation_config_template,
genesis_timestamp,
el_
genesis_timestamp,
network_params.network_id,
network_params.deposit_contract_address
)
...
...
@@ -67,7 +68,7 @@ def launch_participant_network(participants, network_params, global_log_level):
geth_prefunded_keys_artifact_id = upload_files(GETH_PREFUNDED_KEYS_DIRPATH)
print("Uploaded GETH files succesfully")
print("Uploaded GETH files succesfully
, launching EL participants
")
el_launchers = {
# TODO Allow for other types here
...
...
@@ -93,14 +94,18 @@ def launch_participant_network(participants, network_params, global_log_level):
print("Generating CL data")
# verify that this works
cl_genesis_timestamp = (time.now() + CL_GENESIS_DATA_GENERATION_TIME + num_participants*CL_NODE_STARTUP_TIME).unix
genesis_generation_config_yml_template = read_file("github.com/kurtosis-tech/eth2-module/static_files/genesis-generation-config/cl/config.yaml.tmpl")
genesis_generation_mnemonics_yml_template = read_file("github.com/kurtosis-tech/eth2-module/static_files/genesis-generation-config/cl/mnemonics.yaml.tmpl")
total_number_of_validator_keys = network_params.num_validators_per_keynode * num_participants
cl_data = generate_cl_genesis_data(
cl_
genesis_
data = generate_cl_genesis_data(
genesis_generation_config_yml_template,
genesis_generation_mnemonics_yml_template,
el_genesis_data,
genesis_timestamp,
cl_
genesis_timestamp,
network_params.network_id,
network_params.deposit_contract_address,
network_params.seconds_per_slot,
...
...
@@ -109,12 +114,67 @@ def launch_participant_network(participants, network_params, global_log_level):
)
print(json.indent(json.encode(cl_data)))
print(json.indent(json.encode(cl_genesis_data)))
print("Launching CL network")
cl_launchers = {
# TODO Allow for other types here
module_io.CLClientType.lighthouse : {"launcher": new_lighthouse_launcher(cl_genesis_data), "launch_method": launch_lighthouse}
}
all_cl_client_contexts = []
all_mevboost_contexts = []
preregistered_validator_keys_for_nodes = cl_validator_data.per_node_keystores
for index, participant in enumerate(participants):
cl_client_type = participant.cl_client_type
if cl_client_type not in cl_launchers:
fail("Unsupported launcher '{0}', need one of '{1}'".format(cl_client_type, ",".join(cl_launchers.keys())))
cl_launcher, launch_method = cl_launchers[cl_client_type]["launcher"], cl_launchers[cl_client_type]["launch_method"]
cl_service_id = "{0}{1}".format(CL_CLIENT_SERVICE_ID_PREFIX, index)
new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[index]
el_client_context = all_el_client_contexts[index]
mev_boost_context = None
if proto.has(participant, builder_network_params):
mev_boost_launcher = new_mev_boost_launcher(MEV_BOOST_SHOULD_RELAY, [])
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)
all_mevboost_contexts.append(mev_boost_context)
cl_client_context = None
if index == 0:
cl_client_context = launch_method(cl_launcher, cl_service_id, participant.cl_client_image, participant.cl_client_log_level, global_log_level, CL_CLIENT_CONTEXT_BOOTNODE,
el_client_context, mev_boost_context, new_cl_node_validator_keystores, participant.beacon_extra_params, participant.validator_extra_params)
else:
boot_cl_client_ctx = all_cl_client_contexts[0]
cl_client_context = launch_method(cl_launcher, cl_service_id, participant.cl_client_image, participant.cl_client_log_level, global_log_level, boot_cl_client_ctx,
el_client_context, mev_boost_context, new_cl_node_validator_keystores, participant.beacon_extra_params, participant.validator_extra_params)
all_cl_client_contexts.append(el_client_context)
all_participants = []
for index, participant in participants:
el_client_type = participant.el_client_type
cl_client_type = participant.cl_client_type
el_client_context = all_el_client_contexts[index]
cl_client_context = all_cl_client_contexts[index]
mev_boost_context = all_mevboost_contexts[index]
participant_entry = new_participant(el_client_type, cl_client_type, el_client_context, cl_client_context, mev_boost_context)
all_participants.append(participant_entry)
return all_participants, cl_genesis_timestamp
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, [])
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))
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