Commit 2d23d52d authored by Gyanendra Mishra's avatar Gyanendra Mishra

Merge branch 'master' into gyani/ontop-of-network

parents 262a043b 79c06978
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_network.star", "launch_participant_network") load("github.com/kurtosis-tech/eth2-module/src/participant_network/participant_network.star", "launch_participant_network")
def main(): def main():
network_params = new_network_params() network_params = new_network_params()
print("Launching participant network") num_participants = 2
launch_participant_network(network_params) print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, json.indent(json.encode(network_params))))
launch_participant_network(num_participants, network_params)
def new_network_params(): def new_network_params():
# this is temporary till we get params working # this is temporary till we get params working
......
...@@ -2,8 +2,7 @@ load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_dat ...@@ -2,8 +2,7 @@ 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/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/prelaunch_data_generator/cl_genesis/cl_genesis_data_generator.star", "generate_cl_genesis_data")
def launch_participant_network(network_params): def launch_participant_network(num_participants, network_params):
num_participants = 2
print("Generating cl validator key stores") print("Generating cl validator key stores")
keystore_result = generate_cl_validator_keystores( keystore_result = generate_cl_validator_keystores(
......
...@@ -10,6 +10,3 @@ def new_cl_genesis_data( ...@@ -10,6 +10,3 @@ def new_cl_genesis_data(
config_yml_rel_filepath = config_yml_rel_filepath, config_yml_rel_filepath = config_yml_rel_filepath,
genesis_ssz_rel_filepath = genesis_ssz_rel_filepath, genesis_ssz_rel_filepath = genesis_ssz_rel_filepath,
) )
\ No newline at end of file
...@@ -31,8 +31,8 @@ TEKU_SECRETS_DIRNAME = "teku-secrets" ...@@ -31,8 +31,8 @@ TEKU_SECRETS_DIRNAME = "teku-secrets"
def generate_cl_validator_keystores( def generate_cl_validator_keystores(
mnemonic, mnemonic,
num_nodes, num_nodes,
num_validators_per_node, num_validators_per_node):
):
service_id = launch_prelaunch_data_generator( service_id = launch_prelaunch_data_generator(
{}, {},
) )
...@@ -43,14 +43,11 @@ def generate_cl_validator_keystores( ...@@ -43,14 +43,11 @@ def generate_cl_validator_keystores(
all_output_dirpaths = [] all_output_dirpaths = []
all_sub_command_strs = [] all_sub_command_strs = []
# TODO Parallelize this to increase perf, which will require Docker exec operations not holding the Kurtosis mutex!
start_index = 0 start_index = 0
stop_index = num_validators_per_node stop_index = num_validators_per_node
for i in range(0, num_nodes): for i in range(num_nodes):
output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format( output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(i)
i,
)
generate_keystores_cmd = "{0} keystores --insecure --prysm-pass {1} --out-loc {2} --source-mnemonic \"{3}\" --source-min {4} --source-max {5}".format( generate_keystores_cmd = "{0} keystores --insecure --prysm-pass {1} --out-loc {2} --source-mnemonic \"{3}\" --source-min {4} --source-max {5}".format(
KEYSTORES_GENERATION_TOOL_NAME, KEYSTORES_GENERATION_TOOL_NAME,
......
...@@ -4,8 +4,7 @@ def new_el_genesis_data( ...@@ -4,8 +4,7 @@ def new_el_genesis_data(
geth_genesis_json_relative_filepath, geth_genesis_json_relative_filepath,
erigon_genesis_json_relative_filepath, erigon_genesis_json_relative_filepath,
nethermind_genesis_json_relative_filepath, nethermind_genesis_json_relative_filepath,
besu_genesis_json_relative_filepath, besu_genesis_json_relative_filepath):
):
return struct( return struct(
files_artifact_uuid = files_artifact_uuid, files_artifact_uuid = files_artifact_uuid,
jwt_secret_relative_filepath = jwt_secret_relative_filepath, jwt_secret_relative_filepath = jwt_secret_relative_filepath,
......
...@@ -7,7 +7,7 @@ GENESIS_CONFIG_FILENAME = "genesis-config.yaml" ...@@ -7,7 +7,7 @@ GENESIS_CONFIG_FILENAME = "genesis-config.yaml"
OUTPUT_DIRPATH_ON_GENERATOR = "/output" OUTPUT_DIRPATH_ON_GENERATOR = "/output"
GETH_GENESIS_FILENAME = "geth.json" GETH_GENESIS_FILENAME = "genesis.json"
ERIGON_GENESIS_FILENAME = "erigon.json" ERIGON_GENESIS_FILENAME = "erigon.json"
NETHERMIND_GENESIS_FILENAME = "nethermind.json" NETHERMIND_GENESIS_FILENAME = "nethermind.json"
BESU_GENESIS_FILENAME = "besu.json" BESU_GENESIS_FILENAME = "besu.json"
...@@ -39,7 +39,7 @@ def generate_el_genesis_data( ...@@ -39,7 +39,7 @@ def generate_el_genesis_data(
genesis_config_file_template_and_data = new_template_and_data(genesis_generation_config_template, template_data) genesis_config_file_template_and_data = new_template_and_data(genesis_generation_config_template, template_data)
template_and_data_by_rel_dest_filepath ={} template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_FILENAME] = genesis_config_file_template_and_data template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_FILENAME] = genesis_config_file_template_and_data
genesis_generation_config_artifact_uuid = render_templates(template_and_data_by_rel_dest_filepath) genesis_generation_config_artifact_uuid = render_templates(template_and_data_by_rel_dest_filepath)
......
def new_prefunded_account(address, private_key) : def new_prefunded_account(address, private_key):
return struct(address = address, private_key = private_key) return struct(address = address, private_key = private_key)
# This information was generated by: # This information was generated by:
......
IMAGE = "ethpandaops/ethereum-genesis-generator:latest" IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.2"
SERVICE_ID_PREFIX = "prelaunch-data-generator-" SERVICE_ID_PREFIX = "prelaunch-data-generator-"
...@@ -9,9 +9,7 @@ ENTRYPOINT_ARGS = [ ...@@ -9,9 +9,7 @@ ENTRYPOINT_ARGS = [
] ]
# Launches a prelaunch data generator IMAGE, for use in various of the genesis generation # Launches a prelaunch data generator IMAGE, for use in various of the genesis generation
def launch_prelaunch_data_generator( def launch_prelaunch_data_generator(files_artifact_mountpoints):
files_artifact_mountpoints,
):
service_config = get_service_config(files_artifact_mountpoints) service_config = get_service_config(files_artifact_mountpoints)
......
def new_template_and_data(template, template_data_json): def new_template_and_data(template, template_data_json):
return {"template": template, "template_data_json": template_data_json} return {"template": template, "template_data_json": template_data_json}
def path_join(*args): def path_join(*args):
joined_path = "/".join(args) joined_path = "/".join(args)
return joined_path.replace("//", "/") return joined_path.replace("//", "/")
def path_base(path): def path_base(path):
split_path = path.split("/") split_path = path.split("/")
return split_path[-1] return split_path[-1]
def new_port_spec(number, protocol): def new_port_spec(number, protocol):
return struct(number = number, protocol = protocol) return struct(number = number, protocol = protocol)
\ No newline at end of file
...@@ -8,8 +8,8 @@ CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts w ...@@ -8,8 +8,8 @@ CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts w
# `2**14` (= 16,384) # `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: {{ .NumValidatorKeysToPreregister }} MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: {{ .NumValidatorKeysToPreregister }}
MIN_GENESIS_TIME: {{ .UnixTimestamp }} MIN_GENESIS_TIME: {{ .UnixTimestamp }}
GENESIS_FORK_VERSION: 0x10005555 GENESIS_FORK_VERSION: 0x10000038
GENESIS_DELAY: 120 GENESIS_DELAY: 300
# Forking # Forking
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -21,20 +21,23 @@ GENESIS_DELAY: 120 ...@@ -21,20 +21,23 @@ GENESIS_DELAY: 120
# are all hardcoded to zero. # are all hardcoded to zero.
# Altair # Altair
ALTAIR_FORK_VERSION: 0x11005555 ALTAIR_FORK_VERSION: 0x20000038
ALTAIR_FORK_EPOCH: 0 ALTAIR_FORK_EPOCH: 0
# Merge # Merge
BELLATRIX_FORK_VERSION: 0x12005555 BELLATRIX_FORK_VERSION: 0x30000038
BELLATRIX_FORK_EPOCH: 0 BELLATRIX_FORK_EPOCH: 0
TERMINAL_TOTAL_DIFFICULTY: 0 TERMINAL_TOTAL_DIFFICULTY: 0
# 0x0000...000 indicates that we use TERMINAL_TOTAL_DIFFICULTY instead of a block has to trigger the merge # 0x0000...000 indicates that we use TERMINAL_TOTAL_DIFFICULTY instead of a block has to trigger the merge
# See also: https://eips.ethereum.org/EIPS/eip-3675
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
# NOTE: This is commented out because Nimbus warns us that it's an unrecognized parameter # NOTE: This is commented out because Nimbus warns us that it's an unrecognized parameter
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x40000038
CAPELLA_FORK_EPOCH: 18446744073709551615
# Sharding # Sharding
SHARDING_FORK_VERSION: 0x13005555 SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615 SHARDING_FORK_EPOCH: 18446744073709551615
# Time parameters # Time parameters
...@@ -48,7 +51,7 @@ SHARD_COMMITTEE_PERIOD: 256 ...@@ -48,7 +51,7 @@ SHARD_COMMITTEE_PERIOD: 256
# It's very important that SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE is a good amount of time, else # It's very important that SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE is a good amount of time, else
# jitter will cause the Beacon nodes to think they're far behind the Eth1 nodes and give up syncing # jitter will cause the Beacon nodes to think they're far behind the Eth1 nodes and give up syncing
SECONDS_PER_ETH1_BLOCK: 10 SECONDS_PER_ETH1_BLOCK: 10
ETH1_FOLLOW_DISTANCE: 30 ETH1_FOLLOW_DISTANCE: 12
# Validator cycle # Validator cycle
......
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