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
3e6e2631
Commit
3e6e2631
authored
Nov 09, 2022
by
Gyanendra Mishra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this seems cleaner
parent
35f5928e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
11 deletions
+77
-11
README.md
README.md
+3
-3
main.star
main.star
+1
-1
participant_network.star
src/participant_network/participant_network.star
+60
-3
shared_utils.star
src/shared_utils/shared_utils.star
+9
-0
static_files.star
src/static_files/static_files.star
+4
-4
No files found.
README.md
View file @
3e6e2631
...
...
@@ -14,7 +14,7 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
-
[
x
]
static_files package
-
[
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
-
[
]
participant_network/participant_network
DEMO
-
[
]
has most data generation things, needs to start EL/CL clients
-
[
x
]
needs upload files to be implemented
-
[
x
]
participant_network/participant
...
...
@@ -32,7 +32,7 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
-
[
]
erigon
-
[
]
facts and waits + private_ip_address_placeholder
-
[
x
]
framework
-
[
]
geth
-
[
]
geth
DEMO
-
[
]
facts and waits + private_ip_address_placeholder
-
[
x
]
framework
-
[
]
nethermind
...
...
@@ -44,7 +44,7 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
-
[
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
-
[
]
lighthouse
DEMO
-
[
]
facts and waits
-
[
x
]
framework
-
[
]
loadstar
...
...
main.star
View file @
3e6e2631
...
...
@@ -7,7 +7,7 @@ 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(
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
grafana_info = module_io.GrafanaInfo(
dashboard_path = "dummy_path",
...
...
src/participant_network/participant_network.star
View file @
3e6e2631
...
...
@@ -5,11 +5,41 @@ load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_dat
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")
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", lighthouse_launcher="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")
module_io = import_types("github.com/kurtosis-tech/eth2-module/types.proto")
CL_CLIENT_SERVICE_ID_PREFIX = "cl-client-"
EL_CLIENT_SERVICE_ID_PREFIX = "el-client-"
MEV_BOOST_SERVICE_ID_PREFIX = "mev-boost-"
BOOT_PARTICIPANT_INDEX = 0
# The time that the CL genesis generation step takes to complete, based off what we've seen
CL_GENESIS_DATA_GENERATION_TIME = 2 * time.minute
# Each CL node takes about this time to start up and start processing blocks, so when we create the CL
# genesis data we need to set the genesis timestamp in the future so that nodes don't miss important slots
# (e.g. Altair fork)
# TODO Make this client-specific (currently this is Nimbus)
CL_NODE_STARTUP_TIME = 45 * time.second
MEV_BOOST_SERVICE_ID_PREFIX = "mev-boost-"
MEV_BOOST_SHOULD_RELAY = True
def launch_participant_network(num_participants, network_params):
CL_CLIENT_CONTEXT_BOOTNODE = None
def launch_participant_network(participants, network_params, global_log_level):
num_participants = len(participants)
genesis_timestamp = time.now().unix
print("Generating cl validator key stores")
keystore_result = generate_cl_validator_keystores(
...
...
@@ -21,8 +51,6 @@ def launch_participant_network(num_participants, network_params):
print(json.indent(json.encode(keystore_result)))
genesis_timestamp = time.now().unix
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(
...
...
@@ -35,6 +63,35 @@ def launch_participant_network(num_participants, network_params):
print(json.indent(json.encode(el_genesis_data)))
print("Uploading GETH prefunded keys")
geth_prefunded_keys_artifact_id = upload_files(GETH_PREFUNDED_KEYS_DIRPATH)
print("Uploaded GETH files succesfully")
el_launchers = {
# TODO Allow for other types here
module_io.ELClientType.geth : {"launcher": new_geth_launcher(el_genesis_data, geth_prefunded_keys_artifact_id, PRE_FUNDED_ACCOUNTS, network_params.network_id), "launch_method": launch_geth}
}
all_el_client_contexts = []
for index, participant in enumerate(participants):
el_client_type = participant.el_client_type
if el_client_type not in el_launchers:
fail("Unsupported launcher '{0}', need one of '{1}'".format(el_client_type, ",".join(el_launchers.keys())))
el_launcher, launch_method = el_launchers[el_client_type]["launcher"], el_launchers[el_client_type]["launch_method"]
el_service_id = "{0}{1}".format(EL_CLIENT_SERVICE_ID_PREFIX, index)
el_client_context = launch_method(el_launcher, el_service_id, participant.el_client_image, participant.el_client_log_level, global_log_level, all_el_client_contexts, participant.el_extra_params)
all_el_client_contexts.append(el_client_context)
print("Succesfully added {0} EL participants".format(num_participants))
print("Generating CL data")
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")
...
...
src/shared_utils/shared_utils.star
View file @
3e6e2631
...
...
@@ -22,3 +22,12 @@ def path_dir(path):
def new_port_spec(number, protocol):
return struct(number = number, protocol = protocol)
def wait_for(duration):
now = time.now().unix
later = now + duration
while now < later:
now = time.now().unix
continue
return
src/static_files/static_files.star
View file @
3e6e2631
# The path on the module container where static files are housed
STATIC_FILES_DIRPATH = "
/static-
files"
STATIC_FILES_DIRPATH = "
github.com/kurtosis-tech/eth2-module/static_
files"
# Geth + CL genesis generation
GENESIS_GENERATION_CONFIG_DIRPATH = STATIC_FILES_DIRPATH + "/genesis-generation-config"
EL_GENESIS_GENERATION_CONFIG_DIRPATH = GENESIS_GENERATION_CONFIG_DIRPATH + "/el"
E
_
L_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = EL_GENESIS_GENERATION_CONFIG_DIRPATH + \
EL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = EL_GENESIS_GENERATION_CONFIG_DIRPATH + \
"/genesis-config.yaml.tmpl"
CL_GENESIS_GENERATION_CONFIG_DIRPATH = GENESIS_GENERATION_CONFIG_DIRPATH + "/cl"
C
_
L_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = CL_GENESIS_GENERATION_CONFIG_DIRPATH + \
CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = CL_GENESIS_GENERATION_CONFIG_DIRPATH + \
"/config.yaml.tmpl"
C
_
L_GENESIS_GENERATION_MNEMONICS_TEMPLATE_FILEPATH = CL_GENESIS_GENERATION_CONFIG_DIRPATH + \
CL_GENESIS_GENERATION_MNEMONICS_TEMPLATE_FILEPATH = CL_GENESIS_GENERATION_CONFIG_DIRPATH + \
"/mnemonics.yaml.tmpl"
# Prefunded keys
...
...
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