Commit a1d69279 authored by parithosh's avatar parithosh

updating configs for genesis delay and capella

parent 9bb76d57
......@@ -84,6 +84,12 @@ def parse_input(input_args):
if result["network_params"]["seconds_per_slot"] == 0:
fail("seconds_per_slot is 0 needs to be > 0 ")
if result["network_params"]["genesis_delay"] == 0:
fail("genesis_delay is 0 needs to be > 0 ")
if result["network_params"]["capella_fork_epoch"] == 0:
fail("capella_fork_epoch is 0 needs to be > 0 ")
required_num_validtors = 2 * result["network_params"]["slots_per_epoch"]
actual_num_validators = len(result["participants"]) * result["network_params"]["num_validator_keys_per_node"]
if required_num_validtors > actual_num_validators:
......@@ -113,6 +119,8 @@ def parse_input(input_args):
deposit_contract_address=result["network_params"]["deposit_contract_address"],
seconds_per_slot=result["network_params"]["seconds_per_slot"],
slots_per_epoch=result["network_params"]["slots_per_epoch"],
capella_fork_epoch=result["network_params"]["capella_fork_epoch"],
genesis_delay=result["network_params"]["genesis_delay"]
),
launch_additional_services=result["launch_additional_services"],
wait_for_finalization=result["wait_for_finalization"],
......@@ -151,6 +159,8 @@ def default_network_params():
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"genesis_delay": 120,
"capella_fork_epoch": 5,
}
def default_participant():
......
......@@ -45,7 +45,6 @@ CL_CLIENT_CONTEXT_BOOTNODE = None
def launch_participant_network(participants, network_params, global_log_level):
num_participants = len(participants)
el_genesis_timestamp = time.now().unix
......@@ -59,13 +58,17 @@ def launch_participant_network(participants, network_params, global_log_level):
print(json.indent(json.encode(cl_validator_data)))
# We need to send the same genesis time to both the EL and the CL to ensure that timestamp based forking works as expected
final_genesis_timestamp = (time.now() + CL_GENESIS_DATA_GENERATION_TIME + num_participants*CL_NODE_STARTUP_TIME).unix
print("Generating EL data")
el_genesis_generation_config_template = read_file(static_files.EL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH)
el_genesis_data = el_genesis_data_generator.generate_el_genesis_data(
el_genesis_generation_config_template,
el_genesis_timestamp,
final_genesis_timestamp,
network_params.network_id,
network_params.deposit_contract_address
network_params.deposit_contract_address,
network_params.genesis_delay,
network_params.capella_fork_epoch
)
......@@ -112,9 +115,6 @@ 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(static_files.CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH)
genesis_generation_mnemonics_yml_template = read_file(static_files.CL_GENESIS_GENERATION_MNEMONICS_TEMPLATE_FILEPATH)
total_number_of_validator_keys = network_params.num_validator_keys_per_node * num_participants
......@@ -122,13 +122,14 @@ def launch_participant_network(participants, network_params, global_log_level):
genesis_generation_config_yml_template,
genesis_generation_mnemonics_yml_template,
el_genesis_data,
cl_genesis_timestamp,
final_genesis_timestamp,
network_params.network_id,
network_params.deposit_contract_address,
network_params.seconds_per_slot,
network_params.preregistered_validator_keys_mnemonic,
total_number_of_validator_keys
total_number_of_validator_keys,
network_params.genesis_delay,
network_params.capella_fork_epoch
)
print(json.indent(json.encode(cl_genesis_data)))
......@@ -220,5 +221,5 @@ def launch_participant_network(participants, network_params, global_log_level):
all_participants.append(participant_entry)
return all_participants, cl_genesis_timestamp
return all_participants, final_genesis_timestamp
......@@ -32,7 +32,9 @@ def generate_cl_genesis_data(
deposit_contract_address,
seconds_per_slot,
preregistered_validator_keys_mnemonic,
total_num_validator_keys_to_preregister):
total_num_validator_keys_to_preregister,
genesis_delay,
capella_fork_epoch):
template_data = new_cl_genesis_config_template_data(
network_id,
......@@ -41,6 +43,8 @@ def generate_cl_genesis_data(
total_num_validator_keys_to_preregister,
preregistered_validator_keys_mnemonic,
deposit_contract_address,
genesis_delay,
capella_fork_epoch
)
genesis_generation_mnemonics_template_and_data = shared_utils.new_template_and_data(genesis_generation_mnemonics_yml_template, template_data)
......@@ -151,7 +155,7 @@ def generate_cl_genesis_data(
def new_cl_genesis_config_template_data(network_id, seconds_per_slot, unix_timestamp, num_validator_keys_to_preregister, preregistered_validator_keys_mnemonic, deposit_contract_address):
def new_cl_genesis_config_template_data(network_id, seconds_per_slot, unix_timestamp, num_validator_keys_to_preregister, preregistered_validator_keys_mnemonic, deposit_contract_address, genesis_delay, capella_fork_epoch):
return {
"NetworkId": network_id,
"SecondsPerSlot": seconds_per_slot,
......@@ -159,4 +163,6 @@ def new_cl_genesis_config_template_data(network_id, seconds_per_slot, unix_times
"NumValidatorKeysToPreregister": num_validator_keys_to_preregister,
"PreregisteredValidatorKeysMnemonic": preregistered_validator_keys_mnemonic,
"DepositContractAddress": deposit_contract_address,
"GenesisDelay": genesis_delay,
"CapellaForkEpoch": capella_fork_epoch
}
......@@ -29,12 +29,16 @@ def generate_el_genesis_data(
genesis_generation_config_template,
genesis_unix_timestamp,
network_id,
deposit_contract_address):
deposit_contract_address,
genesis_delay,
capella_fork_epoch):
template_data = genesis_generation_config_template_data(
network_id,
deposit_contract_address,
genesis_unix_timestamp,
genesis_delay,
capella_fork_epoch
)
genesis_config_file_template_and_data = shared_utils.new_template_and_data(genesis_generation_config_template, template_data)
......@@ -123,9 +127,11 @@ def generate_el_genesis_data(
return result
def genesis_generation_config_template_data(network_id, deposit_contract_address, unix_timestamp):
def genesis_generation_config_template_data(network_id, deposit_contract_address, unix_timestamp, genesis_delay, capella_fork_epoch):
return {
"NetworkId": network_id,
"DepositContractAddress": deposit_contract_address,
"UnixTimestamp": unix_timestamp,
"GenesisDelay": genesis_delay,
"CapellaForkEpoch": capella_fork_epoch
}
IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.3"
IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.4"
SERVICE_ID_PREFIX = "prelaunch-data-generator-"
......
......@@ -9,7 +9,7 @@ CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts w
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: {{ .NumValidatorKeysToPreregister }}
MIN_GENESIS_TIME: {{ .UnixTimestamp }}
GENESIS_FORK_VERSION: 0x10000038
GENESIS_DELAY: 300
GENESIS_DELAY: {{ .GenesisDelay }}
# Forking
# ---------------------------------------------------------------
......@@ -34,18 +34,18 @@ TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Capella
CAPELLA_FORK_VERSION: 0x40000038
CAPELLA_FORK_EPOCH: 18446744073709551615
CAPELLA_FORK_EPOCH: {{ .CapellaForkEpoch }}
# Sharding
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615
# EIP4844
EIP4844_FORK_VERSION: 0x50000040
EIP4844_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------
# 12 seconds
SECONDS_PER_SLOT: {{ .SecondsPerSlot }}
# 2**8 (= 256) epochs ~27 hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
# 5 epochs ~0.5 hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 5
# 2**8 (= 256) epochs ~27 hours
SHARD_COMMITTEE_PERIOD: 256
# It's very important that SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE is a good amount of time, else
......@@ -67,6 +67,10 @@ MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536
# Fork choice
# ---------------------------------------------------------------
# 40%
PROPOSER_SCORE_BOOST: 40
# Deposit contract
# ---------------------------------------------------------------
......
......@@ -13,10 +13,8 @@ deposit_contract_address: "{{ .DepositContractAddress }}"
genesis_timestamp: {{ .UnixTimestamp }}
# Note: The module runs a merged chain so terminal_total_difficulty is hardcoded to zero.
terminal_total_difficulty: 0
# Set to 10 per Pari's recommendation
# To read more about what this is and does, see: https://notes.ethereum.org/cmyGUbKVTTqhUGDg_GYThg
mergeForkBlock: 10
genesis_delay: {{ .GenesisDelay }}
capella_fork_epoch: {{ .CapellaForkEpoch }}
clique:
enabled: false
\ 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