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

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

parents 262a043b 79c06978
module:
name: "github.com/kurtosis-tech/eth2-module"
\ No newline at end of file
name: "github.com/kurtosis-tech/eth2-module"
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")
def main():
network_params = new_network_params()
print("Launching participant network")
launch_participant_network(network_params)
num_participants = 2
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():
# this is temporary till we get params working
......@@ -15,4 +15,4 @@ def new_network_params():
network_id = "3151908",
deposit_contract_address = "0x4242424242424242424242424242424242424242",
seconds_per_slot = 12,
)
\ No newline at end of file
)
......@@ -13,4 +13,4 @@ root_dirpath="$(dirname "${script_dirpath}")"
if ! "kurtosis" "startosis" "exec" "${root_dirpath}"; then
echo "Error: running the startosis script"
fi
\ No newline at end of file
fi
......@@ -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/cl_genesis/cl_genesis_data_generator.star", "generate_cl_genesis_data")
def launch_participant_network(network_params):
num_participants = 2
def launch_participant_network(num_participants, network_params):
print("Generating cl validator key stores")
keystore_result = generate_cl_validator_keystores(
......
......@@ -10,6 +10,3 @@ def new_cl_genesis_data(
config_yml_rel_filepath = config_yml_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"
def generate_cl_validator_keystores(
mnemonic,
num_nodes,
num_validators_per_node,
):
num_validators_per_node):
service_id = launch_prelaunch_data_generator(
{},
)
......@@ -43,14 +43,11 @@ def generate_cl_validator_keystores(
all_output_dirpaths = []
all_sub_command_strs = []
# TODO Parallelize this to increase perf, which will require Docker exec operations not holding the Kurtosis mutex!
start_index = 0
stop_index = num_validators_per_node
for i in range(0, num_nodes):
output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(
i,
)
for i in range(num_nodes):
output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(i)
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,
......@@ -110,4 +107,4 @@ def generate_cl_validator_keystores(
keystore_files,
)
return result
\ No newline at end of file
return result
......@@ -10,4 +10,4 @@ def new_generate_keystores_result(prysm_password_artifact_uuid, prysm_password_r
# Contains keystores-per-client-type for each node in the network
PerNodeKeystores = per_node_keystores
)
\ No newline at end of file
)
......@@ -4,8 +4,7 @@ def new_el_genesis_data(
geth_genesis_json_relative_filepath,
erigon_genesis_json_relative_filepath,
nethermind_genesis_json_relative_filepath,
besu_genesis_json_relative_filepath,
):
besu_genesis_json_relative_filepath):
return struct(
files_artifact_uuid = files_artifact_uuid,
jwt_secret_relative_filepath = jwt_secret_relative_filepath,
......@@ -13,4 +12,4 @@ def new_el_genesis_data(
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,
)
\ No newline at end of file
)
......@@ -7,7 +7,7 @@ GENESIS_CONFIG_FILENAME = "genesis-config.yaml"
OUTPUT_DIRPATH_ON_GENERATOR = "/output"
GETH_GENESIS_FILENAME = "geth.json"
GETH_GENESIS_FILENAME = "genesis.json"
ERIGON_GENESIS_FILENAME = "erigon.json"
NETHERMIND_GENESIS_FILENAME = "nethermind.json"
BESU_GENESIS_FILENAME = "besu.json"
......@@ -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)
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
genesis_generation_config_artifact_uuid = render_templates(template_and_data_by_rel_dest_filepath)
......@@ -128,4 +128,4 @@ def genesis_generation_config_template_data(network_id, deposit_contract_address
"NetworkId": network_id,
"DepositContractAddress": deposit_contract_address,
"UnixTimestamp": unix_timestamp,
}
\ No newline at end of file
}
def new_prefunded_account(address, private_key) :
def new_prefunded_account(address, private_key):
return struct(address = address, private_key = private_key)
# This information was generated by:
......@@ -42,4 +42,4 @@ new_prefunded_account(
"0x1F6298457C5d76270325B724Da5d1953923a6B88",
"7da08f856b5956d40a72968f93396f6acff17193f013e8053f6fbb6c08c194d6",
),
]
\ No newline at end of file
]
IMAGE = "ethpandaops/ethereum-genesis-generator:latest"
IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.2"
SERVICE_ID_PREFIX = "prelaunch-data-generator-"
......@@ -9,9 +9,7 @@ ENTRYPOINT_ARGS = [
]
# Launches a prelaunch data generator IMAGE, for use in various of the genesis generation
def launch_prelaunch_data_generator(
files_artifact_mountpoints,
):
def launch_prelaunch_data_generator(files_artifact_mountpoints):
service_config = get_service_config(files_artifact_mountpoints)
......@@ -33,4 +31,4 @@ def get_service_config(
container_image_name = IMAGE,
entry_point_args = ENTRYPOINT_ARGS,
files_artifact_mount_dirpaths = files_artifact_mountpoints,
)
\ No newline at end of file
)
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)
\ No newline at end of file
......@@ -8,8 +8,8 @@ CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts w
# `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: {{ .NumValidatorKeysToPreregister }}
MIN_GENESIS_TIME: {{ .UnixTimestamp }}
GENESIS_FORK_VERSION: 0x10005555
GENESIS_DELAY: 120
GENESIS_FORK_VERSION: 0x10000038
GENESIS_DELAY: 300
# Forking
# ---------------------------------------------------------------
......@@ -21,20 +21,23 @@ GENESIS_DELAY: 120
# are all hardcoded to zero.
# Altair
ALTAIR_FORK_VERSION: 0x11005555
ALTAIR_FORK_VERSION: 0x20000038
ALTAIR_FORK_EPOCH: 0
# Merge
BELLATRIX_FORK_VERSION: 0x12005555
BELLATRIX_FORK_VERSION: 0x30000038
BELLATRIX_FORK_EPOCH: 0
TERMINAL_TOTAL_DIFFICULTY: 0
# 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
# NOTE: This is commented out because Nimbus warns us that it's an unrecognized parameter
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x40000038
CAPELLA_FORK_EPOCH: 18446744073709551615
# Sharding
SHARDING_FORK_VERSION: 0x13005555
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615
# Time parameters
......@@ -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
# jitter will cause the Beacon nodes to think they're far behind the Eth1 nodes and give up syncing
SECONDS_PER_ETH1_BLOCK: 10
ETH1_FOLLOW_DISTANCE: 30
ETH1_FOLLOW_DISTANCE: 12
# Validator cycle
......@@ -69,4 +72,4 @@ CHURN_LIMIT_QUOTIENT: 65536
# ---------------------------------------------------------------
DEPOSIT_CHAIN_ID: {{ .NetworkId }}
DEPOSIT_NETWORK_ID: {{ .NetworkId }}
DEPOSIT_CONTRACT_ADDRESS: {{ .DepositContractAddress }}
DEPOSIT_CONTRACT_ADDRESS: {{ .DepositContractAddress }}
\ No newline at end of file
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