Skip to content

Commit b7592ec

Browse files
authored
fix: disable full sync if gcmode is archive (ethereum#563)
1 parent ea4cd08 commit b7592ec

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/el/geth/geth_launcher.star

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ def get_config(
197197
tolerations,
198198
node_selectors,
199199
):
200+
if "--gcmode=archive" in extra_params or "--gcmode archive" in extra_params:
201+
gcmode_archive = True
202+
else:
203+
gcmode_archive = False
200204
# TODO: Remove this once electra fork has path based storage scheme implemented
201205
if (
202206
constants.NETWORK_NAME.verkle in network
@@ -217,9 +221,7 @@ def get_config(
217221
elif constants.NETWORK_NAME.shadowfork in network:
218222
init_datadir_cmd_str = "echo shadowfork"
219223

220-
elif (
221-
"--gcmode archive" in extra_params
222-
): # Disable path based storage scheme archive mode
224+
elif gcmode_archive: # Disable path based storage scheme archive mode
223225
init_datadir_cmd_str = "geth init --state.scheme=hash --datadir={0} {1}".format(
224226
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
225227
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
@@ -236,7 +238,7 @@ def get_config(
236238
# TODO: REMOVE Once geth default db is path based, and builder rebased
237239
"{0}".format(
238240
"--state.scheme=path"
239-
if "verkle" not in network and "--gcmode archive" not in extra_params
241+
if "verkle" not in network and not gcmode_archive
240242
else ""
241243
),
242244
# Override prague fork timestamp for electra fork
@@ -275,7 +277,7 @@ def get_config(
275277
"--authrpc.addr=0.0.0.0",
276278
"--authrpc.vhosts=*",
277279
"--authrpc.jwtsecret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
278-
"--syncmode=full",
280+
"--syncmode=full" if not gcmode_archive else "--gcmode=archive",
279281
"--rpc.allow-unprotected-txs",
280282
"--metrics",
281283
"--metrics.addr=0.0.0.0",

0 commit comments

Comments
 (0)