Skip to content

Commit

Permalink
fix: path based storage - disable for older forks (#336)
Browse files Browse the repository at this point in the history
If capella fork epoch is set, we assume that we want to test an older
version of geth.
  • Loading branch information
barnabasbusa committed Oct 25, 2023
1 parent c9669ae commit 76e3424
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/eip4788_deployment/eip4788_deployment_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ EIP4788_DEPLOYMENT_SERVICE_NAME = "eip4788-contract-deployment"


def deploy_eip4788_contract_in_background(plan, sender_key, el_uri):
sender_script = plan.upload_files("./sender.py")
sender_script = plan.upload_files(
src="./sender.py", name="eip4788-deployment-sender"
)

plan.add_service(
name=EIP4788_DEPLOYMENT_SERVICE_NAME,
Expand Down
13 changes: 10 additions & 3 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
launcher.capella_fork_epoch,
launcher.electra_fork_epoch,
launcher.final_genesis_timestamp,
)
Expand Down Expand Up @@ -146,6 +147,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
capella_fork_epoch,
electra_fork_epoch,
final_genesis_timestamp,
):
Expand All @@ -156,7 +158,7 @@ def get_config(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
elif "--builder" in extra_params:
elif "--builder" in extra_params or capella_fork_epoch != 0:
init_datadir_cmd_str = "geth init --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
Expand All @@ -169,11 +171,14 @@ def get_config(

cmd = [
"geth",
# Disable path based storage scheme for electra fork or when builder image is used
# Disable path based storage scheme for electra fork or when builder image or when capella is not 0 is used
# TODO: REMOVE Once geth default db is path based, and builder rebased
# TODO: capella fork epoch check is needed to ensure older versions of geth works.
"{0}".format(
"--state.scheme=path"
if electra_fork_epoch == None and "--builder" not in extra_params
if electra_fork_epoch == None
and "--builder" not in extra_params
and capella_fork_epoch == 0
else ""
),
# Override prague fork timestamp for electra fork
Expand Down Expand Up @@ -261,11 +266,13 @@ def new_geth_launcher(
network_id,
el_cl_genesis_data,
final_genesis_timestamp,
capella_fork_epoch,
electra_fork_epoch=None,
):
return struct(
network_id=network_id,
el_cl_genesis_data=el_cl_genesis_data,
final_genesis_timestamp=final_genesis_timestamp,
capella_fork_epoch=capella_fork_epoch,
electra_fork_epoch=electra_fork_epoch,
)
2 changes: 1 addition & 1 deletion src/grafana/grafana_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def upload_additional_dashboards(plan, additional_dashboards):
)
)
additional_dashboard_artifact_name = plan.upload_files(
dashboard_src,
dashboard_src, name="additional-grafana-dashboard-{0}".format(index)
)
data.append(
{
Expand Down
2 changes: 1 addition & 1 deletion src/mev_custom_flood/mev_custom_flood_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CUSTOM_FLOOD_SERVICE_NAME = "mev-custom-flood"


def spam_in_background(plan, sender_key, receiver_key, el_uri, params):
sender_script = plan.upload_files("./sender.py")
sender_script = plan.upload_files(src="./sender.py", name="mev-custom-flood-sender")

plan.add_service(
name=CUSTOM_FLOOD_SERVICE_NAME,
Expand Down
2 changes: 2 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def launch_participant_network(
network_params.network_id,
el_cl_data,
final_genesis_timestamp,
network_params.capella_fork_epoch,
network_params.electra_fork_epoch,
),
"launch_method": geth.launch,
Expand Down Expand Up @@ -424,5 +425,6 @@ padding = int(sys.argv[1])
print(int(time.time()+padding), end="")
""",
args=[str(padding)],
store=[StoreSpec(src="/tmp", name="final-genesis-timestamp")],
)
return result.output
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def generate_el_cl_genesis_data(
run="cp /opt/values.env /config/values.env && ./entrypoint.sh all",
image=image,
files={GENESIS_VALUES_PATH: genesis_generation_config_artifact_name},
store=[
"/data",
],
store=[StoreSpec(src="/data", name="el-cl-genesis-data")],
wait=None,
)

Expand All @@ -70,6 +68,7 @@ with open("/data/data/custom_config_data/genesis_validators_root.txt") as genesi
print(genesis_root.read().strip(), end="")
""",
files={"/data": genesis.files_artifacts[0]},
store=[StoreSpec(src="/tmp", name="genesis-validators-root")],
wait=None,
)
result = el_cl_genesis_data.new_el_cl_genesis_data(
Expand Down

0 comments on commit 76e3424

Please sign in to comment.