Skip to content

chore(l2): re-enable risc0 - #3172

Merged
jrchatruc merged 68 commits into
mainfrom
l2/reenable_risc0
Jul 2, 2025
Merged

jrchatruc merged 68 commits into
mainfrom
l2/reenable_risc0

Conversation

@xqft

@xqft xqft commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor

Motivation

risc0 support was temporarily deprecated because of incompatible versions between some required ethrex's dependencies and the risc0 toolchain.

Now the toolchain uses a newer version so this problem should be solved, but the backend needs some maintenance to get it working again.

Description

  • update risc0 to latest version
  • update risc0's build script for the new version
  • refactor kzg verification into ethrex-common
  • support kzg verification with both kzg-rs and c-kzg (sp1 is only compatible with kzg-rs, risc0 only with c-kzg)
  • fix wrong public inputs encoding
  • fix wrong image id encoding
  • add risc0 verification key (also called image id) as a contract variable
  • add risc0 lint job and refactor jobs for other backends
  • add docs for local testing (deployment of risc0 contracts)

Closes #2145

@github-actions

github-actions Bot commented Jun 13, 2025 •

Copy link
Copy Markdown

Lines of code report

Total lines added: 126
Total lines removed: 73
Total lines changed: 199

Detailed view
+---------------------------------------------------------+-------+------+
| File                                                    | Lines | Diff |
+---------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex_replay/src/cli.rs                     | 309   | -2   |
+---------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex_replay/src/run.rs                     | 76    | -3   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/common/common.rs                          | 10    | +1   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/common/kzg.rs                             | 83    | +83  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/common/types/blobs_bundle.rs              | 300   | -28  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/common/src/prover.rs                   | 110   | -5   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/deployer/cli.rs          | 367   | +13  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/deployer/main.rs         | 623   | +6   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backends/risc0.rs           | 75    | +12  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/zkvm/interface/build.rs         | 68    | +11  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/zkvm/interface/src/execution.rs | 326   | -11  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_proof_sender.rs           | 319   | -1   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/precompiles.rs                | 1156  | -23  |
+---------------------------------------------------------+-------+------+

@github-actions

github-actions Bot commented Jun 17, 2025 •

Copy link
Copy Markdown

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 3.136 ± 0.012 3.122 3.158 1.00
main_levm_BubbleSort 4.435 ± 0.012 4.419 4.451 1.41 ± 0.01
pr_revm_BubbleSort 3.190 ± 0.016 3.172 3.226 1.02 ± 0.01
pr_levm_BubbleSort 4.515 ± 0.291 4.406 5.340 1.44 ± 0.09

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.046 ± 0.005 1.038 1.055 1.00
main_levm_ERC20Approval 1.534 ± 0.006 1.525 1.545 1.47 ± 0.01
pr_revm_ERC20Approval 1.078 ± 0.004 1.074 1.088 1.03 ± 0.01
pr_levm_ERC20Approval 1.539 ± 0.016 1.528 1.582 1.47 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.1 ± 0.3 137.6 138.7 1.00
main_levm_ERC20Mint 259.3 ± 2.1 256.6 263.7 1.88 ± 0.02
pr_revm_ERC20Mint 142.3 ± 1.5 140.0 145.3 1.03 ± 0.01
pr_levm_ERC20Mint 259.7 ± 2.8 257.0 264.7 1.88 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 246.2 ± 2.4 244.2 251.2 1.00
main_levm_ERC20Transfer 408.0 ± 4.9 404.1 420.6 1.66 ± 0.03
pr_revm_ERC20Transfer 253.4 ± 1.9 250.7 256.4 1.03 ± 0.01
pr_levm_ERC20Transfer 403.1 ± 2.1 401.3 408.1 1.64 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.9 ± 1.7 230.5 235.5 1.00 ± 0.01
main_levm_Factorial 448.8 ± 7.0 443.8 464.3 1.94 ± 0.03
pr_revm_Factorial 231.9 ± 1.3 230.6 234.2 1.00
pr_levm_Factorial 440.6 ± 4.6 437.4 453.2 1.90 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.614 ± 0.037 1.527 1.660 1.03 ± 0.05
main_levm_FactorialRecursive 2.725 ± 0.035 2.689 2.811 1.73 ± 0.07
pr_revm_FactorialRecursive 1.574 ± 0.060 1.430 1.641 1.00
pr_levm_FactorialRecursive 2.729 ± 0.032 2.683 2.783 1.73 ± 0.07

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.2 ± 1.7 205.0 210.7 1.00
main_levm_Fibonacci 436.1 ± 10.6 427.3 456.9 2.11 ± 0.05
pr_revm_Fibonacci 206.5 ± 1.5 205.0 209.6 1.00 ± 0.01
pr_levm_Fibonacci 431.4 ± 3.1 427.3 438.4 2.09 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.0 8.7 8.8 1.00
main_levm_ManyHashes 13.2 ± 0.3 12.9 13.9 1.52 ± 0.03
pr_revm_ManyHashes 8.8 ± 0.1 8.7 8.8 1.01 ± 0.01
pr_levm_ManyHashes 13.6 ± 0.5 13.2 14.5 1.56 ± 0.06

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 296.0 ± 1.0 295.3 298.4 1.01 ± 0.01
main_levm_Push 1046.5 ± 2.1 1043.5 1050.5 3.59 ± 0.02
pr_revm_Push 291.6 ± 1.2 290.2 293.7 1.00
pr_levm_Push 1121.7 ± 9.0 1099.5 1131.4 3.85 ± 0.03

