Skip to content
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

feat(levm): implement EIP7691 - Blob throughput increase #1782

Merged
merged 30 commits into from
Jan 23, 2025

Conversation

lima-limon-inc
Copy link
Contributor

@lima-limon-inc lima-limon-inc commented Jan 23, 2025

Motivation

LEVM needs to support the changes introduced in EIP-7691.

Description

This EIP introduces changes to some of the blob hashes' constants values. With this PR, the values for blob hash calculations in LEVM will depend on the spec being used.

Closes #1783
Closes #1776

Copy link

github-actions bot commented Jan 23, 2025

| File                                                            | Lines | Diff |
+-----------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/constants.rs | 51    | +2   |
+-----------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/vm.rs        | 1289  | +14  |
+-----------------------------------------------------------------+-------+------+

Total lines added: +16
Total lines removed: 0
Total lines changed: 16

Copy link

github-actions bot commented Jan 23, 2025

Summary: 6475/6475 (100.00%)

Prague: 2373/2373 (100.00%)
Cancun: 3579/3579 (100.00%)
Shanghai: 221/221 (100.00%)
Merge: 62/62 (100.00%)
London: 39/39 (100.00%)
Berlin: 35/35 (100.00%)
Istanbul: 34/34 (100.00%)
Constantinople: 66/66 (100.00%)
Byzantium: 33/33 (100.00%)
Homestead: 17/17 (100.00%)
Frontier: 16/16 (100.00%)

Copy link

github-actions bot commented Jan 23, 2025

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.007 ± 0.009 6.992 7.022 1.00
levm_factorial 26.523 ± 0.630 26.045 28.183 3.78 ± 0.09

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 8.814 ± 4.540 7.345 21.734 1.00
levm_fibonacci 24.349 ± 0.264 23.960 24.848 2.76 ± 1.42

Main Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.379 ± 0.945 7.058 10.070 1.00
levm_factorial 26.428 ± 0.232 26.131 26.828 3.58 ± 0.46

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 6.958 ± 0.063 6.863 7.013 1.00
levm_fibonacci 24.328 ± 0.247 23.980 24.748 3.50 ± 0.05

@lima-limon-inc lima-limon-inc linked an issue Jan 23, 2025 that may be closed by this pull request
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All thanks to @fborello-lambda ;)

@lima-limon-inc lima-limon-inc changed the title fix: increase max_blob_count to 9 according to eip 7691 feat(levm): implement EIP7691 - Blob throughput increase Jan 23, 2025
@@ -43,13 +45,13 @@ pub mod create_opcode {
}

pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01;
pub const MAX_BLOB_NUMBER_PER_BLOCK: usize = 6;
Copy link
Contributor Author

@lima-limon-inc lima-limon-inc Jan 23, 2025

Choose a reason for hiding this comment

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

This constant is not used in LEVM. However, there is an identical constant present here: https://github.com/lambdaclass/ethrex/blob/main/crates/blockchain/constants.rs#L51

Copy link
Contributor Author

@lima-limon-inc lima-limon-inc Jan 23, 2025

Choose a reason for hiding this comment

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

Explained here: #1782 (comment)

@lima-limon-inc lima-limon-inc self-assigned this Jan 23, 2025
@lima-limon-inc lima-limon-inc added ef-tests Hive tests, execution-spec-tests levm Lambda EVM implementation pectra labels Jan 23, 2025
Comment on lines 48 to 51
pub const TARGET_BLOB_NUMBER_PER_BLOCK: u64 = 3;

/// Max number of blobs per block
pub const MAX_BLOB_NUMBER_PER_BLOCK: u64 = 2 * TARGET_BLOB_NUMBER_PER_BLOCK;
pub const MAX_BLOB_NUMBER_PER_BLOCK: u64 = 6;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Explained here: #1782 (comment)

@lima-limon-inc lima-limon-inc marked this pull request as ready for review January 23, 2025 18:06
@lima-limon-inc lima-limon-inc requested a review from a team as a code owner January 23, 2025 18:06
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.

LGTM

@ilitteri ilitteri enabled auto-merge January 23, 2025 18:31
@ilitteri ilitteri added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit b2a304e Jan 23, 2025
25 checks passed
@ilitteri ilitteri deleted the fix/levm/blob_txs branch January 23, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ef-tests Hive tests, execution-spec-tests levm Lambda EVM implementation pectra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LEVM: Add support for the EIP-7691 LEVM: Make Prague EF tests pass
4 participants