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
a1d69279
Unverified
Commit
a1d69279
authored
Dec 16, 2022
by
parithosh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating configs for genesis delay and capella
parent
9bb76d57
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
26 deletions
+51
-26
parse_input.star
src/package_io/parse_input.star
+10
-0
participant_network.star
src/participant_network/participant_network.star
+11
-10
cl_genesis_data_generator.star
..._data_generator/cl_genesis/cl_genesis_data_generator.star
+8
-2
el_genesis_data_generator.star
..._data_generator/el_genesis/el_genesis_data_generator.star
+8
-2
prelaunch_data_generator_launcher.star
...generator_launcher/prelaunch_data_generator_launcher.star
+1
-1
config.yaml.tmpl
static_files/genesis-generation-config/cl/config.yaml.tmpl
+11
-7
genesis-config.yaml.tmpl
...les/genesis-generation-config/el/genesis-config.yaml.tmpl
+2
-4
No files found.
src/package_io/parse_input.star
View file @
a1d69279
...
@@ -84,6 +84,12 @@ def parse_input(input_args):
...
@@ -84,6 +84,12 @@ def parse_input(input_args):
if result["network_params"]["seconds_per_slot"] == 0:
if result["network_params"]["seconds_per_slot"] == 0:
fail("seconds_per_slot is 0 needs to be > 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"]
required_num_validtors = 2 * result["network_params"]["slots_per_epoch"]
actual_num_validators = len(result["participants"]) * result["network_params"]["num_validator_keys_per_node"]
actual_num_validators = len(result["participants"]) * result["network_params"]["num_validator_keys_per_node"]
if required_num_validtors > actual_num_validators:
if required_num_validtors > actual_num_validators:
...
@@ -113,6 +119,8 @@ def parse_input(input_args):
...
@@ -113,6 +119,8 @@ def parse_input(input_args):
deposit_contract_address=result["network_params"]["deposit_contract_address"],
deposit_contract_address=result["network_params"]["deposit_contract_address"],
seconds_per_slot=result["network_params"]["seconds_per_slot"],
seconds_per_slot=result["network_params"]["seconds_per_slot"],
slots_per_epoch=result["network_params"]["slots_per_epoch"],
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"],
launch_additional_services=result["launch_additional_services"],
wait_for_finalization=result["wait_for_finalization"],
wait_for_finalization=result["wait_for_finalization"],
...
@@ -151,6 +159,8 @@ def default_network_params():
...
@@ -151,6 +159,8 @@ def default_network_params():
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12,
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"slots_per_epoch": 32,
"genesis_delay": 120,
"capella_fork_epoch": 5,
}
}
def default_participant():
def default_participant():
...
...
src/participant_network/participant_network.star
View file @
a1d69279
...
@@ -45,7 +45,6 @@ CL_CLIENT_CONTEXT_BOOTNODE = None
...
@@ -45,7 +45,6 @@ CL_CLIENT_CONTEXT_BOOTNODE = None
def launch_participant_network(participants, network_params, global_log_level):
def launch_participant_network(participants, network_params, global_log_level):
num_participants = len(participants)
num_participants = len(participants)
el_genesis_timestamp = time.now().unix
...
@@ -59,13 +58,17 @@ def launch_participant_network(participants, network_params, global_log_level):
...
@@ -59,13 +58,17 @@ def launch_participant_network(participants, network_params, global_log_level):
print(json.indent(json.encode(cl_validator_data)))
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")
print("Generating EL data")
el_genesis_generation_config_template = read_file(static_files.EL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH)
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_data = el_genesis_data_generator.generate_el_genesis_data(
el_genesis_generation_config_template,
el_genesis_generation_config_template,
e
l_genesis_timestamp,
fina
l_genesis_timestamp,
network_params.network_id,
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):
...
@@ -112,9 +115,6 @@ def launch_participant_network(participants, network_params, global_log_level):
print("Generating CL data")
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_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)
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
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):
...
@@ -122,13 +122,14 @@ def launch_participant_network(participants, network_params, global_log_level):
genesis_generation_config_yml_template,
genesis_generation_config_yml_template,
genesis_generation_mnemonics_yml_template,
genesis_generation_mnemonics_yml_template,
el_genesis_data,
el_genesis_data,
c
l_genesis_timestamp,
fina
l_genesis_timestamp,
network_params.network_id,
network_params.network_id,
network_params.deposit_contract_address,
network_params.deposit_contract_address,
network_params.seconds_per_slot,
network_params.seconds_per_slot,
network_params.preregistered_validator_keys_mnemonic,
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)))
print(json.indent(json.encode(cl_genesis_data)))
...
@@ -220,5 +221,5 @@ def launch_participant_network(participants, network_params, global_log_level):
...
@@ -220,5 +221,5 @@ def launch_participant_network(participants, network_params, global_log_level):
all_participants.append(participant_entry)
all_participants.append(participant_entry)
return all_participants,
c
l_genesis_timestamp
return all_participants,
fina
l_genesis_timestamp
src/participant_network/prelaunch_data_generator/cl_genesis/cl_genesis_data_generator.star
View file @
a1d69279
...
@@ -32,7 +32,9 @@ def generate_cl_genesis_data(
...
@@ -32,7 +32,9 @@ def generate_cl_genesis_data(
deposit_contract_address,
deposit_contract_address,
seconds_per_slot,
seconds_per_slot,
preregistered_validator_keys_mnemonic,
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(
template_data = new_cl_genesis_config_template_data(
network_id,
network_id,
...
@@ -41,6 +43,8 @@ def generate_cl_genesis_data(
...
@@ -41,6 +43,8 @@ def generate_cl_genesis_data(
total_num_validator_keys_to_preregister,
total_num_validator_keys_to_preregister,
preregistered_validator_keys_mnemonic,
preregistered_validator_keys_mnemonic,
deposit_contract_address,
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)
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(
...
@@ -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 {
return {
"NetworkId": network_id,
"NetworkId": network_id,
"SecondsPerSlot": seconds_per_slot,
"SecondsPerSlot": seconds_per_slot,
...
@@ -159,4 +163,6 @@ def new_cl_genesis_config_template_data(network_id, seconds_per_slot, unix_times
...
@@ -159,4 +163,6 @@ def new_cl_genesis_config_template_data(network_id, seconds_per_slot, unix_times
"NumValidatorKeysToPreregister": num_validator_keys_to_preregister,
"NumValidatorKeysToPreregister": num_validator_keys_to_preregister,
"PreregisteredValidatorKeysMnemonic": preregistered_validator_keys_mnemonic,
"PreregisteredValidatorKeysMnemonic": preregistered_validator_keys_mnemonic,
"DepositContractAddress": deposit_contract_address,
"DepositContractAddress": deposit_contract_address,
"GenesisDelay": genesis_delay,
"CapellaForkEpoch": capella_fork_epoch
}
}
src/participant_network/prelaunch_data_generator/el_genesis/el_genesis_data_generator.star
View file @
a1d69279
...
@@ -29,12 +29,16 @@ def generate_el_genesis_data(
...
@@ -29,12 +29,16 @@ def generate_el_genesis_data(
genesis_generation_config_template,
genesis_generation_config_template,
genesis_unix_timestamp,
genesis_unix_timestamp,
network_id,
network_id,
deposit_contract_address):
deposit_contract_address,
genesis_delay,
capella_fork_epoch):
template_data = genesis_generation_config_template_data(
template_data = genesis_generation_config_template_data(
network_id,
network_id,
deposit_contract_address,
deposit_contract_address,
genesis_unix_timestamp,
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)
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(
...
@@ -123,9 +127,11 @@ def generate_el_genesis_data(
return result
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 {
return {
"NetworkId": network_id,
"NetworkId": network_id,
"DepositContractAddress": deposit_contract_address,
"DepositContractAddress": deposit_contract_address,
"UnixTimestamp": unix_timestamp,
"UnixTimestamp": unix_timestamp,
"GenesisDelay": genesis_delay,
"CapellaForkEpoch": capella_fork_epoch
}
}
src/participant_network/prelaunch_data_generator/prelaunch_data_generator_launcher/prelaunch_data_generator_launcher.star
View file @
a1d69279
IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.
3
"
IMAGE = "ethpandaops/ethereum-genesis-generator:1.0.
4
"
SERVICE_ID_PREFIX = "prelaunch-data-generator-"
SERVICE_ID_PREFIX = "prelaunch-data-generator-"
...
...
static_files/genesis-generation-config/cl/config.yaml.tmpl
View file @
a1d69279
...
@@ -9,7 +9,7 @@ CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts w
...
@@ -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_ACTIVE_VALIDATOR_COUNT: {{ .NumValidatorKeysToPreregister }}
MIN_GENESIS_TIME: {{ .UnixTimestamp }}
MIN_GENESIS_TIME: {{ .UnixTimestamp }}
GENESIS_FORK_VERSION: 0x10000038
GENESIS_FORK_VERSION: 0x10000038
GENESIS_DELAY:
300
GENESIS_DELAY:
{{ .GenesisDelay }}
# Forking
# Forking
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
@@ -34,18 +34,18 @@ TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
...
@@ -34,18 +34,18 @@ TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Capella
# Capella
CAPELLA_FORK_VERSION: 0x40000038
CAPELLA_FORK_VERSION: 0x40000038
CAPELLA_FORK_EPOCH:
18446744073709551615
CAPELLA_FORK_EPOCH:
{{ .CapellaForkEpoch }}
#
Sharding
#
EIP4844
SHARDING_FORK_VERSION: 0x0300102
0
EIP4844_FORK_VERSION: 0x5000004
0
SHARDING
_FORK_EPOCH: 18446744073709551615
EIP4844
_FORK_EPOCH: 18446744073709551615
# Time parameters
# Time parameters
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# 12 seconds
# 12 seconds
SECONDS_PER_SLOT: {{ .SecondsPerSlot }}
SECONDS_PER_SLOT: {{ .SecondsPerSlot }}
#
2**8 (= 256) epochs ~27
hours
#
5 epochs ~0.5
hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY:
256
MIN_VALIDATOR_WITHDRAWABILITY_DELAY:
5
# 2**8 (= 256) epochs ~27 hours
# 2**8 (= 256) epochs ~27 hours
SHARD_COMMITTEE_PERIOD: 256
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
...
@@ -67,6 +67,10 @@ MIN_PER_EPOCH_CHURN_LIMIT: 4
...
@@ -67,6 +67,10 @@ MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536
CHURN_LIMIT_QUOTIENT: 65536
# Fork choice
# ---------------------------------------------------------------
# 40%
PROPOSER_SCORE_BOOST: 40
# Deposit contract
# Deposit contract
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
...
static_files/genesis-generation-config/el/genesis-config.yaml.tmpl
View file @
a1d69279
...
@@ -13,10 +13,8 @@ deposit_contract_address: "{{ .DepositContractAddress }}"
...
@@ -13,10 +13,8 @@ deposit_contract_address: "{{ .DepositContractAddress }}"
genesis_timestamp: {{ .UnixTimestamp }}
genesis_timestamp: {{ .UnixTimestamp }}
# Note: The module runs a merged chain so terminal_total_difficulty is hardcoded to zero.
# Note: The module runs a merged chain so terminal_total_difficulty is hardcoded to zero.
terminal_total_difficulty: 0
terminal_total_difficulty: 0
genesis_delay: {{ .GenesisDelay }}
# Set to 10 per Pari's recommendation
capella_fork_epoch: {{ .CapellaForkEpoch }}
# To read more about what this is and does, see: https://notes.ethereum.org/cmyGUbKVTTqhUGDg_GYThg
mergeForkBlock: 10
clique:
clique:
enabled: false
enabled: false
\ No newline at end of file
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