@ManuelBilbao ManuelBilbao added the L2 Rollup client label Jun 24, 2025
@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown

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 3.151 ± 0.015 3.137 3.180 1.00
main_levm_BubbleSort 4.451 ± 0.020 4.430 4.501 1.41 ± 0.01
pr_revm_BubbleSort 3.172 ± 0.026 3.145 3.226 1.01 ± 0.01
pr_levm_BubbleSort 4.516 ± 0.027 4.483 4.556 1.43 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.043 ± 0.007 1.037 1.057 1.02 ± 0.01
main_levm_ERC20Approval 1.532 ± 0.009 1.522 1.553 1.49 ± 0.01
pr_revm_ERC20Approval 1.027 ± 0.002 1.024 1.030 1.00
pr_levm_ERC20Approval 1.569 ± 0.023 1.552 1.631 1.53 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 137.6 ± 0.5 136.8 138.2 1.00
main_levm_ERC20Mint 256.8 ± 4.0 254.4 268.0 1.87 ± 0.03
pr_revm_ERC20Mint 139.6 ± 11.0 134.8 170.9 1.01 ± 0.08
pr_levm_ERC20Mint 255.9 ± 1.8 253.1 258.8 1.86 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 245.0 ± 0.9 244.4 247.6 1.00
main_levm_ERC20Transfer 402.9 ± 4.8 396.4 411.8 1.64 ± 0.02
pr_revm_ERC20Transfer 245.0 ± 1.7 243.4 248.9 1.00 ± 0.01
pr_levm_ERC20Transfer 405.6 ± 2.4 402.6 409.0 1.66 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.5 ± 3.9 230.8 241.8 1.01 ± 0.02
main_levm_Factorial 452.6 ± 4.5 445.7 458.6 1.96 ± 0.03
pr_revm_Factorial 231.4 ± 2.6 229.4 237.9 1.00
pr_levm_Factorial 449.1 ± 3.9 445.7 455.9 1.94 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.599 ± 0.063 1.429 1.643 1.01 ± 0.05
main_levm_FactorialRecursive 2.687 ± 0.016 2.664 2.709 1.69 ± 0.04
pr_revm_FactorialRecursive 1.589 ± 0.039 1.502 1.629 1.00
pr_levm_FactorialRecursive 2.703 ± 0.021 2.679 2.736 1.70 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.5 ± 1.2 205.6 209.5 1.00 ± 0.01
main_levm_Fibonacci 437.9 ± 6.3 435.0 455.5 2.12 ± 0.03
pr_revm_Fibonacci 206.3 ± 0.6 205.6 206.9 1.00
pr_levm_Fibonacci 439.3 ± 6.7 433.2 456.5 2.13 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 875.6 ± 8.2 864.4 890.8 1.03 ± 0.02
main_levm_FibonacciRecursive 1649.2 ± 19.0 1632.5 1698.0 1.94 ± 0.04
pr_revm_FibonacciRecursive 848.7 ± 14.9 827.4 870.4 1.00
pr_levm_FibonacciRecursive 1672.7 ± 19.4 1653.2 1716.0 1.97 ± 0.04

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 8.9 1.01 ± 0.01
main_levm_ManyHashes 13.2 ± 0.3 13.0 14.0 1.53 ± 0.04
pr_revm_ManyHashes 8.7 ± 0.0 8.6 8.7 1.00
pr_levm_ManyHashes 13.4 ± 0.1 13.3 13.6 1.54 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 294.0 ± 0.5 293.3 294.7 1.00
main_levm_Push 1065.6 ± 2.1 1063.2 1069.9 3.62 ± 0.01
pr_revm_Push 295.1 ± 6.5 290.7 312.9 1.00 ± 0.02
pr_levm_Push 1039.7 ± 5.6 1034.4 1052.2 3.54 ± 0.02

