Skip to content

refactor(l1, l2): decouple L2 metrics logic from L1's & remove l2 feature flag from ethrex-blockchain #3371

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 46 commits into from
Jul 2, 2025

Conversation

ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Jun 27, 2025

Warning

Merge after #3367

Motivation

To completely remove the l2 feature flag from cmd/ethrex in favor of having a single binary for running ethrex (L1 and L2), there are some local dependencies from which to remove this feature first. These are:

  1. ethrex-vm.
  2. ethrex-levm.
  3. ethrex-blockchain.

1 and 2 are removed in #3367, and 3 is meant to be removed in this PR.

Description

Decouples the L2 metrics logic from the L1's, allowing to remove the use of the l2 feature flag from the crate ethrex-blockchain.

  • Creates a crates/blockchain/metrics/l2 module with metrics.rs and api.rs submodules.
  • Makes use of this new module in cmd/ethrex.
  • Removes l2 feature flag from ethrex-blockchain crate.
  • Removes the import of ethrex-blockchain/l2 where needed.

@ilitteri ilitteri added the simplification Any refactor that makes code simpler and more straight forward label Jun 27, 2025
Base automatically changed from remove_l2_feature_flag_from_levm to main June 30, 2025 21:25
@MegaRedHand MegaRedHand moved this to In Review in ethrex_l2 Jul 1, 2025
Comment on lines 93 to 98
pub fn new_for_l2(engine: EvmEngine, db: impl VmDatabase + 'static) -> Result<Self, EvmError> {
if let EvmEngine::REVM = engine {
return Err(EvmError::InvalidEVM(
"REVM is not supported for L2".to_string(),
));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better if we only support LEVM for the L2 just create using LEVM.
In the case a Blockchain is created using REVM and BlockchainType::L2 that should return an Error

@ilitteri ilitteri enabled auto-merge July 2, 2025 17:17
@ilitteri ilitteri added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit ef121af Jul 2, 2025
32 checks passed
@ilitteri ilitteri deleted the remove_l2_feature_flag_from_blockchain branch July 2, 2025 18:06
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l2 Jul 2, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 4, 2025
…e binary for both L1 and L2 (#3381)

> [!WARNING]
> Merge after #3371

**Motivation**

We want `ethrex` to be a single binary for both running L1 and L2. For
this, we need to remove the `l2` feature flag from `cmd/ethrex`, a work
that includes removing the same feature flag from the following crates:

1. `ethrex-vm`.
2. `ethrex-levm`.
3. `ethrex-blockchain`. 

1 and 2 are removed in #3367,
and 3 is removed in #3371.

**Description**

Removes `l2` feature flag from `cmd/ethrex`
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
…ture flag from `ethrex-blockchain` (lambdaclass#3371)

> [!WARNING]
> Merge after lambdaclass#3367

**Motivation**

To completely remove the `l2` feature flag from `cmd/ethrex` in favor of
having a single binary for running ethrex (L1 and L2), there are some
local dependencies from which to remove this feature first. These are:

1. `ethrex-vm`.
2. `ethrex-levm`.
3. `ethrex-blockchain`. 

1 and 2 are removed in lambdaclass#3367,
and 3 is meant to be removed in this PR.

**Description**

Decouples the L2 metrics logic from the L1's, allowing to remove the use
of the `l2` feature flag from the crate `ethrex-blockchain`.

- Creates a `crates/blockchain/metrics/l2` module with `metrics.rs` and
`api.rs` submodules.
- Makes use of this new module in `cmd/ethrex`.
- Removes `l2` feature flag from `ethrex-blockchain` crate.
- Removes the import of `ethrex-blockchain/l2` where needed.
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
…e binary for both L1 and L2 (lambdaclass#3381)

> [!WARNING]
> Merge after lambdaclass#3371

**Motivation**

We want `ethrex` to be a single binary for both running L1 and L2. For
this, we need to remove the `l2` feature flag from `cmd/ethrex`, a work
that includes removing the same feature flag from the following crates:

1. `ethrex-vm`.
2. `ethrex-levm`.
3. `ethrex-blockchain`. 

1 and 2 are removed in lambdaclass#3367,
and 3 is removed in lambdaclass#3371.

**Description**

Removes `l2` feature flag from `cmd/ethrex`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client L2 Rollup client simplification Any refactor that makes code simpler and more straight forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants