diff --git a/cmd/ethrex/cli.rs b/cmd/ethrex/cli.rs index 4f153870b20..95e79f57509 100644 --- a/cmd/ethrex/cli.rs +++ b/cmd/ethrex/cli.rs @@ -204,11 +204,18 @@ 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", + 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 +315,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 diff --git a/docs/CLI.md b/docs/CLI.md index 471832f73ea..b323f0745cb 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -79,8 +79,11 @@ 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] @@ -176,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 @@ -242,8 +250,11 @@ 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] @@ -369,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. @@ -384,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. @@ -553,7 +571,6 @@ L2 options: Monitor options: --no-monitor [env: ETHREX_NO_MONITOR=] - ``` ## ethrex l2 prover @@ -589,11 +606,6 @@ Prover client options: [default: INFO] - --aligned - Activate aligned proving system - - [env: PROVER_CLIENT_ALIGNED=] - --sp1-server Url to the moongate server to use when using sp1 backend