@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown

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 3.149 ± 0.015 3.133 3.189 1.00
main_levm_BubbleSort 4.442 ± 0.014 4.426 4.468 1.41 ± 0.01
pr_revm_BubbleSort 3.167 ± 0.028 3.145 3.242 1.01 ± 0.01
pr_levm_BubbleSort 4.533 ± 0.050 4.484 4.632 1.44 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.061 ± 0.010 1.049 1.074 1.03 ± 0.01
main_levm_ERC20Approval 1.564 ± 0.019 1.548 1.612 1.51 ± 0.02
pr_revm_ERC20Approval 1.033 ± 0.006 1.029 1.046 1.00
pr_levm_ERC20Approval 1.526 ± 0.005 1.519 1.532 1.48 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.6 ± 0.6 137.8 139.9 1.01 ± 0.01
main_levm_ERC20Mint 264.9 ± 7.8 259.7 286.2 1.93 ± 0.06
pr_revm_ERC20Mint 137.5 ± 1.7 136.2 142.0 1.00
pr_levm_ERC20Mint 257.9 ± 9.8 252.8 285.6 1.88 ± 0.07

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 250.4 ± 2.8 247.7 257.3 1.03 ± 0.01
main_levm_ERC20Transfer 411.2 ± 4.0 405.3 417.7 1.69 ± 0.02
pr_revm_ERC20Transfer 243.5 ± 0.8 242.5 245.2 1.00
pr_levm_ERC20Transfer 401.8 ± 6.8 397.2 420.2 1.65 ± 0.03

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 255.5 ± 76.6 230.1 473.6 1.11 ± 0.33
main_levm_Factorial 454.9 ± 26.9 445.2 531.6 1.97 ± 0.12
pr_revm_Factorial 231.2 ± 1.7 229.6 234.1 1.00
pr_levm_Factorial 444.9 ± 4.4 440.9 451.9 1.92 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.605 ± 0.044 1.498 1.644 1.01 ± 0.06
main_levm_FactorialRecursive 2.683 ± 0.021 2.648 2.716 1.68 ± 0.09
pr_revm_FactorialRecursive 1.594 ± 0.086 1.356 1.656 1.00
pr_levm_FactorialRecursive 2.677 ± 0.033 2.645 2.742 1.68 ± 0.09

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 204.7 ± 0.5 204.1 205.5 1.00
main_levm_Fibonacci 439.1 ± 5.3 434.4 449.9 2.15 ± 0.03
pr_revm_Fibonacci 207.3 ± 0.7 206.6 209.0 1.01 ± 0.00
pr_levm_Fibonacci 450.5 ± 48.9 432.3 589.3 2.20 ± 0.24

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 872.0 ± 8.4 857.0 882.4 1.01 ± 0.02
main_levm_FibonacciRecursive 1643.6 ± 6.6 1633.3 1652.1 1.90 ± 0.02
pr_revm_FibonacciRecursive 863.6 ± 10.5 847.9 881.6 1.00
pr_levm_FibonacciRecursive 1664.5 ± 7.2 1653.9 1673.4 1.93 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.0 8.7 8.9 1.02 ± 0.01
main_levm_ManyHashes 13.4 ± 0.2 13.3 13.8 1.56 ± 0.02
pr_revm_ManyHashes 8.6 ± 0.0 8.5 8.7 1.00
pr_levm_ManyHashes 13.7 ± 0.4 13.5 14.6 1.60 ± 0.04

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 296.9 ± 5.6 293.3 311.4 1.02 ± 0.02
main_levm_Push 1133.8 ± 1.7 1131.7 1136.9 3.88 ± 0.02
pr_revm_Push 292.5 ± 1.6 291.1 296.2 1.00
pr_levm_Push 1040.7 ± 22.6 1027.1 1102.7 3.56 ± 0.08

