-
Notifications
You must be signed in to change notification settings - Fork 86
refactor(l1, l2, levm): remove l2
feature flag from crates ethrex-vm
and ethrex-levm
#3367
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
Conversation
TODO: Reject blob transactions in L2
…eature_flag_from_levm
Thanks for pointing this out, I wasn't sure which functions were supposed to be L1-exclusive. Addressed this issue by halting when non L2 LEVM functions are called in L2 |
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: Push
|
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: Push
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -26,6 +26,13 @@ use std::{ | |||
|
|||
pub type Storage = HashMap<U256, H256>; | |||
|
|||
#[derive(Debug, Clone, Default)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid marking one of these as default.
…eature_flag_from_levm
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: Push
|
Co-authored-by: Jeremías Salomón <48994069+JereSalo@users.noreply.github.com>
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: Push
|
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: Push
|
…vm` and `ethrex-levm` (#3367) **Motivation** My primary goal was to remove the `l2` feature flag from `cmd/ethrex` but to do this, we first need to remove it from: - `ethrex-vm`. - `ethrex-levm`. - `ethrex-blockchain`. **Description** This PR removes the feature flag `l2` from crates `ethrex-vm` and `ethrex-levm`. > *TL;DR:* > - In `ethrex-vm` the l2 precompiles logic was moved to a separate module, `l2_precompiles`. > - A new `VMType` enum was introduced in `ethrex-levm` as a field of `VM` (main LEVM's struct). It is used by LEVM to behave differently where needed (this is specifically, when executing precompiles, and when executing hooks). > - A new `BlockchainType` enum was introduced in `ethrex-blockchain` as a field of the struct `Blockchain` to differentiate when nodes are started as L1 or L2 nodes (this is later used in the code to instantiate the VM properly, matching the `BlockchainType` variants with `VMType` ones). The `l2` feature flag exists in `ethrex-vm` only because of `ethrex-levm`, so to remove it I needed to remove it from `ethrex-levm` first. The following commits do that: - [Move l2 precompiles logic to new module](28843a6) - [Remove feature flag from hooks public API](39a509f) - [Use the correct functions](3023b88) - [Replace get_hooks](88bc9a2) - [Remove l2 feature flag from levm](8b09883) After that, it was almost safe to remove it from `ethrex-vm`: - [Remove l2 feature flag from vm crate](fd971be) This brought some compilation errors that were solved in: - [Implement BlockchainType and fix compilation](32557eb) **Next Steps** - Remove feature flag `l2` from `ethrex-blockchain` crate. - Remove feature flag `l2` from `cmd/ethrex`. --------- Co-authored-by: Jeremías Salomón <48994069+JereSalo@users.noreply.github.com>
…vm` and `ethrex-levm` (#3367) **Motivation** My primary goal was to remove the `l2` feature flag from `cmd/ethrex` but to do this, we first need to remove it from: - `ethrex-vm`. - `ethrex-levm`. - `ethrex-blockchain`. **Description** This PR removes the feature flag `l2` from crates `ethrex-vm` and `ethrex-levm`. > *TL;DR:* > - In `ethrex-vm` the l2 precompiles logic was moved to a separate module, `l2_precompiles`. > - A new `VMType` enum was introduced in `ethrex-levm` as a field of `VM` (main LEVM's struct). It is used by LEVM to behave differently where needed (this is specifically, when executing precompiles, and when executing hooks). > - A new `BlockchainType` enum was introduced in `ethrex-blockchain` as a field of the struct `Blockchain` to differentiate when nodes are started as L1 or L2 nodes (this is later used in the code to instantiate the VM properly, matching the `BlockchainType` variants with `VMType` ones). The `l2` feature flag exists in `ethrex-vm` only because of `ethrex-levm`, so to remove it I needed to remove it from `ethrex-levm` first. The following commits do that: - [Move l2 precompiles logic to new module](28843a6) - [Remove feature flag from hooks public API](39a509f) - [Use the correct functions](3023b88) - [Replace get_hooks](88bc9a2) - [Remove l2 feature flag from levm](8b09883) After that, it was almost safe to remove it from `ethrex-vm`: - [Remove l2 feature flag from vm crate](fd971be) This brought some compilation errors that were solved in: - [Implement BlockchainType and fix compilation](32557eb) **Next Steps** - Remove feature flag `l2` from `ethrex-blockchain` crate. - Remove feature flag `l2` from `cmd/ethrex`. --------- Co-authored-by: Jeremías Salomón <48994069+JereSalo@users.noreply.github.com>
…ture flag from `ethrex-blockchain` (#3371) > [!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.
…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`
…vm` and `ethrex-levm` (lambdaclass#3367) **Motivation** My primary goal was to remove the `l2` feature flag from `cmd/ethrex` but to do this, we first need to remove it from: - `ethrex-vm`. - `ethrex-levm`. - `ethrex-blockchain`. **Description** This PR removes the feature flag `l2` from crates `ethrex-vm` and `ethrex-levm`. > *TL;DR:* > - In `ethrex-vm` the l2 precompiles logic was moved to a separate module, `l2_precompiles`. > - A new `VMType` enum was introduced in `ethrex-levm` as a field of `VM` (main LEVM's struct). It is used by LEVM to behave differently where needed (this is specifically, when executing precompiles, and when executing hooks). > - A new `BlockchainType` enum was introduced in `ethrex-blockchain` as a field of the struct `Blockchain` to differentiate when nodes are started as L1 or L2 nodes (this is later used in the code to instantiate the VM properly, matching the `BlockchainType` variants with `VMType` ones). The `l2` feature flag exists in `ethrex-vm` only because of `ethrex-levm`, so to remove it I needed to remove it from `ethrex-levm` first. The following commits do that: - [Move l2 precompiles logic to new module](lambdaclass@28843a6) - [Remove feature flag from hooks public API](lambdaclass@39a509f) - [Use the correct functions](lambdaclass@3023b88) - [Replace get_hooks](lambdaclass@88bc9a2) - [Remove l2 feature flag from levm](lambdaclass@8b09883) After that, it was almost safe to remove it from `ethrex-vm`: - [Remove l2 feature flag from vm crate](lambdaclass@fd971be) This brought some compilation errors that were solved in: - [Implement BlockchainType and fix compilation](lambdaclass@32557eb) **Next Steps** - Remove feature flag `l2` from `ethrex-blockchain` crate. - Remove feature flag `l2` from `cmd/ethrex`. --------- Co-authored-by: Jeremías Salomón <48994069+JereSalo@users.noreply.github.com>
…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.
…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`
Motivation
My primary goal was to remove the
l2
feature flag fromcmd/ethrex
but to do this, we first need to remove it from:ethrex-vm
.ethrex-levm
.ethrex-blockchain
.Description
This PR removes the feature flag
l2
from cratesethrex-vm
andethrex-levm
.The
l2
feature flag exists inethrex-vm
only because ofethrex-levm
, so to remove it I needed to remove it fromethrex-levm
first. The following commits do that:After that, it was almost safe to remove it from
ethrex-vm
:This brought some compilation errors that were solved in:
Next Steps
l2
fromethrex-blockchain
crate.l2
fromcmd/ethrex
.