Skip to content

Conversation

@xqft
Copy link
Contributor

@xqft xqft commented Dec 9, 2025

Motivation

Description

Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync.

Closes #issue_number

@github-actions github-actions bot added the L2 Rollup client label Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Lines of code report

Total lines added: 514
Total lines removed: 64
Total lines changed: 578

Detailed view
+------------------------------------------------------------+-------+------+
| File                                                       | Lines | Diff |
+------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                     | 1579  | +2   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/flattrie.rs                      | 489   | +489 |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/nibbles.rs                       | 322   | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/node/leaf.rs                     | 307   | +5   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/rlp.rs                           | 151   | +15  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/trie/trie.rs                          | 979   | +1   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/block_execution_witness.rs      | 304   | -46  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/guest_program/src/execution.rs | 479   | -4   |
+------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/debug/execution_witness.rs    | 206   | -14  |
+------------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/precompiles.rs                   | 1667  | +1   |
+------------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for 595856a

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 27.6±0.50ms 27.7±0.20ms +0.36%
Trie/cita-trie insert 1k 2.8±0.02ms 2.9±0.12ms +3.57%
Trie/ethrex-trie insert 10k 24.4±0.45ms 24.2±0.31ms -0.82%
Trie/ethrex-trie insert 1k 2.2±0.06ms 2.1±0.02ms -4.55%

/// A leaf node doesn't have any childs
Leaf,
/// An extension node always has a branch as a child
Extension { child: Option<usize> },
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the child an option, if it's guaranteed to exist and be a branch?