@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown

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 3.165 ± 0.030 3.142 3.230 1.00
main_levm_BubbleSort 4.452 ± 0.016 4.427 4.470 1.41 ± 0.01
pr_revm_BubbleSort 3.192 ± 0.014 3.175 3.220 1.01 ± 0.01
pr_levm_BubbleSort 4.479 ± 0.047 4.425 4.591 1.42 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.056 ± 0.010 1.045 1.071 1.00 ± 0.02
main_levm_ERC20Approval 1.562 ± 0.078 1.528 1.782 1.48 ± 0.08
pr_revm_ERC20Approval 1.053 ± 0.016 1.038 1.081 1.00
pr_levm_ERC20Approval 1.555 ± 0.012 1.546 1.584 1.48 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 139.3 ± 1.5 137.7 142.7 1.00
main_levm_ERC20Mint 256.2 ± 1.2 254.7 258.1 1.84 ± 0.02
pr_revm_ERC20Mint 140.7 ± 0.5 140.2 141.7 1.01 ± 0.01
pr_levm_ERC20Mint 265.4 ± 2.8 262.9 272.3 1.91 ± 0.03

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 249.6 ± 1.8 247.4 252.8 1.00
main_levm_ERC20Transfer 419.1 ± 56.3 398.3 579.0 1.68 ± 0.23
pr_revm_ERC20Transfer 251.2 ± 2.3 248.4 256.2 1.01 ± 0.01
pr_levm_ERC20Transfer 410.3 ± 2.8 406.1 413.5 1.64 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.6 ± 1.2 232.7 236.8 1.01 ± 0.01
main_levm_Factorial 446.4 ± 1.9 444.2 450.8 1.92 ± 0.01
pr_revm_Factorial 232.0 ± 1.2 231.0 235.1 1.00
pr_levm_Factorial 444.5 ± 3.5 440.9 453.0 1.92 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.651 ± 0.030 1.605 1.684 1.01 ± 0.03
main_levm_FactorialRecursive 2.759 ± 0.027 2.730 2.818 1.68 ± 0.04
pr_revm_FactorialRecursive 1.640 ± 0.037 1.551 1.676 1.00
pr_levm_FactorialRecursive 2.761 ± 0.016 2.743 2.791 1.68 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.5 ± 1.3 204.2 208.8 1.00 ± 0.02
main_levm_Fibonacci 439.3 ± 8.5 434.8 463.0 2.13 ± 0.05
pr_revm_Fibonacci 206.2 ± 2.8 198.5 208.8 1.00
pr_levm_Fibonacci 434.7 ± 2.1 431.1 438.4 2.11 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 878.7 ± 15.3 843.1 899.7 1.01 ± 0.04
main_levm_FibonacciRecursive 1678.9 ± 15.4 1655.8 1708.0 1.92 ± 0.08
pr_revm_FibonacciRecursive 873.4 ± 33.6 854.1 967.2 1.00
pr_levm_FibonacciRecursive 1669.6 ± 7.8 1657.1 1681.1 1.91 ± 0.07

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 9.6 ± 1.1 9.1 12.6 1.09 ± 0.12
main_levm_ManyHashes 13.8 ± 0.2 13.5 14.0 1.57 ± 0.02
pr_revm_ManyHashes 8.8 ± 0.1 8.7 8.9 1.00
pr_levm_ManyHashes 13.7 ± 0.1 13.5 13.9 1.56 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 298.1 ± 8.2 293.3 321.2 1.02 ± 0.03
main_levm_Push 1104.5 ± 4.1 1099.3 1114.7 3.77 ± 0.02
pr_revm_Push 292.9 ± 1.4 291.0 295.1 1.00
pr_levm_Push 1110.7 ± 14.1 1098.4 1147.1 3.79 ± 0.05

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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 3.164 ± 0.009 3.151 3.178 1.00 ± 0.01
main_levm_BubbleSort 4.527 ± 0.195 4.434 5.080 1.43 ± 0.06
pr_revm_BubbleSort 3.160 ± 0.016 3.140 3.189 1.00
pr_levm_BubbleSort 4.448 ± 0.020 4.421 4.488 1.41 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.040 ± 0.004 1.031 1.047 1.00
main_levm_ERC20Approval 1.530 ± 0.007 1.518 1.540 1.47 ± 0.01
pr_revm_ERC20Approval 1.132 ± 0.302 1.026 1.991 1.09 ± 0.29
pr_levm_ERC20Approval 1.548 ± 0.025 1.530 1.618 1.49 ± 0.03

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.2 ± 0.5 137.4 138.9 1.01 ± 0.01
main_levm_ERC20Mint 256.2 ± 0.9 255.1 257.5 1.88 ± 0.01
pr_revm_ERC20Mint 136.6 ± 0.6 136.1 137.8 1.00
pr_levm_ERC20Mint 268.4 ± 14.3 258.2 294.9 1.96 ± 0.10

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 247.7 ± 1.6 246.3 250.3 1.01 ± 0.03
main_levm_ERC20Transfer 400.6 ± 1.4 397.7 402.7 1.63 ± 0.04
pr_revm_ERC20Transfer 245.6 ± 6.0 240.5 261.0 1.00
pr_levm_ERC20Transfer 407.5 ± 15.6 399.9 451.5 1.66 ± 0.08

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 231.0 ± 0.9 230.1 232.9 1.01 ± 0.01
main_levm_Factorial 449.4 ± 9.6 445.3 476.7 1.96 ± 0.04
pr_revm_Factorial 229.5 ± 1.7 227.7 232.6 1.00
pr_levm_Factorial 443.8 ± 6.3 440.6 461.4 1.93 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.632 ± 0.022 1.582 1.661 1.03 ± 0.03
main_levm_FactorialRecursive 2.724 ± 0.027 2.687 2.780 1.71 ± 0.04
pr_revm_FactorialRecursive 1.592 ± 0.035 1.513 1.638 1.00
pr_levm_FactorialRecursive 2.713 ± 0.036 2.650 2.761 1.70 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 208.0 ± 5.3 205.2 222.8 1.01 ± 0.03
main_levm_Fibonacci 435.7 ± 1.6 433.9 439.3 2.13 ± 0.02
pr_revm_Fibonacci 204.9 ± 1.5 203.7 208.6 1.00
pr_levm_Fibonacci 436.3 ± 2.4 434.1 441.7 2.13 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 866.0 ± 12.1 846.4 889.3 1.01 ± 0.02
main_levm_FibonacciRecursive 1658.3 ± 21.9 1630.5 1709.3 1.93 ± 0.03
pr_revm_FibonacciRecursive 858.9 ± 9.2 845.9 875.9 1.00
pr_levm_FibonacciRecursive 1657.4 ± 12.0 1643.9 1678.1 1.93 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.5 8.8 1.00 ± 0.01
main_levm_ManyHashes 13.3 ± 0.2 13.1 13.5 1.54 ± 0.02
pr_revm_ManyHashes 8.7 ± 0.1 8.5 8.8 1.00
pr_levm_ManyHashes 13.3 ± 0.1 13.1 13.5 1.53 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 294.5 ± 0.5 293.7 295.5 1.00 ± 0.00
main_levm_Push 1108.2 ± 5.7 1099.4 1122.1 3.77 ± 0.03
pr_revm_Push 294.2 ± 1.4 292.2 297.0 1.00
pr_levm_Push 1038.3 ± 21.8 1028.2 1099.5 3.53 ± 0.08

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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 3.196 ± 0.042 3.166 3.312 1.01 ± 0.01
main_levm_BubbleSort 4.482 ± 0.008 4.471 4.495 1.41 ± 0.01
pr_revm_BubbleSort 3.177 ± 0.019 3.153 3.208 1.00
pr_levm_BubbleSort 4.610 ± 0.199 4.508 5.166 1.45 ± 0.06

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.051 ± 0.006 1.043 1.063 1.01 ± 0.02
main_levm_ERC20Approval 1.573 ± 0.016 1.559 1.602 1.51 ± 0.03
pr_revm_ERC20Approval 1.044 ± 0.014 1.030 1.074 1.00
pr_levm_ERC20Approval 1.593 ± 0.016 1.579 1.624 1.53 ± 0.03

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 141.7 ± 0.7 141.1 142.8 1.02 ± 0.01
main_levm_ERC20Mint 266.7 ± 1.4 264.5 269.1 1.91 ± 0.01
pr_revm_ERC20Mint 139.4 ± 0.7 138.4 140.9 1.00
pr_levm_ERC20Mint 262.8 ± 5.4 258.9 276.1 1.89 ± 0.04

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 251.1 ± 3.0 248.0 257.0 1.02 ± 0.02
main_levm_ERC20Transfer 422.6 ± 18.6 410.9 464.0 1.72 ± 0.08
pr_revm_ERC20Transfer 245.9 ± 2.8 242.5 250.9 1.00
pr_levm_ERC20Transfer 414.9 ± 3.1 410.9 422.1 1.69 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 233.8 ± 3.4 224.8 237.5 1.01 ± 0.03
main_levm_Factorial 457.9 ± 3.3 452.7 464.3 1.98 ± 0.05
pr_revm_Factorial 231.8 ± 6.1 227.8 248.0 1.00
pr_levm_Factorial 446.7 ± 3.9 443.4 454.4 1.93 ± 0.05

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.614 ± 0.034 1.533 1.660 1.00 ± 0.03
main_levm_FactorialRecursive 2.810 ± 0.022 2.784 2.852 1.75 ± 0.04
pr_revm_FactorialRecursive 1.609 ± 0.037 1.534 1.666 1.00
pr_levm_FactorialRecursive 2.704 ± 0.026 2.673 2.753 1.68 ± 0.04

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 206.2 ± 1.0 205.6 208.8 1.01 ± 0.01
main_levm_Fibonacci 436.5 ± 2.7 433.1 442.7 2.13 ± 0.02
pr_revm_Fibonacci 204.5 ± 0.9 203.7 206.5 1.00
pr_levm_Fibonacci 435.3 ± 4.5 427.5 443.9 2.13 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 869.4 ± 10.7 857.4 888.2 1.01 ± 0.02
main_levm_FibonacciRecursive 1713.7 ± 26.2 1696.0 1785.5 2.00 ± 0.04
pr_revm_FibonacciRecursive 858.7 ± 9.9 842.6 871.3 1.00
pr_levm_FibonacciRecursive 1669.8 ± 9.3 1650.0 1683.3 1.94 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 9.0 1.02 ± 0.01
main_levm_ManyHashes 14.1 ± 0.0 14.0 14.1 1.63 ± 0.02
pr_revm_ManyHashes 8.6 ± 0.1 8.6 8.8 1.00
pr_levm_ManyHashes 13.5 ± 0.1 13.4 13.6 1.56 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 294.2 ± 1.2 293.0 296.3 1.01 ± 0.00
main_levm_Push 1063.9 ± 6.2 1059.5 1078.5 3.64 ± 0.02
pr_revm_Push 292.0 ± 0.7 290.8 292.8 1.00
pr_levm_Push 1037.7 ± 1.3 1036.2 1039.9 3.55 ± 0.01

