Skip to content

Commit e042c40

Browse files
authored
Merge branch 'main' into fix-invalid-payload-tests
2 parents 5cb227f + b5e339c commit e042c40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+27387
-148
lines changed

.github/workflows/pr-main_l2_contracts.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
uses: dtolnay/rust-toolchain@stable
2525
- name: Install solc
2626
uses: pontem-network/get-solc@master
27+
with:
28+
version: v0.8.29
2729
- name: Caching
2830
uses: Swatinem/rust-cache@v2
2931
- name: Run test of deployer.rs

.github/workflows/pr-main_levm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ jobs:
322322

323323
- name: Install solc
324324
uses: pontem-network/get-solc@master
325+
with:
326+
version: v0.8.29
325327

326328
- name: Run benchmarks
327329
run: |

.github/workflows/pr_perf_levm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535

3636
- name: Install solc
3737
uses: pontem-network/get-solc@master
38+
with:
39+
version: v0.8.29
3840

3941
- name: Run PR benchmarks
4042
run: |
@@ -89,6 +91,8 @@ jobs:
8991

9092
- name: Install solc
9193
uses: pontem-network/get-solc@master
94+
with:
95+
version: v0.8.29
9296

9397
- name: Run main benchmarks
9498
run: |

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### 2025-04-11
66

7+
- Removed some unnecessary clones and made some functions const: [2438](https://github.com/lambdaclass/ethrex/pull/2438)
8+
79
- Asyncify some DB read APIs, as well as its users [#2430](https://github.com/lambdaclass/ethrex/pull/2430)
810

911
### 2025-04-09

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Options:
205205
206206
Node options:
207207
--network <GENESIS_FILE_PATH>
208-
Alternatively, the name of a known network can be provided instead to use its preset genesis file and include its preset bootnodes. The networks currently supported include holesky, sepolia and hoodi.
208+
Alternatively, the name of a known network can be provided instead to use its preset genesis file and include its preset bootnodes. The networks currently supported include holesky, sepolia, hoodi and mainnet.
209209
210210
--datadir <DATABASE_DIRECTORY>
211211
If the datadir is the word `memory`, ethrex will use the `InMemory Engine`.
@@ -314,7 +314,7 @@ At a high level, the following new parts are added to the node:
314314

315315
- [Rust (explained in L1 requirements section above)](#build)
316316
- [Docker](https://docs.docker.com/engine/install/) (with [Docker Compose](https://docs.docker.com/compose/install/))
317-
- [The Solidity Compiler](https://docs.soliditylang.org/en/latest/installing-solidity.html) (solc)
317+
- [The Solidity Compiler](https://docs.soliditylang.org/en/latest/installing-solidity.html) (solc v0.8.29)
318318

319319
## How to run
320320

cmd/ethrex/cli.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ pub struct Options {
3636
long = "network",
3737
value_name = "GENESIS_FILE_PATH",
3838
help = "Receives a `Genesis` struct in json format. This is the only argument which is required. You can look at some example genesis files at `test_data/genesis*`.",
39-
long_help = "Alternatively, the name of a known network can be provided instead to use its preset genesis file and include its preset bootnodes. The networks currently supported include holesky, sepolia and hoodi.",
40-
help_heading = "Node options"
39+
long_help = "Alternatively, the name of a known network can be provided instead to use its preset genesis file and include its preset bootnodes. The networks currently supported include holesky, sepolia, hoodi and mainnet.",
40+
help_heading = "Node options",
41+
env = "ETHREX_NETWORK"
4142
)]
4243
pub network: Option<String>,
4344
#[arg(long = "bootnodes", value_parser = clap::value_parser!(Node), value_name = "BOOTNODE_LIST", value_delimiter = ',', num_args = 1.., help = "Comma separated enode URLs for P2P discovery bootstrap.", help_heading = "P2P options")]
@@ -49,7 +50,8 @@ pub struct Options {
4950
default_value = DEFAULT_DATADIR,
5051
help = "Receives the name of the directory where the Database is located.",
5152
long_help = "If the datadir is the word `memory`, ethrex will use the `InMemory Engine`.",
52-
help_heading = "Node options"
53+
help_heading = "Node options",
54+
env = "ETHREX_DATADIR"
5355
)]
5456
pub datadir: String,
5557
#[arg(
@@ -73,7 +75,8 @@ pub struct Options {
7375
long = "metrics.port",
7476
value_name = "PROMETHEUS_METRICS_PORT",
7577
default_value = "9090", // Default Prometheus port (https://prometheus.io/docs/tutorials/getting_started/#show-me-how-it-is-done).
76-
help_heading = "Node options"
78+
help_heading = "Node options",
79+
env = "ETHREX_METRICS_PORT"
7780
)]
7881
pub metrics_port: String,
7982
#[arg(
@@ -90,25 +93,33 @@ pub struct Options {
9093
value_name = "EVM_BACKEND",
9194
help = "Has to be `levm` or `revm`",
9295
value_parser = utils::parse_evm_engine,
93-
help_heading = "Node options"
94-
)]
96+
help_heading = "Node options",
97+
env = "ETHREX_EVM")]
9598
pub evm: EvmEngine,
96-
#[arg(long = "log.level", default_value_t = Level::INFO, value_name = "LOG_LEVEL", help = "The verbosity level used for logs.", long_help = "Possible values: info, debug, trace, warn, error",help_heading = "Node options")]
99+
#[arg(
100+
long = "log.level",
101+
default_value_t = Level::INFO,
102+
value_name = "LOG_LEVEL",
103+
help = "The verbosity level used for logs.",
104+
long_help = "Possible values: info, debug, trace, warn, error",
105+
help_heading = "Node options")]
97106
pub log_level: Level,
98107
#[arg(
99108
long = "http.addr",
100109
default_value = "localhost",
101110
value_name = "ADDRESS",
102111
help = "Listening address for the http rpc server.",
103-
help_heading = "RPC options"
112+
help_heading = "RPC options",
113+
env = "ETHREX_HTTP_ADDR"
104114
)]
105115
pub http_addr: String,
106116
#[arg(
107117
long = "http.port",
108118
default_value = "8545",
109119
value_name = "PORT",
110120
help = "Listening port for the http rpc server.",
111-
help_heading = "RPC options"
121+
help_heading = "RPC options",
122+
env = "ETHREX_HTTP_PORT"
112123
)]
113124
pub http_port: String,
114125
#[arg(