rkyv::Archive,
)]
pub enum NodeChilds {
/// A leaf node doesn't have any childs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// A leaf node doesn't have any childs
/// A leaf node doesn't have any children

Comment on lines +88 to +91
if let NodeRef::Node(child_node, _) = &node.child {
recursive(child_node, trie);
child = Some(trie.views.len() - 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we tell when a given child is unpopulated from it just being in hashed form?

};

let offset = trie.data.len();
trie.data.extend(value.encode_to_vec());
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably better to do:

Suggested change
trie.data.extend(value.encode_to_vec());
value.encode(&mut trie.data);

That should save a memcpy and a second realloc.

/// Recursively traverses the trie, hashes each node's data and checks that their parents reference
/// those same hashes. This way the data gets authenticated.
///
/// Initializes `Self::root_hash` if successful, and returns a boolean indicating success.
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't auth failure be an error?

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for 6f9b9ba

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 29.1±1.60ms 29.1±1.01ms 0.00%
Trie/cita-trie insert 1k 2.8±0.03ms 2.9±0.12ms +3.57%
Trie/ethrex-trie insert 10k 26.1±1.15ms 25.9±1.20ms -0.77%
Trie/ethrex-trie insert 1k 2.2±0.02ms 2.2±0.01ms 0.00%

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for c42b68b

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.5±3.02ms 35.0±1.70ms +1.45%
Trie/cita-trie insert 1k 2.9±0.02ms 2.9±0.08ms 0.00%
Trie/ethrex-trie insert 10k 28.6±2.93ms 28.0±1.57ms -2.10%
Trie/ethrex-trie insert 1k 2.2±0.03ms 2.2±0.05ms 0.00%

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for 51d2f20

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.2±1.90ms 35.3±1.96ms -2.49%
Trie/cita-trie insert 1k 2.9±0.01ms 2.9±0.02ms 0.00%
Trie/ethrex-trie insert 10k 28.5±0.75ms 28.1±0.80ms -1.40%
Trie/ethrex-trie insert 1k 2.2±0.02ms 2.2±0.01ms 0.00%

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for 91bc7ca

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 27.7±0.47ms 28.1±0.55ms +1.44%
Trie/cita-trie insert 1k 2.8±0.01ms 2.8±0.02ms 0.00%
Trie/ethrex-trie insert 10k 24.3±0.37ms 24.7±0.43ms +1.65%
Trie/ethrex-trie insert 1k 2.1±0.03ms 2.2±0.16ms +4.76%

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for 31c08df

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 32.5±1.04ms 32.2±1.11ms -0.92%
Trie/cita-trie insert 1k 2.9±0.02ms 2.9±0.10ms 0.00%
Trie/ethrex-trie insert 10k 31.6±0.46ms 31.6±0.50ms 0.00%
Trie/ethrex-trie insert 1k 2.2±0.02ms 2.2±0.10ms 0.00%

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Benchmark for ea76b6d

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 27.7±0.36ms 27.9±0.63ms +0.72%
Trie/cita-trie insert 1k 2.9±0.02ms 2.9±0.13ms 0.00%
Trie/ethrex-trie insert 10k 24.3±0.57ms 24.5±0.63ms +0.82%
Trie/ethrex-trie insert 1k 2.2±0.01ms 2.2±0.06ms 0.00%

@github-actions
Copy link

Benchmark for f8e1ec3

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 27.9±0.36ms 27.8±0.29ms -0.36%
Trie/cita-trie insert 1k 2.7±0.02ms 2.8±0.13ms +3.70%
Trie/ethrex-trie insert 10k 24.7±0.25ms 25.0±0.35ms +1.21%
Trie/ethrex-trie insert 1k 2.1±0.04ms 2.2±0.06ms +4.76%

@github-actions
Copy link

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 2.993 ± 0.019 2.973 3.028 1.00
main_levm_BubbleSort 3.079 ± 0.026 3.056 3.135 1.03 ± 0.01
pr_revm_BubbleSort 3.009 ± 0.043 2.949 3.078 1.01 ± 0.02
pr_levm_BubbleSort 3.083 ± 0.017 3.065 3.118 1.03 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 998.9 ± 7.8 993.3 1019.9 1.00
main_levm_ERC20Approval 1081.9 ± 7.3 1072.6 1096.4 1.08 ± 0.01
pr_revm_ERC20Approval 1004.9 ± 17.2 992.1 1043.7 1.01 ± 0.02
pr_levm_ERC20Approval 1092.9 ± 11.8 1080.1 1121.3 1.09 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 139.2 ± 4.5 135.8 150.2 1.02 ± 0.04
main_levm_ERC20Mint 162.6 ± 0.5 162.0 163.5 1.19 ± 0.02
pr_revm_ERC20Mint 136.9 ± 2.3 134.0 141.8 1.00
pr_levm_ERC20Mint 165.2 ± 6.3 161.7 177.9 1.21 ± 0.05

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 237.3 ± 2.1 234.2 241.3 1.00
main_levm_ERC20Transfer 276.4 ± 6.7 270.3 291.3 1.16 ± 0.03
pr_revm_ERC20Transfer 239.1 ± 2.5 237.2 245.3 1.01 ± 0.01
pr_levm_ERC20Transfer 277.6 ± 3.9 274.8 288.2 1.17 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 220.6 ± 1.8 219.0 225.1 1.00 ± 0.01
main_levm_Factorial 265.4 ± 2.8 261.7 269.1 1.21 ± 0.01
pr_revm_Factorial 220.0 ± 0.5 219.4 221.1 1.00
pr_levm_Factorial 266.8 ± 5.0 262.9 277.1 1.21 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.642 ± 0.035 1.595 1.684 1.00
main_levm_FactorialRecursive 8.363 ± 0.068 8.248 8.437 5.09 ± 0.11
pr_revm_FactorialRecursive 1.657 ± 0.021 1.623 1.693 1.01 ± 0.02
pr_levm_FactorialRecursive 8.382 ± 0.043 8.313 8.460 5.10 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 200.2 ± 3.8 198.1 210.9 1.01 ± 0.02
main_levm_Fibonacci 254.7 ± 7.4 247.3 271.0 1.28 ± 0.04
pr_revm_Fibonacci 198.4 ± 1.0 197.6 201.0 1.00
pr_levm_Fibonacci 258.9 ± 7.0 250.2 270.1 1.30 ± 0.04

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 857.9 ± 11.1 844.6 877.2 1.15 ± 0.02
main_levm_FibonacciRecursive 747.1 ± 11.5 731.3 772.7 1.00
pr_revm_FibonacciRecursive 882.5 ± 11.5 858.3 896.4 1.18 ± 0.02
pr_levm_FibonacciRecursive 759.7 ± 12.5 748.7 791.4 1.02 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.6 ± 0.0 8.5 8.6 1.00
main_levm_ManyHashes 9.0 ± 0.1 8.9 9.2 1.05 ± 0.01
pr_revm_ManyHashes 8.6 ± 0.1 8.5 8.8 1.01 ± 0.01
pr_levm_ManyHashes 8.9 ± 0.0 8.8 9.0 1.04 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 259.4 ± 0.9 258.0 261.1 1.07 ± 0.01
main_levm_MstoreBench 241.9 ± 1.5 239.4 243.8 1.00
pr_revm_MstoreBench 263.3 ± 6.4 257.4 273.2 1.09 ± 0.03
pr_levm_MstoreBench 242.3 ± 4.3 238.6 253.4 1.00 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 285.4 ± 1.4 283.2 288.2 1.00
main_levm_Push 306.2 ± 2.9 299.7 310.4 1.07 ± 0.01
pr_revm_Push 290.1 ± 8.6 284.5 313.3 1.02 ± 0.03
pr_levm_Push 306.3 ± 6.8 300.7 320.3 1.07 ± 0.02

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 169.6 ± 7.1 161.6 183.7 1.88 ± 0.08
main_levm_SstoreBench_no_opt 90.3 ± 1.5 87.9 92.0 1.00
pr_revm_SstoreBench_no_opt 168.2 ± 4.4 161.8 173.5 1.86 ± 0.06
pr_levm_SstoreBench_no_opt 91.2 ± 1.5 89.5 93.4 1.01 ± 0.02

@github-actions
Copy link

Benchmark for 5e71131

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 32.5±6.04ms 29.3±1.62ms -9.85%
Trie/cita-trie insert 1k 2.9±0.01ms 3.0±0.24ms +3.45%
Trie/ethrex-trie insert 10k 26.4±1.94ms 138.9±12.15ms +426.14%
Trie/ethrex-trie insert 1k 2.2±0.01ms 19.2±1.68ms +772.73%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants