Skip to content

feat(l2): read test variables from env #3148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 17, 2025

Conversation

LeanSerra
Copy link
Contributor

Motivation

We want to run the integration test in our staging server, for this we need to be able to set some of the constants to different values than the defaults

Description

  • Use std::env::var() to try and read the var from the environment, else use the default value

@LeanSerra LeanSerra self-assigned this Jun 12, 2025
@LeanSerra LeanSerra requested a review from a team as a code owner June 12, 2025 15:50
@LeanSerra LeanSerra added the L2 Rollup client label Jun 12, 2025
Copy link

Lines of code report

Total lines added: 20
Total lines removed: 144
Total lines changed: 164

Detailed view
+----------------------------------------------+-------+------+
| File                                         | Lines | Diff |
+----------------------------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs                     | 437   | -7   |
+----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/kademlia.rs     | 501   | -112 |
+----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/peer_handler.rs | 643   | -25  |
+----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs         | 572   | +5   |
+----------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/db.rs         | 147   | +11  |
+----------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs        | 510   | +3   |
+----------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/db/mod.rs          | 17    | +1   |
+----------------------------------------------+-------+------+

Copy link
Contributor

@tomip01 tomip01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small suggestion

let deposit_value = U256::from(100000000000000000000u128);
let deposit_value = std::env::var("INTEGRATION_TEST_DEPOSIT_VALUE")
.map(|value| U256::from_dec_str(&value).expect("Invalid deposit value"))
.unwrap_or(U256::from(100000000000000000000u128));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could make a constant for this value since it is used in more than one place

@LeanSerra LeanSerra requested a review from ManuelBilbao June 13, 2025 20:20
@LeanSerra LeanSerra added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 823a3e5 Jun 17, 2025
11 checks passed
@LeanSerra LeanSerra deleted the feat/l2_integration_test_read_from_env branch June 17, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 Rollup client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants