Skip to content

Commit

Permalink
fix: geth flags for verkle genesis (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed Oct 23, 2023
1 parent 242a4cd commit e721373
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def run(plan, args={}):
dora_config_template,
all_cl_client_contexts,
el_cl_data_files_artifact_uuid,
network_params.electra_fork_epoch,
)
plan.print("Succesfully launched dora")
elif additional_service == "full_beaconchain_explorer":
Expand Down
19 changes: 16 additions & 3 deletions src/dora/dora_launcher.star
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
shared_utils = import_module("../shared_utils/shared_utils.star")
constants = import_module("../package_io/constants.star")
SERVICE_NAME = "dora"
IMAGE_NAME = "ethpandaops/dora:master"

HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 8080
Expand All @@ -24,7 +23,11 @@ USED_PORTS = {


def launch_dora(
plan, config_template, cl_client_contexts, el_cl_data_files_artifact_uuid
plan,
config_template,
cl_client_contexts,
el_cl_data_files_artifact_uuid,
electra_fork_epoch,
):
all_cl_client_info = []
for index, client in enumerate(cl_client_contexts):
Expand All @@ -49,16 +52,26 @@ def launch_dora(
config = get_config(
config_files_artifact_name,
el_cl_data_files_artifact_uuid,
electra_fork_epoch,
)

plan.add_service(SERVICE_NAME, config)


def get_config(config_files_artifact_name, el_cl_data_files_artifact_uuid):
def get_config(
config_files_artifact_name, el_cl_data_files_artifact_uuid, electra_fork_epoch
):
config_file_path = shared_utils.path_join(
DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
DORA_CONFIG_FILENAME,
)

# TODO: This is a hack to get the verkle support image for the electra fork
if electra_fork_epoch != None:
IMAGE_NAME = "ethpandaops/dora:verkle-support"
else:
IMAGE_NAME = "ethpandaops/dora:master"

return ServiceConfig(
image=IMAGE_NAME,
ports=USED_PORTS,
Expand Down
7 changes: 5 additions & 2 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def get_config(
):
# 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(
init_datadir_cmd_str = "geth init --cache.preimages --override.prague={0} --datadir={1} {2}".format(
final_genesis_timestamp,
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
)
Expand All @@ -172,10 +173,12 @@ def get_config(
# TODO: REMOVE Once geth default db is path based, and builder rebased
"{0}".format(
"--state.scheme=path"
if electra_fork_epoch != None or "--builder" not in extra_params
if electra_fork_epoch == None and "--builder" not in extra_params
else ""
),
# Override prague fork timestamp for electra fork
"{0}".format("--cache.preimages" 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
Expand Down

0 comments on commit e721373

Please sign in to comment.