cmd/ethrex/initializers.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ pub fn get_network(opts: &Options) -> String {
257257
if network == "hoodi" {
258258
network = String::from(networks::HOODI_GENESIS_PATH);
259259
}
260+
if network == "mainnet" {
261+
network = String::from(networks::MAINNET_GENESIS_PATH);
262+
}
260263

261264
network
262265
}
@@ -280,6 +283,11 @@ pub fn get_bootnodes(opts: &Options, network: &str, data_dir: &str) -> Vec<Node>
280283
bootnodes.extend(networks::HOODI_BOOTNODES.iter());
281284
}
282285

286+
if network == networks::MAINNET_GENESIS_PATH {
287+
info!("Adding mainnet preset bootnodes");
288+
bootnodes.extend(networks::MAINNET_BOOTNODES.iter());
289+
}
290+
283291
if bootnodes.is_empty() {
284292
warn!("No bootnodes specified. This node will not be able to connect to the network.");
285293
}

cmd/ethrex/networks.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const SEPOLIA_BOOTNODES_PATH: &str = "cmd/ethrex/networks/sepolia/bootnodes.json
1010
pub const HOODI_GENESIS_PATH: &str = "cmd/ethrex/networks/hoodi/genesis.json";
1111
const HOODI_BOOTNODES_PATH: &str = "cmd/ethrex/networks/hoodi/bootnodes.json";
1212

13+
pub const MAINNET_GENESIS_PATH: &str = "cmd/ethrex/networks/mainnet/genesis.json";
14+
const MAINNET_BOOTNODES_PATH: &str = "cmd/ethrex/networks/mainnet/bootnodes.json";
15+
1316
lazy_static! {
1417
pub static ref HOLESKY_BOOTNODES: Vec<Node> = serde_json::from_reader(
1518
std::fs::File::open(HOLESKY_BOOTNODES_PATH).expect("Failed to open holesky bootnodes file")
@@ -23,4 +26,8 @@ lazy_static! {
2326
std::fs::File::open(HOODI_BOOTNODES_PATH).expect("Failed to open hoodi bootnodes file")
2427
)
2528
.expect("Failed to parse hoodi bootnodes file");
29+
pub static ref MAINNET_BOOTNODES: Vec<Node> = serde_json::from_reader(
30+
std::fs::File::open(MAINNET_BOOTNODES_PATH).expect("Failed to open mainnet bootnodes file")
31+
)
32+
.expect("Failed to parse mainnet bootnodes file");
2633
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
"enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303",
3+
"enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303",
4+
"enode://2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc@65.108.70.101:30303",
5+
"enode://4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052@157.90.35.166:30303"
6+
]

0 commit comments

Comments
 (0)