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

refactor: remove slots per epoch (#285)

parent aabb9ad4
{ {
"participants": [{ "participants": [{
"el_client_type": "geth", "el_client_type": "geth",
"cl_client_type": "nimbus" "cl_client_type": "nimbus"
}], }],
"network_params": { "network_params": {
"network_id": "3151908", "network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242", "deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12, "seconds_per_slot": 12,
"slots_per_epoch": 32,
"num_validator_keys_per_node": 64, "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", "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 "capella_fork_epoch": 1
}, },
"global_client_log_level": "info", "global_client_log_level": "info",
"mev_type": "full" "mev_type": "full"
} }
\ No newline at end of file
...@@ -204,9 +204,6 @@ To configure the package behaviour, you can modify your `network_params.json` fi ...@@ -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 // Number of seconds per slot on the Beacon chain
"seconds_per_slot": 12, "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 // The number of validator keys that each CL validator node should get
"num_validator_keys_per_node": 64, "num_validator_keys_per_node": 64,
......
...@@ -169,7 +169,6 @@ def run(plan, args={}): ...@@ -169,7 +169,6 @@ def run(plan, args={}):
genesis_validators_root, genesis_validators_root,
builder_uri, builder_uri,
network_params.seconds_per_slot, network_params.seconds_per_slot,
network_params.slots_per_epoch,
) )
mev_flood_module.spam_in_background( mev_flood_module.spam_in_background(
plan, plan,
...@@ -237,7 +236,6 @@ def run(plan, args={}): ...@@ -237,7 +236,6 @@ def run(plan, args={}):
all_cl_client_contexts[0], all_cl_client_contexts[0],
network_params.deneb_fork_epoch, network_params.deneb_fork_epoch,
network_params.seconds_per_slot, network_params.seconds_per_slot,
network_params.slots_per_epoch,
network_params.genesis_delay, network_params.genesis_delay,
) )
plan.print("Succesfully launched blob spammer") plan.print("Succesfully launched blob spammer")
...@@ -249,7 +247,6 @@ def run(plan, args={}): ...@@ -249,7 +247,6 @@ def run(plan, args={}):
genesis_constants.PRE_FUNDED_ACCOUNTS, genesis_constants.PRE_FUNDED_ACCOUNTS,
all_el_client_contexts, all_el_client_contexts,
all_cl_client_contexts[0], all_cl_client_contexts[0],
network_params.slots_per_epoch,
goomy_blob_params, goomy_blob_params,
) )
plan.print("Succesfully launched goomy the blob spammer") plan.print("Succesfully launched goomy the blob spammer")
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"network_id": "3151908", "network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242", "deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12, "seconds_per_slot": 12,
"slots_per_epoch": 32,
"num_validator_keys_per_node": 64, "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", "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, "genesis_delay": 120,
......
...@@ -11,7 +11,6 @@ def launch_blob_spammer( ...@@ -11,7 +11,6 @@ def launch_blob_spammer(
cl_client_context, cl_client_context,
deneb_fork_epoch, deneb_fork_epoch,
seconds_per_slot, seconds_per_slot,
slots_per_epoch,
genesis_delay, genesis_delay,
): ):
config = get_config( config = get_config(
...@@ -20,7 +19,6 @@ def launch_blob_spammer( ...@@ -20,7 +19,6 @@ def launch_blob_spammer(
cl_client_context, cl_client_context,
deneb_fork_epoch, deneb_fork_epoch,
seconds_per_slot, seconds_per_slot,
slots_per_epoch,
genesis_delay, genesis_delay,
) )
plan.add_service(SERVICE_NAME, config) plan.add_service(SERVICE_NAME, config)
...@@ -32,10 +30,9 @@ def get_config( ...@@ -32,10 +30,9 @@ def get_config(
cl_client_context, cl_client_context,
deneb_fork_epoch, deneb_fork_epoch,
seconds_per_slot, seconds_per_slot,
slots_per_epoch,
genesis_delay, 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( return ServiceConfig(
image=IMAGE_NAME, image=IMAGE_NAME,
entrypoint=ENTRYPOINT_ARGS, entrypoint=ENTRYPOINT_ARGS,
......
...@@ -26,7 +26,6 @@ def launch_mev_relay( ...@@ -26,7 +26,6 @@ def launch_mev_relay(
validator_root, validator_root,
builder_uri, builder_uri,
seconds_per_slot, seconds_per_slot,
slots_per_epoch=32,
): ):
redis = redis_module.run(plan) redis = redis_module.run(plan)
# making the password postgres as the relay expects it to be postgres # making the password postgres as the relay expects it to be postgres
...@@ -50,7 +49,6 @@ def launch_mev_relay( ...@@ -50,7 +49,6 @@ def launch_mev_relay(
"DENEB_FORK_VERSION": "0x50000038", "DENEB_FORK_VERSION": "0x50000038",
"GENESIS_VALIDATORS_ROOT": validator_root, "GENESIS_VALIDATORS_ROOT": validator_root,
"SEC_PER_SLOT": str(seconds_per_slot), "SEC_PER_SLOT": str(seconds_per_slot),
"SLOTS_PER_EPOCH": str(slots_per_epoch),
} }
redis_url = "{}:{}".format(redis.hostname, redis.port_number) redis_url = "{}:{}".format(redis.hostname, redis.port_number)
......
...@@ -28,6 +28,9 @@ HIGH_DENEB_VALUE_FORK_VERKLE = 20000 ...@@ -28,6 +28,9 @@ HIGH_DENEB_VALUE_FORK_VERKLE = 20000
FLASHBOTS_MEV_BOOST_PORT = 18550 FLASHBOTS_MEV_BOOST_PORT = 18550
MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-" 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 = [ DEFAULT_ADDITIONAL_SERVICES = [
"tx_spammer", "tx_spammer",
"blob_spammer", "blob_spammer",
...@@ -139,7 +142,6 @@ def parse_input(plan, input_args): ...@@ -139,7 +142,6 @@ def parse_input(plan, input_args):
"deposit_contract_address" "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"],
genesis_delay=result["network_params"]["genesis_delay"], genesis_delay=result["network_params"]["genesis_delay"],
capella_fork_epoch=result["network_params"]["capella_fork_epoch"], capella_fork_epoch=result["network_params"]["capella_fork_epoch"],
deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"], deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"],
...@@ -273,9 +275,6 @@ def parse_network_params(input_args): ...@@ -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" "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: 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 ")
...@@ -295,15 +294,14 @@ def parse_network_params(input_args): ...@@ -295,15 +294,14 @@ def parse_network_params(input_args):
): ):
fail("electra can only happen with capella genesis not bellatrix") fail("electra can only happen with capella genesis not bellatrix")
required_num_validators = 2 * result["network_params"]["slots_per_epoch"]
actual_num_validators = ( actual_num_validators = (
total_participant_count total_participant_count
* result["network_params"]["num_validator_keys_per_node"] * result["network_params"]["num_validator_keys_per_node"]
) )
if required_num_validators > actual_num_validators: if MIN_VALIDATORS > actual_num_validators:
fail( fail(
"required_num_validators - {0} is greater than actual_num_validators - {1}".format( "We require at least {0} validators but got {1}".format(
required_num_validators, actual_num_validators MIN_VALIDATORS, actual_num_validators
) )
) )
...@@ -346,7 +344,6 @@ def default_network_params(): ...@@ -346,7 +344,6 @@ def default_network_params():
"network_id": "3151908", "network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242", "deposit_contract_address": "0x4242424242424242424242424242424242424242",
"seconds_per_slot": 12, "seconds_per_slot": 12,
"slots_per_epoch": 32,
"genesis_delay": 120, "genesis_delay": 120,
"capella_fork_epoch": 0, "capella_fork_epoch": 0,
"deneb_fork_epoch": 500, "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