Commit df27a8e8 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

refactor: remove slots per epoch (#285)

parent aabb9ad4
......@@ -7,7 +7,6 @@
"network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"num_validator_keys_per_node": 64,
"preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete",
"capella_fork_epoch": 1
......
......@@ -204,9 +204,6 @@ To configure the package behaviour, you can modify your `network_params.json` fi
// Number of seconds per slot on the Beacon chain
"seconds_per_slot": 12,
// Number of slots in an epoch on the Beacon chain
"slots_per_epoch": 32,
// The number of validator keys that each CL validator node should get
"num_validator_keys_per_node": 64,
......
......@@ -169,7 +169,6 @@ def run(plan, args={}):
genesis_validators_root,
builder_uri,
network_params.seconds_per_slot,
network_params.slots_per_epoch,
)
mev_flood_module.spam_in_background(
plan,
......@@ -237,7 +236,6 @@ def run(plan, args={}):
all_cl_client_contexts[0],
network_params.deneb_fork_epoch,
network_params.seconds_per_slot,
network_params.slots_per_epoch,
network_params.genesis_delay,
)
plan.print("Succesfully launched blob spammer")
......@@ -249,7 +247,6 @@ def run(plan, args={}):
genesis_constants.PRE_FUNDED_ACCOUNTS,
all_el_client_contexts,
all_cl_client_contexts[0],
network_params.slots_per_epoch,
goomy_blob_params,
)
plan.print("Succesfully launched goomy the blob spammer")
......
......@@ -18,7 +18,6 @@
"network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"num_validator_keys_per_node": 64,
"preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete",
"genesis_delay": 120,
......
......@@ -11,7 +11,6 @@ def launch_blob_spammer(
cl_client_context,
deneb_fork_epoch,
seconds_per_slot,
slots_per_epoch,
genesis_delay,
):
config = get_config(
......@@ -20,7 +19,6 @@ def launch_blob_spammer(
cl_client_context,
deneb_fork_epoch,
seconds_per_slot,
slots_per_epoch,
genesis_delay,
)
plan.add_service(SERVICE_NAME, config)
......@@ -32,10 +30,9 @@ def get_config(
cl_client_context,
deneb_fork_epoch,
seconds_per_slot,
slots_per_epoch,
genesis_delay,
):
dencunTime = (deneb_fork_epoch * slots_per_epoch * seconds_per_slot) + genesis_delay
dencunTime = (deneb_fork_epoch * 32 * seconds_per_slot) + genesis_delay
return ServiceConfig(
image=IMAGE_NAME,
entrypoint=ENTRYPOINT_ARGS,
......
......@@ -26,7 +26,6 @@ def launch_mev_relay(
validator_root,
builder_uri,
seconds_per_slot,
slots_per_epoch=32,
):
redis = redis_module.run(plan)
# making the password postgres as the relay expects it to be postgres
......@@ -50,7 +49,6 @@ def launch_mev_relay(
"DENEB_FORK_VERSION": "0x50000038",
"GENESIS_VALIDATORS_ROOT": validator_root,
"SEC_PER_SLOT": str(seconds_per_slot),
"SLOTS_PER_EPOCH": str(slots_per_epoch),
}
redis_url = "{}:{}".format(redis.hostname, redis.port_number)
......
......@@ -28,6 +28,9 @@ HIGH_DENEB_VALUE_FORK_VERKLE = 20000
FLASHBOTS_MEV_BOOST_PORT = 18550
MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-"
# Minimum number of validators required for a network to be valid is 64
MIN_VALIDATORS = 64
DEFAULT_ADDITIONAL_SERVICES = [
"tx_spammer",
"blob_spammer",
......@@ -139,7 +142,6 @@ def parse_input(plan, input_args):
"deposit_contract_address"
],
seconds_per_slot=result["network_params"]["seconds_per_slot"],
slots_per_epoch=result["network_params"]["slots_per_epoch"],
genesis_delay=result["network_params"]["genesis_delay"],
capella_fork_epoch=result["network_params"]["capella_fork_epoch"],
deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"],
......@@ -273,9 +275,6 @@ def parse_network_params(input_args):
"preregistered_validator_keys_mnemonic is empty or spaces it needs to be of non zero length"
)
if result["network_params"]["slots_per_epoch"] == 0:
fail("slots_per_epoch is 0 needs to be > 0 ")
if result["network_params"]["seconds_per_slot"] == 0:
fail("seconds_per_slot is 0 needs to be > 0 ")
......@@ -295,15 +294,14 @@ def parse_network_params(input_args):
):
fail("electra can only happen with capella genesis not bellatrix")
required_num_validators = 2 * result["network_params"]["slots_per_epoch"]
actual_num_validators = (
total_participant_count
* result["network_params"]["num_validator_keys_per_node"]
)
if required_num_validators > actual_num_validators:
if MIN_VALIDATORS > actual_num_validators:
fail(
"required_num_validators - {0} is greater than actual_num_validators - {1}".format(
required_num_validators, actual_num_validators
"We require at least {0} validators but got {1}".format(
MIN_VALIDATORS, actual_num_validators
)
)
......@@ -346,7 +344,6 @@ def default_network_params():
"network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"genesis_delay": 120,
"capella_fork_epoch": 0,
"deneb_fork_epoch": 500,
......
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