From d17fcba022d463dddd905609b5662ecb46c92315 Mon Sep 17 00:00:00 2001 From: Martin Paulucci Date: Tue, 11 Feb 2025 17:06:07 +0100 Subject: [PATCH] chore(l1): set full sync as default. (#1905) **Motivation** Before enabling snap sync as the default, we want to have everything working smoothly with full sync. **Description** - Changes the default sync mode to full. --- README.md | 2 +- cmd/ethrex/cli.rs | 1 + cmd/ethrex/ethrex.rs | 12 ++++-------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a2aadc9b89..a506dc5dde 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ ethrex supports the following command line arguments: - `--discovery.port `: UDP port for P2P discovery. Default value: 30303. - `--bootnodes `: Comma separated enode URLs for P2P discovery bootstrap. - `--log.level `: The verbosity level used for logs. Default value: info. possible values: info, debug, trace, warn, error -- `--syncmode `: The way in which the node will sync its state. Can be either "full" or "snap" with "snap" as default value. +- `--syncmode `: The way in which the node will sync its state. Can be either "full" or "snap" with "full" as default value. - `--evm `: Has to be `levm` or `revm`. Default value: `revm`. # ethrex L2 diff --git a/cmd/ethrex/cli.rs b/cmd/ethrex/cli.rs index 8bd876887c..d717ed044c 100644 --- a/cmd/ethrex/cli.rs +++ b/cmd/ethrex/cli.rs @@ -109,6 +109,7 @@ pub fn cli() -> Command { Arg::new("syncmode") .long("syncmode") .required(false) + .default_value("full") .value_name("SYNC_MODE"), ) .arg( diff --git a/cmd/ethrex/ethrex.rs b/cmd/ethrex/ethrex.rs index 6bc97f5a22..bebce6d8b8 100644 --- a/cmd/ethrex/ethrex.rs +++ b/cmd/ethrex/ethrex.rs @@ -376,14 +376,10 @@ fn parse_socket_addr(addr: &str, port: &str) -> io::Result { fn sync_mode(matches: &clap::ArgMatches) -> SyncMode { let syncmode = matches.get_one::("syncmode"); - if let Some(syncmode) = syncmode { - match &**syncmode { - "full" => SyncMode::Full, - "snap" => SyncMode::Snap, - other => panic!("Invalid syncmode {other} expected either snap or full"), - } - } else { - SyncMode::Snap + match syncmode { + Some(mode) if mode == "full" => SyncMode::Full, + Some(mode) if mode == "snap" => SyncMode::Snap, + other => panic!("Invalid syncmode {:?} expected either snap or full", other), } }