@jrchatruc
jrchatruc added this pull request to the merge queue Jul 2, 2025
@jrchatruc
jrchatruc removed this pull request from the merge queue due to a manual request Jul 2, 2025
@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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 3.168 ± 0.031 3.148 3.249 1.00 ± 0.01
main_levm_BubbleSort 4.598 ± 0.248 4.480 5.296 1.45 ± 0.08
pr_revm_BubbleSort 3.166 ± 0.019 3.142 3.205 1.00
pr_levm_BubbleSort 4.440 ± 0.034 4.413 4.516 1.40 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.055 ± 0.008 1.047 1.075 1.03 ± 0.01
main_levm_ERC20Approval 1.577 ± 0.006 1.571 1.590 1.53 ± 0.01
pr_revm_ERC20Approval 1.028 ± 0.005 1.024 1.037 1.00
pr_levm_ERC20Approval 1.533 ± 0.015 1.522 1.569 1.49 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.7 ± 0.7 137.7 140.2 1.02 ± 0.01
main_levm_ERC20Mint 263.9 ± 1.5 262.6 266.9 1.94 ± 0.02
pr_revm_ERC20Mint 135.9 ± 1.2 134.6 138.1 1.00
pr_levm_ERC20Mint 255.8 ± 1.1 254.1 257.4 1.88 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 251.5 ± 9.3 245.5 271.4 1.04 ± 0.04
main_levm_ERC20Transfer 413.2 ± 2.5 409.8 418.6 1.71 ± 0.01
pr_revm_ERC20Transfer 242.2 ± 1.0 240.8 244.3 1.00
pr_levm_ERC20Transfer 399.1 ± 3.1 396.8 405.3 1.65 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 231.1 ± 1.0 230.0 233.6 1.00
main_levm_Factorial 451.9 ± 9.9 445.8 478.4 1.96 ± 0.04
pr_revm_Factorial 231.2 ± 1.3 229.4 234.4 1.00 ± 0.01
pr_levm_Factorial 443.7 ± 1.7 441.1 446.4 1.92 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.628 ± 0.019 1.599 1.657 1.01 ± 0.02
main_levm_FactorialRecursive 2.670 ± 0.018 2.649 2.698 1.66 ± 0.03
pr_revm_FactorialRecursive 1.608 ± 0.025 1.553 1.632 1.00
pr_levm_FactorialRecursive 2.752 ± 0.026 2.720 2.795 1.71 ± 0.03

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.4 ± 1.0 204.1 207.2 1.00
main_levm_Fibonacci 439.1 ± 9.1 433.3 463.6 2.14 ± 0.05
pr_revm_Fibonacci 209.4 ± 2.7 207.5 216.4 1.02 ± 0.01
pr_levm_Fibonacci 457.6 ± 68.2 431.2 651.3 2.23 ± 0.33

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 873.1 ± 19.6 850.5 923.0 1.02 ± 0.03
main_levm_FibonacciRecursive 1672.8 ± 30.5 1645.3 1749.9 1.95 ± 0.04
pr_revm_FibonacciRecursive 856.0 ± 11.7 833.0 869.4 1.00
pr_levm_FibonacciRecursive 1676.3 ± 14.5 1661.6 1701.6 1.96 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.0 8.7 8.8 1.02 ± 0.01
main_levm_ManyHashes 13.8 ± 0.1 13.7 13.9 1.60 ± 0.01
pr_revm_ManyHashes 8.6 ± 0.0 8.6 8.7 1.00
pr_levm_ManyHashes 13.3 ± 0.2 13.1 13.6 1.55 ± 0.02

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 293.8 ± 0.8 293.2 296.0 1.01 ± 0.00
main_levm_Push 1119.8 ± 9.3 1094.0 1125.4 3.83 ± 0.04
pr_revm_Push 292.3 ± 1.2 291.0 294.8 1.00
pr_levm_Push 1064.5 ± 3.9 1058.7 1070.2 3.64 ± 0.02

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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 3.165 ± 0.028 3.140 3.232 1.00 ± 0.01
main_levm_BubbleSort 4.438 ± 0.018 4.405 4.470 1.40 ± 0.01
pr_revm_BubbleSort 3.162 ± 0.024 3.126 3.209 1.00
pr_levm_BubbleSort 4.478 ± 0.043 4.433 4.545 1.42 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.051 ± 0.003 1.047 1.057 1.02 ± 0.01
main_levm_ERC20Approval 1.529 ± 0.006 1.521 1.539 1.48 ± 0.01
pr_revm_ERC20Approval 1.031 ± 0.007 1.024 1.043 1.00
pr_levm_ERC20Approval 1.543 ± 0.022 1.524 1.588 1.50 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 139.4 ± 0.7 138.6 140.8 1.02 ± 0.01
main_levm_ERC20Mint 259.3 ± 3.6 255.7 268.3 1.90 ± 0.03
pr_revm_ERC20Mint 136.5 ± 0.9 135.5 138.3 1.00
pr_levm_ERC20Mint 257.8 ± 2.6 254.7 263.9 1.89 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 246.9 ± 1.2 245.7 249.9 1.02 ± 0.01
main_levm_ERC20Transfer 401.9 ± 5.1 397.0 412.9 1.66 ± 0.02
pr_revm_ERC20Transfer 241.9 ± 1.6 240.5 245.9 1.00
pr_levm_ERC20Transfer 408.7 ± 9.4 400.5 427.5 1.69 ± 0.04

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.6 ± 5.4 229.8 247.6 1.01 ± 0.02
main_levm_Factorial 446.1 ± 1.2 444.9 448.0 1.93 ± 0.01
pr_revm_Factorial 230.6 ± 1.7 228.7 234.7 1.00
pr_levm_Factorial 444.1 ± 2.4 440.6 450.0 1.93 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.591 ± 0.065 1.440 1.660 1.00
main_levm_FactorialRecursive 2.681 ± 0.022 2.653 2.716 1.68 ± 0.07
pr_revm_FactorialRecursive 1.598 ± 0.026 1.546 1.635 1.00 ± 0.04
pr_levm_FactorialRecursive 2.684 ± 0.029 2.654 2.753 1.69 ± 0.07

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 219.1 ± 43.0 204.1 341.5 1.06 ± 0.21
main_levm_Fibonacci 438.2 ± 2.6 436.1 444.1 2.12 ± 0.04
pr_revm_Fibonacci 206.9 ± 4.0 205.0 218.2 1.00
pr_levm_Fibonacci 438.9 ± 3.4 435.9 443.9 2.12 ± 0.04

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 868.0 ± 12.3 849.1 885.7 1.01 ± 0.01
main_levm_FibonacciRecursive 1655.9 ± 31.0 1631.9 1719.3 1.93 ± 0.04
pr_revm_FibonacciRecursive 857.4 ± 2.8 853.8 862.1 1.00
pr_levm_FibonacciRecursive 1658.5 ± 8.5 1648.7 1669.3 1.93 ± 0.01

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.8 ± 0.1 8.7 9.0 1.01 ± 0.01
main_levm_ManyHashes 13.4 ± 0.1 13.3 13.6 1.55 ± 0.02
pr_revm_ManyHashes 8.7 ± 0.1 8.5 8.8 1.00
pr_levm_ManyHashes 13.6 ± 0.2 13.4 14.0 1.57 ± 0.03

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.5 ± 1.6 293.6 298.5 1.01 ± 0.01
main_levm_Push 1101.2 ± 11.7 1076.5 1123.1 3.75 ± 0.06
pr_revm_Push 293.6 ± 3.7 291.1 303.9 1.00
pr_levm_Push 1030.6 ± 3.0 1028.1 1037.9 3.51 ± 0.05

