Skip to content

Commit 58e0050

Browse files
authored
feat(l1): add full-sync flag to server runner (#4832)
This PR adds a way to enable full-sync in the server runner.
1 parent 892a497 commit 58e0050

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tooling/sync/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ endif
200200

201201
LOGS_FILE ?= output.log
202202

203-
# Use make server-sync SERVER_SYNC_BRANCH=branch_name SERVER_SYNC_NETWORK=network_name LOGS_FILE=logs_file_name HEALING=1 MEMORY=1 SNAP=1
204-
# SERVER_SYNC_BRANCH is the branch to checkout before syncing, SERVER_SYNC_NETWORK is the network to sync, LOGS_FILE is the file to output logs to, HEALING enables healing mode, MEMORY uses memory datadir, SNAP enables snap sync mode.
203+
# Use make server-sync SERVER_SYNC_BRANCH=branch_name SERVER_SYNC_NETWORK=network_name LOGS_FILE=logs_file_name HEALING=1 MEMORY=1 FULL_SYNC=1
204+
# SERVER_SYNC_BRANCH is the branch to checkout before syncing, SERVER_SYNC_NETWORK is the network to sync, LOGS_FILE is the file to output logs to, HEALING enables healing mode, MEMORY uses memory datadir, FULL_SYNC switches to full-sync mode.
205205
server-sync:
206206
git fetch --all
207207

@@ -219,4 +219,4 @@ server-sync:
219219

220220
sleep 0.2
221221

222-
tmux new-window -t sync:2 -n ethrex "cd ../../metrics && docker compose -f docker-compose-metrics.yaml -f docker-compose-metrics-l1.overrides.yaml up -d && cd .. && ulimit -n 1000000 && rm -rf ~/.local/share/ethrex && RUST_LOG=info,ethrex_p2p::sync=debug $(if $(DEBUG_ASSERT),RUSTFLAGS='-C debug-assertions=yes') $(if $(HEALING),SKIP_START_SNAP_SYNC=1) cargo run --release --bin ethrex --features rocksdb -- --http.addr 0.0.0.0 --metrics --metrics.port 3701 --network $(SERVER_SYNC_NETWORK) $(if $(MEMORY),--datadir memory) --authrpc.jwtsecret ~/secrets/jwt.hex $(if $(or $(SNAP),$(HEALING)),--syncmode snap) 2>&1 | tee $(LOGS_FILE)"
222+
tmux new-window -t sync:2 -n ethrex "cd ../../metrics && docker compose -f docker-compose-metrics.yaml -f docker-compose-metrics-l1.overrides.yaml up -d && cd .. && ulimit -n 1000000 && rm -rf ~/.local/share/ethrex && RUST_LOG=info,ethrex_p2p::sync=debug $(if $(DEBUG_ASSERT),RUSTFLAGS='-C debug-assertions=yes') $(if $(HEALING),SKIP_START_SNAP_SYNC=1) cargo run --release --bin ethrex --features rocksdb -- --http.addr 0.0.0.0 --metrics --metrics.port 3701 --network $(SERVER_SYNC_NETWORK) $(if $(MEMORY),--datadir memory) --authrpc.jwtsecret ~/secrets/jwt.hex $(if $(or $(FULL_SYNC),$(HEALING)),--syncmode full) 2>&1 | tee $(LOGS_FILE)"

tooling/sync/server_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def parse_args():
4343
parser = argparse.ArgumentParser(
4444
description="Run a Makefile with optional variables."
4545
)
46-
parser.add_argument("--snap", action="store_true", help="Whether snap is activated")
46+
parser.add_argument("--full-sync", action="store_true", help="Whether full-sync is activated")
4747
parser.add_argument(
4848
"--healing", action="store_true", help="Whether healing is activated"
4949
)
@@ -172,9 +172,9 @@ def capitalize_network(word):
172172
def get_variables(args):
173173
variables = {}
174174

175-
# Only include SNAP if flag is set
176-
if args.snap:
177-
variables["SNAP"] = "1"
175+
# Only include FULL_SYNC if flag is set
176+
if args.full_sync:
177+
variables["FULL_SYNC"] = "1"
178178
if args.healing:
179179
variables["HEALING"] = "1"
180180
if args.memory:

0 commit comments

Comments
 (0)