From ad65a428ae7736d2e8e161fec3f21622210fb799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 12 Nov 2025 13:24:34 -0300 Subject: [PATCH 1/6] feat(l1): add CLI flag to specify P2P listening address --- cmd/ethrex/cli.rs | 11 ++++++++++- cmd/ethrex/initializers.rs | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/cmd/ethrex/cli.rs b/cmd/ethrex/cli.rs index 4f153870b20..3a189c48ac4 100644 --- a/cmd/ethrex/cli.rs +++ b/cmd/ethrex/cli.rs @@ -204,11 +204,19 @@ pub struct Options { pub authrpc_jwtsecret: String, #[arg(long = "p2p.disabled", default_value = "false", value_name = "P2P_DISABLED", action = ArgAction::SetFalse, help_heading = "P2P options")] pub p2p_disabled: bool, + #[arg( + long = "p2p.addr", + default_value = None, + value_name = "ADDRESS", + help = "Listening address for the P2P protocol.", + help_heading = "P2P options" + )] + pub p2p_addr: Option, #[arg( long = "p2p.port", default_value = "30303", value_name = "PORT", - help = "TCP port for P2P protocol.", + help = "TCP port for the P2P protocol.", help_heading = "P2P options" )] pub p2p_port: String, @@ -308,6 +316,7 @@ impl Default for Options { authrpc_port: Default::default(), authrpc_jwtsecret: Default::default(), p2p_disabled: Default::default(), + p2p_addr: None, p2p_port: Default::default(), discovery_port: Default::default(), network: Default::default(), diff --git a/cmd/ethrex/initializers.rs b/cmd/ethrex/initializers.rs index b70b90c8ce8..6f39cb60213 100644 --- a/cmd/ethrex/initializers.rs +++ b/cmd/ethrex/initializers.rs @@ -30,7 +30,7 @@ use std::env; use std::{ fs, io::IsTerminal, - net::SocketAddr, + net::{IpAddr, SocketAddr}, path::{Path, PathBuf}, sync::Arc, time::{SystemTime, UNIX_EPOCH}, @@ -299,22 +299,22 @@ pub fn get_signer(datadir: &Path) -> SecretKey { } pub fn get_local_p2p_node(opts: &Options, signer: &SecretKey) -> Node { - let udp_socket_addr = parse_socket_addr("::", &opts.discovery_port) - .expect("Failed to parse discovery address and port"); - let tcp_socket_addr = - parse_socket_addr("::", &opts.p2p_port).expect("Failed to parse addr and port"); - - let p2p_node_ip = local_ip() - .unwrap_or_else(|_| local_ipv6().expect("Neither ipv4 nor ipv6 local address found")); + let tcp_port = opts.p2p_port.parse().expect("Failed to parse p2p port"); + let udp_port = opts + .discovery_port + .parse() + .expect("Failed to parse discovery port"); + + let p2p_node_ip: IpAddr = if let Some(addr) = &opts.p2p_addr { + addr.parse().expect("Failed to parse p2p address") + } else { + local_ip() + .unwrap_or_else(|_| local_ipv6().expect("Neither ipv4 nor ipv6 local address found")) + }; let local_public_key = public_key_from_signing_key(signer); - let node = Node::new( - p2p_node_ip, - udp_socket_addr.port(), - tcp_socket_addr.port(), - local_public_key, - ); + let node = Node::new(p2p_node_ip, udp_port, tcp_port, local_public_key); // TODO Find a proper place to show node information // https://github.com/lambdaclass/ethrex/issues/836 From 2b02000d1c164beff8eee56e82de4aca729ba244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:21:30 -0300 Subject: [PATCH 2/6] docs: update CLI reference --- docs/CLI.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/CLI.md b/docs/CLI.md index 409d66f7357..0be50fbbe3b 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -78,6 +78,8 @@ P2P options: --p2p.disabled + --p2p.addr
+ Listening address for the P2P protocol. --p2p.port TCP port for P2P protocol. From 8de9f8acbee42fde44d730c8e9e0a14fc1b383f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:44:21 -0300 Subject: [PATCH 3/6] docs: update CLI reference --- docs/CLI.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CLI.md b/docs/CLI.md index 0be50fbbe3b..8f97336c159 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -244,8 +244,9 @@ P2P options: --p2p.disabled + --p2p.port - TCP port for P2P protocol. + TCP port for the P2P protocol. [default: 30303] From 6cd322e136d3500350637c032929905a396e2cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 12 Nov 2025 18:07:46 -0300 Subject: [PATCH 4/6] docs: update CLI reference (this time for real) --- docs/CLI.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/CLI.md b/docs/CLI.md index 18b112aa58b..f63a7553973 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -78,11 +78,12 @@ P2P options: --p2p.disabled + --p2p.addr
Listening address for the P2P protocol. --p2p.port - TCP port for P2P protocol. + TCP port for the P2P protocol. [default: 30303] @@ -178,6 +179,11 @@ Commands: help Print this message or the help of the given subcommand(s) Options: + --osaka-activation-time + Block timestamp at which the Osaka fork is activated on L1. If not set, it will assume Osaka is already active. + + [env: ETHREX_OSAKA_ACTIVATION_TIME=] + -t, --tick-rate time in ms between two ticks @@ -244,6 +250,8 @@ P2P options: --p2p.disabled + --p2p.addr
+ Listening address for the P2P protocol. --p2p.port TCP port for the P2P protocol. @@ -372,6 +380,10 @@ L1 Watcher options: [default: 10] Block producer options: + --watcher.l1-fee-update-interval-ms
+ [env: ETHREX_WATCHER_L1_FEE_UPDATE_INTERVAL_MS=] + [default: 60000] + --block-producer.block-time How often does the sequencer produce new blocks to the L1 in milliseconds. @@ -387,11 +399,14 @@ Block producer options: --block-producer.operator-fee-vault-address
[env: ETHREX_BLOCK_PRODUCER_OPERATOR_FEE_VAULT_ADDRESS=] - --operator-fee-per-gas + --block-producer.operator-fee-per-gas Fee that the operator will receive for each unit of gas consumed in a block. [env: ETHREX_BLOCK_PRODUCER_OPERATOR_FEE_PER_GAS=] + --block-producer.l1-fee-vault-address
+ [env: ETHREX_BLOCK_PRODUCER_L1_FEE_VAULT_ADDRESS=] + --block-producer.block-gas-limit Maximum gas limit for the L2 blocks. @@ -556,7 +571,6 @@ L2 options: Monitor options: --no-monitor [env: ETHREX_NO_MONITOR=] - ``` ## ethrex l2 prover @@ -591,14 +605,4 @@ Prover client options: Possible values: info, debug, trace, warn, error [default: INFO] - - --aligned - Activate aligned proving system - - [env: PROVER_CLIENT_ALIGNED=] - - --sp1-server - Url to the moongate server to use when using sp1 backend - - [env: ETHREX_SP1_SERVER=] ``` From 197a715df274ac971f50b46d7744091f3f4a1ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 12 Nov 2025 18:10:03 -0300 Subject: [PATCH 5/6] docs: add --sp1-server option to reference --- docs/CLI.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/CLI.md b/docs/CLI.md index f63a7553973..b323f0745cb 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -605,4 +605,9 @@ Prover client options: Possible values: info, debug, trace, warn, error [default: INFO] + + --sp1-server + Url to the moongate server to use when using sp1 backend + + [env: ETHREX_SP1_SERVER=] ``` From d4afddb449cc25adcfcf5f1661a3603e1c4fe613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Fri, 14 Nov 2025 12:51:12 -0300 Subject: [PATCH 6/6] Update cmd/ethrex/cli.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cmd/ethrex/cli.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/ethrex/cli.rs b/cmd/ethrex/cli.rs index 3a189c48ac4..95e79f57509 100644 --- a/cmd/ethrex/cli.rs +++ b/cmd/ethrex/cli.rs @@ -206,7 +206,6 @@ pub struct Options { pub p2p_disabled: bool, #[arg( long = "p2p.addr", - default_value = None, value_name = "ADDRESS", help = "Listening address for the P2P protocol.", help_heading = "P2P options"