@jrchatruc
jrchatruc added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit 1189f2f Jul 2, 2025
@jrchatruc
jrchatruc deleted the l2/reenable_risc0 branch July 2, 2025 19:12
@github-project-automation github-project-automation Bot moved this from In Progress to Done in ethrex_l2 Jul 2, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Jul 4, 2025
**Motivation**

Create an ethrex release when a semver tag is pushed to the repo

**Description**

- Modifies already existing L2 releases workflow to build 
- For `ethrex client` (right now only for L2 but can be used for both L1
and L2 after #3381 is merged )
     - Build for `linux-x86_64` , `linux-arm64`, `macos-arm64`
  - For `ethrex prover client`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
 - For `ethrex replay`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
  - Creates a release with
- Changelog from all the changes between the previous tag and the newly
created one.
- All the built binaries and the rollup L1 and L2 contracts in a tar
archive
- Example from testing repo
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.1 before
adding the contracts to the release output
- Another example with the contracts
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.2
- Example of all outputs
https://github.com/lambdaclass/ethrex/actions/runs/16077779945
- Non related change: pin the version for the docker image in sp1 
- With #3381 merged we now build ethrex with --all-features so the
default database was changed to libmdbx when initializing the store.
**Other considerations**

> Q: No sp1 cpu?
> A: Right now it's too slow to be viable in production environments

> Q: No sp1 macos?
> A: sp1 does not support the metal api for gpu acceleration. Also
because zkvms are built using docker we'll run into a problem where the
macos github runner does not have docker installed.
> After a quick investigation into this issue we have to use
[colima](actions/runner#1456 (comment))
for docker.
> This leads into another issue where sp1 uses a docker image built only
for amd64 this requires nested virtualization support that is enabled in
apple M3 chips or later but [the runner is currently using M1
chips](https://docs.github.com/en/actions/concepts/runners/about-larger-runners#limitations-for-macos-larger-runners).

> Q: Why does building the sp1 prover for
[arm-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455867)
take twice as long as building for
[x86-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455854)
> A: We have to use QEMU inside the `arm-64` runner because the sp1
docker image is only built for `amd64`

> Q: wen risc0
> A: ~After #3172 is merged~
[Now](https://github.com/lambdaclass/ethrex/actions/runs/16036016678/job/45247866997)
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
**Motivation**

risc0 support was temporarily deprecated because of incompatible
versions between some required ethrex's dependencies and the risc0
toolchain.

Now the toolchain uses a newer version so this problem should be solved,
but the backend needs some maintenance to get it working again.

**Description**

- update risc0 to latest version
- update risc0's build script for the new version
- refactor kzg verification into ethrex-common
- support kzg verification with both kzg-rs and c-kzg (sp1 is only
compatible with kzg-rs, risc0 only with c-kzg)
- fix wrong public inputs encoding
- fix wrong image id encoding
- add risc0 verification key (also called image id) as a contract
variable
- add risc0 lint job and refactor jobs for other backends
- add docs for local testing (deployment of risc0 contracts)

Closes lambdaclass#2145
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
**Motivation**

Create an ethrex release when a semver tag is pushed to the repo

**Description**

- Modifies already existing L2 releases workflow to build 
- For `ethrex client` (right now only for L2 but can be used for both L1
and L2 after lambdaclass#3381 is merged )
     - Build for `linux-x86_64` , `linux-arm64`, `macos-arm64`
  - For `ethrex prover client`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
 - For `ethrex replay`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
  - Creates a release with
- Changelog from all the changes between the previous tag and the newly
created one.
- All the built binaries and the rollup L1 and L2 contracts in a tar
archive
- Example from testing repo
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.1 before
adding the contracts to the release output
- Another example with the contracts
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.2
- Example of all outputs
https://github.com/lambdaclass/ethrex/actions/runs/16077779945
- Non related change: pin the version for the docker image in sp1 
- With lambdaclass#3381 merged we now build ethrex with --all-features so the
default database was changed to libmdbx when initializing the store.
**Other considerations**

> Q: No sp1 cpu?
> A: Right now it's too slow to be viable in production environments

> Q: No sp1 macos?
> A: sp1 does not support the metal api for gpu acceleration. Also
because zkvms are built using docker we'll run into a problem where the
macos github runner does not have docker installed.
> After a quick investigation into this issue we have to use
[colima](actions/runner#1456 (comment))
for docker.
> This leads into another issue where sp1 uses a docker image built only
for amd64 this requires nested virtualization support that is enabled in
apple M3 chips or later but [the runner is currently using M1
chips](https://docs.github.com/en/actions/concepts/runners/about-larger-runners#limitations-for-macos-larger-runners).

> Q: Why does building the sp1 prover for
[arm-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455867)
take twice as long as building for
[x86-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455854)
> A: We have to use QEMU inside the `arm-64` runner because the sp1
docker image is only built for `amd64`

> Q: wen risc0
> A: ~After lambdaclass#3172 is merged~
[Now](https://github.com/lambdaclass/ethrex/actions/runs/16036016678/job/45247866997)
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

risc0 support was temporarily deprecated because of incompatible
versions between some required ethrex's dependencies and the risc0
toolchain.

Now the toolchain uses a newer version so this problem should be solved,
but the backend needs some maintenance to get it working again.

**Description**

- update risc0 to latest version
- update risc0's build script for the new version
- refactor kzg verification into ethrex-common
- support kzg verification with both kzg-rs and c-kzg (sp1 is only
compatible with kzg-rs, risc0 only with c-kzg)
- fix wrong public inputs encoding
- fix wrong image id encoding
- add risc0 verification key (also called image id) as a contract
variable
- add risc0 lint job and refactor jobs for other backends
- add docs for local testing (deployment of risc0 contracts)

Closes lambdaclass#2145
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

Create an ethrex release when a semver tag is pushed to the repo

**Description**

- Modifies already existing L2 releases workflow to build 
- For `ethrex client` (right now only for L2 but can be used for both L1
and L2 after lambdaclass#3381 is merged )
     - Build for `linux-x86_64` , `linux-arm64`, `macos-arm64`
  - For `ethrex prover client`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
 - For `ethrex replay`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
  - Creates a release with
- Changelog from all the changes between the previous tag and the newly
created one.
- All the built binaries and the rollup L1 and L2 contracts in a tar
archive
- Example from testing repo
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.1 before
adding the contracts to the release output
- Another example with the contracts
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.2
- Example of all outputs
https://github.com/lambdaclass/ethrex/actions/runs/16077779945
- Non related change: pin the version for the docker image in sp1 
- With lambdaclass#3381 merged we now build ethrex with --all-features so the
default database was changed to libmdbx when initializing the store.
**Other considerations**

> Q: No sp1 cpu?
> A: Right now it's too slow to be viable in production environments

> Q: No sp1 macos?
> A: sp1 does not support the metal api for gpu acceleration. Also
because zkvms are built using docker we'll run into a problem where the
macos github runner does not have docker installed.
> After a quick investigation into this issue we have to use
[colima](actions/runner#1456 (comment))
for docker.
> This leads into another issue where sp1 uses a docker image built only
for amd64 this requires nested virtualization support that is enabled in
apple M3 chips or later but [the runner is currently using M1
chips](https://docs.github.com/en/actions/concepts/runners/about-larger-runners#limitations-for-macos-larger-runners).

> Q: Why does building the sp1 prover for
[arm-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455867)
take twice as long as building for
[x86-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455854)
> A: We have to use QEMU inside the `arm-64` runner because the sp1
docker image is only built for `amd64`

> Q: wen risc0
> A: ~After lambdaclass#3172 is merged~
[Now](https://github.com/lambdaclass/ethrex/actions/runs/16036016678/job/45247866997)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

L2: Fix Risc0. fix(prover): Fix and/or upgrade risc0 to make it work with rust 1.82

5 participants