Skip to content

refactor(levm): merge main to cache_rollback #2557

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 71 commits into from
Apr 24, 2025

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Apr 23, 2025

Motivation

  • merge main changes to my other PR because main had a huge refactor and my PR was also a huge refactor :)

Description

Closes #issue_number

JulianVentura and others added 30 commits April 15, 2025 20:40
**Motivation**

We want to run the Ethereum Foundation blockchain tests with LEVM.
Currently, we are only running them with REVM.

**Description**

This PR modifies the EF tests runner so it executes the EF tests with
both VMs. The implementation combines both executions on the same
command `cargo test`, but could be easily modified to include a feature
flag to separate both executions if that's desired.
**Motivation**

A new version of the Solidity compiler
([v0.8.29](https://github.com/ethereum/solidity/releases/tag/v0.8.29))
has been released. This update modifies the bytecode format, which
causes changes in the `genesis-l2.json` file when launching L2 with
`make init`.

**Description**

- Pin Solidity version `0.8.29` in our contracts.
- Updates `genesis-l2.json`.



Closes None
**Motivation**

With our current implementation, if a block state diff exceeds the blob
size, we are unable to commit that block.

**Description**

This PR provides an initial solution by calculating the state diff size
after including each transaction in the block. If the size exceeds the
blob limit, the previous state is restored and transactions continue to
be added from the remaining senders in the mempool.

**Observations**
- `blockchain::build_payload` was "replicated" in
`block_producer/payload_builder.rs` with two key differences:
    - It doesn't call `blockchain::apply_system_operations`.
- It uses a custom L2 implementation of `fill_transactions` which adds
the logic described above.
- Some functions in `blockchain` are now public to allow access from
`payload_builder`.
- `PayloadBuildContext` now contains am owned `Block` instead of a
mutable reference of it, as we need to be able to clone the
`PayloadBuildContext` to restore a previous state.
- `PayloadBuildContext` is cloned before each transaction execution,
which may impact performance.
- After each transaction, `vm.get_state_transitions()` is called to
compute the state diff size.
- Since `REVM::vm.get_state_transitions()` mutates the
`PayloadBuildContext`, we need to clone it to avoid unintended changes.
- An `accounts_info_cache` is used to prevent calling `get_account_info`
on every tx execution.

> [!WARNING]
> - **REVM**: Payload building is **10x slower** due to frequent
`clone()` calls.
> - **LEVM**: Payload building is **100x slower** because
`LEVM::get_state_transitions` internally calls `get_account_info`.
>
> *These issues will be addressed in future PRs.*
…2464)

**Motivation**
Currenlty, when state healing finishes, the storage healer is cancelled,
even if there are still storages to be fetched and the tries are not
stale yet, which slows down storage healing due to the frequent restarts
if state healing ends before storage healing. This PR aims to fix this
by changing the behaviour to not cancel storage healing if state healing
is complete, but to instead give this information to the storage healer
via an AtomicBoo, so that it can decide whether to stop based on if the
state has become stale, or if no more paths are left to heal and mo more
will be added by the state healer.
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Add AtomicBool param to `storage_healer` to signal whether state
healing has ended
* Don't cancel storage healing if state healer ended due to state
healing being complete
* End storage healer if there are no more pending storages left & state
healing has ended
* (Misc) Remove outdated comment
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number
**Motivation**
We are not able to perform estimations on when healing will end, but we
should also not stay completely silent while healing takes place, as
this is not very user-friendly.
This PR aims to add messages to inform wether state and storage healing
are taking place, at the same pace as we show state sync and rebuild
progress. For state sync, pending paths will be shown. These can give an
insight on the progress, as the amount of paths will continuously
increase as we progress through the trie, but will start gradually
decreasing as we near the end of healing. For storages it is a slightly
different story as we don't have the full number of pending storages
available for showing so we only show the storages currently in the
queue.
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Periodically show amount of paths left during State Healing
* Periodically show storages in queue during Storage Healing
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->
**Motivation**
Adds mainnet bootnodes & genesis file so we can connect to mainnet by
passing `--network mainnet`
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* add mainnet bootnodes & genesis file
* recognize mainnet as preset network
* update docs
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Contributes to #72 

**Notes**
Mainnet genesis file is quite large, it is copied from
[here](https://github.com/eth-clients/mainnet/blob/main/metadata/genesis.json)
…2456)

**Motivation**
Replaces `assert_eq` usage with proper errors in rlpx frame decoding
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Add error variant `RLPXError::InvalidMessageFrame`
* Remove usage of `assert_eq` in `RLPxCodec::decode` impl
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #1748
**Description**

This PR removes logs from the `ExecutionReport` when a transaction
reverts.
With this fix, LEVM no longer breaks at block 80k while syncing on
Holesky testnet.
**Motivation**

devops

**Description**

add the following enviroment variables to customize the l2 init command.
Specially useful for systemd or docker services

```
ETHREX_NETWORK
ETHREX_DATADIR
ETHREX_METRICS_PORT
ETHREX_EVM
ETHREX_HTTP_ADDR
ETHREX_HTTP_PORT
```
…nst (#2438)

**Motivation**

Increase perfomance, improve code.
<!-- Why does this pull request exist? What are its goals? -->

**Description**

Some methods took Vec by value just to take it's length, requiring a
costly clone each time.

Some methods could be made const, if the compiler can make use of this
it may increase perfomance.

Changed a drain to a into_iter, which is simpler and has better
perfomance.

Aided by the following clippy command:
```
cargo clippy --all-features -- -D clippy::perfomance -D clippy::nursery -A clippy::use_self -A clippy::too_long_first_doc_paragraph -A clippy::derive_partial_eq_without_eq -A clippy::option_if_let_else
```
Changes:
- Flamegraph Watcher srcript now:
  - Uses the new load test.
  - Fails if any line fails (e.g. the load test binary panics).
- CI:
  - The flamegraphs are now updated on push to main again.
- Compilation and running is separated to delete the "while not
compiled" polling.
- Reth version is pinned so it does not rely on 2024 features and can be
compiled again.
- Load test:
  - `make` targets now run in release mode.
- now waits until all transactions are included before exciting. There's
a flag to set a timeout.
- All ethrex_l2 references are deleted from CI and the watcher.


Closes #2466
This PR adds logs for each imported block:
- Transaction count
- ms/Ggas for execution
- ms/Ggas for storage
- Percentage between execution and storage in an imported block
**Description**
- standarize revm/levm behaviour when importing blocks
- Remove fork choice when importing blocks.
- Move block importing out of blockchain module
**Motivation**

The L1 slack channel is now used for LEVM development

**Description**

This PR replaces the LEVM webhook with the L1 webhook.
**Motivation**
Dev mode is currently broken.

**Description**
- Changed the block producer so use the `v4` methods that are used in
Prague.
- Improved error messages

Closes #2376
**Motivation**

Allows seeing the status of the test network.

**Description**

- Implements a net_peerCount dummy (required to enable several
ethereum-metrics-exporter modules)
- Enables ethereum-metrics-exporter with a grafana dashboard in for the
kurtosis localnet

Note: prometheus v3 must be used since the prometheus kurtosis package
adds fallback_scrape_protocol.

Closes #2317
**Motivation**

Prover's execution was failing because of wrong data in the ExecutionDB.
There were also some cases where data was missing but the current tests
didn't catch it.

**Description**

- fixes saving final storage values instead of initial ones.
- fixes saving only touched storage values, instead of read ones too.
- removes unused `new_store`
- simplifies code
**Motivation**
Fix prover tests in CI

**Description**
#2481 broke the L2 tests since
they were using a Cancun genesis, and the block producer has switched to
Prague
mpaulucci and others added 6 commits April 23, 2025 15:12
…2426)

**Motivation**
We should be able to do payload validations even when the node is in a
sync process (except if it's snap sync).

**Description**
- Refactored some code to make it flatter
- Removed early return when the node is syncing
- minor renames for clarity sake.
**Motivation**

The `proposer.md` file was renamed to `sequencer.md`, and the old link
in the docs index became obsolete.

**Description**

Hi! I removed the outdated reference to `proposer.md` in
`crates/l2/docs/README.md` since it's now covered under `sequencer.md`.
ref:
https://github.com/lambdaclass/ethrex/pull/2269/files#diff-95ad85cd4c72b932973f93785a8a1f365b56757d2972fe671ff33221b7bd0546

Co-authored-by: Javier Rodríguez Chatruc <[email protected]>
**Motivation**

In #2397, we are having issues with Pico dependencies. Since we are not
using it at the moment, we prefer to temporarily disable the job until
we focus on it later.

**Description**

- Disable pico job renaming `pr-main_l2_prover_nightly.yaml` to
`.github/workflows/pr-main_l2_prover_nightly.yaml.disabled`.
- Create #2550.

Closes None
@JereSalo JereSalo added the levm Lambda EVM implementation label Apr 23, 2025
Copy link

github-actions bot commented Apr 23, 2025

Lines of code report

Total lines added: 959
Total lines removed: 690
Total lines changed: 1649

Detailed view
+------------------------------------------------------------------------+-------+------+
| File                                                                   | Lines | Diff |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/blockchain/test_runner.rs                          | 167   | +20  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/parser.rs                                    | 157   | -6   |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/report.rs                                    | 822   | -101 |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/runner/levm_runner.rs                        | 369   | -48  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/runner/mod.rs                                | 230   | -59  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/runner/revm_runner.rs                        | 514   | -18  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/types.rs                                     | 265   | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ef_tests/state/utils.rs                                     | 65    | -15  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs                                               | 332   | +41  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/ethrex.rs                                            | 84    | +2   |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/initializers.rs                                      | 352   | +12  |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/l2.rs                                                | 252   | +2   |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/networks.rs                                          | 28    | +6   |
+------------------------------------------------------------------------+-------+------+
| ethrex/cmd/load_test/src/main.rs                                       | 362   | +63  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                                 | 494   | -19  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/payload.rs                                    | 548   | -3   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/node.rs                                      | 149   | -1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/node/branch.rs                               | 535   | -1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/node/extension.rs                            | 414   | -8   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/node_hash.rs                                 | 117   | +12  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/trie.rs                                      | 811   | -1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/trie_iter.rs                                 | 90    | -1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/verify_range.rs                              | 615   | -5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/deployer.rs                                 | 766   | -10  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/zkvm/interface/risc0/src/main.rs               | 46    | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/zkvm/interface/sp1/src/main.rs                 | 43    | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sdk/src/calldata.rs                                   | 316   | +67  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/block_producer.rs                           | 111   | +5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/block_producer/payload_builder.rs           | 225   | +225 |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/errors.rs                                   | 181   | +11  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_committer.rs                             | 387   | -18  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/state_diff.rs                               | 466   | +56  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/utils/error.rs                                        | 22    | +5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/utils/helpers.rs                                      | 24    | +24  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/utils/mod.rs                                          | 6     | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/error.rs                             | 76    | +2   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/frame.rs                             | 202   | +8   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs                                   | 574   | +6   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/state_healing.rs                     | 128   | +5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_healing.rs                   | 106   | +19  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync_manager.rs                           | 130   | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/clients/auth/mod.rs                       | 162   | +9   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/engine/fork_choice.rs                     | 387   | -3   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/engine/payload.rs                         | 699   | +16  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/net/mod.rs                                | 14    | +4   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/rpc.rs                                    | 721   | +1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/db.rs                                   | 214   | -1   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/levm/mod.rs                                  | 638   | -53  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/db.rs                                   | 225   | +19  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/backends/revm/mod.rs                                  | 607   | -5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/db/gen_db.rs                                 | 160   | -5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/execution_handlers.rs                        | 233   | -5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/default_hook.rs                        | 261   | -37  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/hook.rs                                | 14    | -4   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/hooks/l2_hook.rs                             | 190   | -28  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/arithmetic.rs                | 218   | +2   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/bitwise_comparison.rs        | 301   | +13  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/block.rs                     | 140   | -21  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/dup.rs                       | 23    | -4   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/environment.rs               | 318   | -29  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/exchange.rs                  | 26    | -4   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/keccak.rs                    | 35    | -3   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/logging.rs                   | 43    | -4   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/push.rs                      | 59    | -5   |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/stack_memory_storage_flow.rs | 288   | -19  |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/system.rs                    | 840   | +113 |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/utils.rs                                     | 263   | -146 |
+------------------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/vm.rs                                        | 617   | +186 |
+------------------------------------------------------------------------+-------+------+

Copy link

Benchmark for 6703010

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 38.5±2.14ms 41.2±2.00ms +7.01%
Trie/cita-trie insert 1k 3.7±0.02ms 3.7±0.05ms 0.00%
Trie/ethrex-trie insert 10k 138.4±1.48ms 137.1±4.65ms -0.94%
Trie/ethrex-trie insert 1k 11.9±0.11ms 11.3±0.14ms -5.04%

JereSalo and others added 3 commits April 23, 2025 16:19
)

**Motivation**

Currently during batch processing, the state transitions are calculated
for every block and then merged, when it would be more performant to
calculate them once at the end.

**Description**

This PR removes the account updates from the execution result and makes
every consumer manually request them.

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #2504
Copy link

Benchmark for ff5dd87

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.4±0.72ms 35.1±0.45ms -0.85%
Trie/cita-trie insert 1k 3.6±0.03ms 3.6±0.09ms 0.00%
Trie/ethrex-trie insert 10k 135.9±1.57ms 127.5±1.82ms -6.18%
Trie/ethrex-trie insert 1k 11.8±0.05ms 11.5±0.90ms -2.54%

Copy link

github-actions bot commented Apr 23, 2025

EF Tests Comparison

Test Name MAIN PR DIFF
Summary: 19741/20129 (98.07%) 32526/38385 (84.74%) ⬇️️ 12785
Prague: 2574/2574 (100.00%) 5165/5202 (99.29%) ⬇️️ 2591
Cancun: 4983/4983 (100.00%) 7537/7608 (99.07%) ⬇️️ 2554
Shanghai: 614/614 (100.00%) 3176/3214 (98.82%) ⬇️️ 2562
Paris: 285/285 (100.00%) 2848/2886 (98.68%) ⬇️️ 2563
London: 247/247 (100.00%) 2878/2915 (98.73%) ⬇️️ 2631
Berlin: 205/239 (85.77%) 215/2755 (7.80%) ⬇️️ 10
Istanbul: 229/230 (99.57%) 238/2709 (8.79%) ⬇️️ 9
Petersburg: 2516/2541 (99.02%) 2478/2564 (96.65%) ⬇️️ -38
Constantinople: 2338/2405 (97.21%) 2301/2428 (94.77%) ⬇️️ -37
Byzantium: 2448/2472 (99.03%) 2410/2492 (96.71%) ⬇️️ -38
SpuriousDragon: 579/579 (100.00%) 576/598 (96.32%) ⬇️️ -3
Tangerine: 583/650 (89.69%) 575/669 (85.95%) ⬇️️ -8
Homestead: 1364/1447 (94.26%) 1348/1465 (92.01%) ⬇️️ -16
Frontier: 776/863 (89.92%) 781/880 (88.75%) ⬇️️ 5

Copy link

Benchmark for 2a8c1a9

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.9±1.80ms 40.5±1.83ms +12.81%
Trie/cita-trie insert 1k 3.7±0.06ms 3.7±0.05ms 0.00%
Trie/ethrex-trie insert 10k 149.4±2.79ms 132.8±2.08ms -11.11%
Trie/ethrex-trie insert 1k 12.0±0.22ms 11.7±0.80ms -2.50%

Copy link

github-actions bot commented Apr 23, 2025

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 236.3 ± 2.6 230.5 241.1 1.00
levm_Factorial 892.3 ± 2.8 889.4 897.3 3.78 ± 0.04

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.498 ± 0.115 1.362 1.644 1.00
levm_FactorialRecursive 14.190 ± 0.237 13.970 14.520 9.47 ± 0.74

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 210.7 ± 1.6 208.4 214.5 1.00
levm_Fibonacci 898.6 ± 13.5 886.7 933.5 4.26 ± 0.07

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.8 ± 0.1 8.7 8.8 1.00
levm_ManyHashes 17.9 ± 0.2 17.6 18.3 2.05 ± 0.03

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.263 ± 0.025 3.243 3.322 1.00
levm_BubbleSort 11.288 ± 0.114 11.157 11.492 3.46 ± 0.04

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 252.4 ± 2.9 249.1 258.0 1.00
levm_ERC20Transfer 578.4 ± 1.9 574.9 582.4 2.29 ± 0.03

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 143.6 ± 0.6 142.6 144.5 1.00
levm_ERC20Mint 387.8 ± 3.1 383.1 392.2 2.70 ± 0.02

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.046 ± 0.003 1.042 1.052 1.00
levm_ERC20Approval 2.110 ± 0.020 2.092 2.151 2.02 ± 0.02

Main Results

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Factorial 247.1 ± 0.4 246.7 247.8 1.00
levm_Factorial 902.2 ± 28.1 886.8 980.1 3.65 ± 0.11

Benchmark Results: Factorial - Recursive

Command Mean [s] Min [s] Max [s] Relative
revm_FactorialRecursive 1.524 ± 0.099 1.409 1.675 1.00
levm_FactorialRecursive 14.047 ± 0.246 13.849 14.405 9.22 ± 0.62

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
revm_Fibonacci 218.3 ± 1.3 214.7 219.5 1.00
levm_Fibonacci 896.2 ± 10.2 885.1 919.2 4.10 ± 0.05

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ManyHashes 8.9 ± 0.0 8.8 9.0 1.00
levm_ManyHashes 17.5 ± 0.3 17.2 18.1 1.98 ± 0.04

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
revm_BubbleSort 3.282 ± 0.013 3.270 3.307 1.00
levm_BubbleSort 6.027 ± 0.029 5.982 6.067 1.84 ± 0.01

Benchmark Results: ERC20 - Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Transfer 256.2 ± 2.9 250.0 259.7 1.00
levm_ERC20Transfer 517.7 ± 14.9 509.7 559.5 2.02 ± 0.06

Benchmark Results: ERC20 - Mint

Command Mean [ms] Min [ms] Max [ms] Relative
revm_ERC20Mint 145.6 ± 1.4 143.7 147.6 1.00
levm_ERC20Mint 331.1 ± 2.2 327.0 334.0 2.27 ± 0.03

Benchmark Results: ERC20 - Approval

Command Mean [s] Min [s] Max [s] Relative
revm_ERC20Approval 1.052 ± 0.007 1.043 1.064 1.00
levm_ERC20Approval 1.960 ± 0.018 1.938 1.992 1.86 ± 0.02

Copy link

Benchmark for 2a5682a

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 37.4±1.23ms 35.3±0.54ms -5.61%
Trie/cita-trie insert 1k 3.7±0.03ms 3.6±0.05ms -2.70%
Trie/ethrex-trie insert 10k 136.6±0.93ms 131.3±4.03ms -3.88%
Trie/ethrex-trie insert 1k 11.9±0.23ms 11.2±0.19ms -5.88%

Copy link

Benchmark for ff0daa4

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.9±0.57ms 34.6±0.30ms -0.86%
Trie/cita-trie insert 1k 3.6±0.04ms 3.6±0.01ms 0.00%
Trie/ethrex-trie insert 10k 133.8±1.77ms 125.6±1.41ms -6.13%
Trie/ethrex-trie insert 1k 12.0±0.04ms 11.3±0.66ms -5.83%

Copy link

Benchmark for 43fd747

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.3±0.65ms 35.0±0.73ms -0.85%
Trie/cita-trie insert 1k 3.7±0.06ms 3.6±0.04ms -2.70%
Trie/ethrex-trie insert 10k 135.7±2.29ms 130.4±1.51ms -3.91%
Trie/ethrex-trie insert 1k 11.9±0.23ms 11.3±0.40ms -5.04%

Copy link

Benchmark for f003dcd

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.1±1.34ms 37.1±1.97ms +2.77%
Trie/cita-trie insert 1k 3.6±0.04ms 3.6±0.05ms 0.00%
Trie/ethrex-trie insert 10k 136.5±1.79ms 132.0±2.92ms -3.30%
Trie/ethrex-trie insert 1k 11.8±0.06ms 11.5±0.61ms -2.54%

@JereSalo JereSalo marked this pull request as ready for review April 24, 2025 12:47
@JereSalo JereSalo requested a review from a team as a code owner April 24, 2025 12:47
@JereSalo JereSalo merged commit d46a1fe into levm/cache_rollback Apr 24, 2025
46 of 48 checks passed
@JereSalo JereSalo deleted the levm/merge_main_cache_rollback branch April 24, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.