From cfa9b00ca3eb13a536c3c47cae6f607c02331d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:23:02 -0300 Subject: [PATCH] feat: add full-sync flag to server runner --- tooling/sync/Makefile | 6 +++--- tooling/sync/server_runner.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tooling/sync/Makefile b/tooling/sync/Makefile index f12ba77cd8..8f48fef2e9 100644 --- a/tooling/sync/Makefile +++ b/tooling/sync/Makefile @@ -200,8 +200,8 @@ endif LOGS_FILE ?= output.log -# 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 -# 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. +# 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 +# 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. server-sync: git fetch --all @@ -219,4 +219,4 @@ server-sync: sleep 0.2 - 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)" + 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)" diff --git a/tooling/sync/server_runner.py b/tooling/sync/server_runner.py index 5d8e1a93b0..466cc76140 100644 --- a/tooling/sync/server_runner.py +++ b/tooling/sync/server_runner.py @@ -43,7 +43,7 @@ def parse_args(): parser = argparse.ArgumentParser( description="Run a Makefile with optional variables." ) - parser.add_argument("--snap", action="store_true", help="Whether snap is activated") + parser.add_argument("--full-sync", action="store_true", help="Whether full-sync is activated") parser.add_argument( "--healing", action="store_true", help="Whether healing is activated" ) @@ -172,9 +172,9 @@ def capitalize_network(word): def get_variables(args): variables = {} - # Only include SNAP if flag is set - if args.snap: - variables["SNAP"] = "1" + # Only include FULL_SYNC if flag is set + if args.full_sync: + variables["FULL_SYNC"] = "1" if args.healing: variables["HEALING"] = "1" if args.memory: