Skip to content

Commit

Permalink
feat: make it possible to have capella on epoch 0 or non 0 (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Aug 31, 2023
1 parent 7a0c2d0 commit 1133497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FULL_MEV_TYPE = "full"
PATH_TO_PARSED_BEACON_STATE = "/genesis/output/parsedBeaconState.json"

def run(plan, args):
args_with_right_defaults, args_with_defaults_dict = parse_input.parse_input(args)
args_with_right_defaults, args_with_defaults_dict = parse_input.parse_input(plan, args)

num_participants = len(args_with_right_defaults.participants)
network_params = args_with_right_defaults.network_params
Expand Down
12 changes: 6 additions & 6 deletions src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-"

package_io = import_module("github.com/kurtosis-tech/eth-network-package/package_io/constants.star")

def parse_input(input_args):
def parse_input(plan, input_args):
result = default_input_args()
for attr in input_args:
value = input_args[attr]
Expand Down Expand Up @@ -101,9 +101,6 @@ def parse_input(input_args):
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 ")

if result["network_params"]["deneb_fork_epoch"] == 0:
fail("deneb_fork_epoch is 0 needs to be > 0 ")

Expand All @@ -117,6 +114,9 @@ def parse_input(input_args):


if result.get("mev_type") in ("mock", "full"):
if result["network_params"]["capella_fork_epoch"] == 0:
plan.print("MEV components require a non zero value for the network_params.capella_fork_epoch; setting it to 1 as its 0")
result["network_params"]["capella_fork_epoch"] = 1
result = enrich_mev_extra_params(result, MEV_BOOST_SERVICE_NAME_PREFIX, FLASHBOTS_MEV_BOOST_PORT, result.get("mev_type"))

return struct(
Expand Down Expand Up @@ -196,8 +196,8 @@ def default_network_params():
"seconds_per_slot": 12,
"slots_per_epoch": 32,
"genesis_delay": 120,
"capella_fork_epoch": 1,
"deneb_fork_epoch": 500
"capella_fork_epoch": 0,
"deneb_fork_epoch": 500
}

def default_participant():
Expand Down

0 comments on commit 1133497

Please sign in to comment.