Skip to content

Commit

Permalink
fix: path based storage disable for elecra (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Oct 19, 2023
1 parent 6e8e290 commit 86fa8ef
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ jobs:
- <<: *setup_kurtosis
- checkout
- run: kurtosis run ${PWD} "$(cat ./.circleci/tests/disable-peer-scoring.json)"
petra:
executor: ubuntu_vm
steps:
- <<: *setup_kurtosis
- checkout
- run: kurtosis run ${PWD} "$(cat ./.circleci/tests/petra.json)"

workflows:
check_latest_version:
Expand Down Expand Up @@ -389,3 +395,9 @@ workflows:
branches:
ignore:
- main

- petra:
filters:
branches:
ignore:
- main
16 changes: 16 additions & 0 deletions .circleci/tests/petra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"participants": [
{
"el_client_type": "geth",
"el_client_image": "ethpandaops/geth:gballet-kaustinen-with-shapella-a45a9f2",
"cl_client_type": "lodestar",
"cl_client_image": "ethpandaops/lodestar:g11tech-verge",
"count": 2
}
],
"network_params": {
"electra_fork_epoch": 0,
"deneb_fork_epoch": 1000
},
"additional_services": []
}
29 changes: 23 additions & 6 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def launch(
extra_params,
extra_env_vars,
launcher.electra_fork_epoch,
launcher.final_genesis_timestamp,
)

service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -146,16 +147,30 @@ def get_config(
extra_params,
extra_env_vars,
electra_fork_epoch,
final_genesis_timestamp,
):
init_datadir_cmd_str = "geth init {0} --state.scheme=path --datadir={1} {2}".format(
"--cache.preimages" if electra_fork_epoch != None else "",
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
# TODO: Remove this once electra fork has path based storage scheme implemented
if electra_fork_epoch != None:
init_datadir_cmd_str = "geth init --cache.preimages --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
else:
init_datadir_cmd_str = "geth init --state.scheme=path --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)

cmd = [
"geth",
"--state.scheme=path",
# Disable path based storage scheme for electra fork
"{0}".format("--state.scheme=path" if electra_fork_epoch == None else ""),
# Override prague fork timestamp for electra fork
"{0}".format(
"--override.prague=" + final_genesis_timestamp
if electra_fork_epoch != None
else ""
),
"--verbosity=" + verbosity_level,
"--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
"--networkid=" + network_id,
Expand Down Expand Up @@ -232,10 +247,12 @@ def get_config(
def new_geth_launcher(
network_id,
el_cl_genesis_data,
final_genesis_timestamp,
electra_fork_epoch=None,
):
return struct(
network_id=network_id,
el_cl_genesis_data=el_cl_genesis_data,
final_genesis_timestamp=final_genesis_timestamp,
electra_fork_epoch=electra_fork_epoch,
)
3 changes: 3 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ def parse_network_params(input_args):
if result["network_params"]["electra_fork_epoch"] != None:
# if electra is defined, then deneb needs to be set very high
result["network_params"]["deneb_fork_epoch"] = HIGH_DENEB_VALUE_FORK_VERKLE
# TODO: remove once transition is complete
if result["network_params"]["electra_fork_epoch"] != 0:
fail("electra_fork_epoch can only be 0 or None")

if (
result["network_params"]["capella_fork_epoch"] > 0
Expand Down
3 changes: 2 additions & 1 deletion src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def launch_participant_network(
# we are running electra - experimental
elif network_params.electra_fork_epoch != None:
ethereum_genesis_generator_image = (
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.10"
"ethpandaops/ethereum-genesis-generator:3.0.0-rc.14"
)
else:
fail(
Expand Down Expand Up @@ -132,6 +132,7 @@ def launch_participant_network(
"launcher": geth.new_geth_launcher(
network_params.network_id,
el_cl_data,
final_genesis_timestamp,
network_params.electra_fork_epoch,
),
"launch_method": geth.launch,
Expand Down

0 comments on commit 86fa8ef

Please sign in to comment.