Skip to content

Conversation

@xqft
Copy link
Contributor

@xqft xqft commented Jul 1, 2025

Motivation

Adds support for Aligned + multi-prover, in particular supporting both SP1 and Risc0. This is a big change that requires modifying the sequencer, prover and settlement contracts.

Also fixes some bugs discovered on the way (SP1 public inputs, SQL rollup store, prover make rules). More details in description.

Description

  • added support for risc0 backend to send compressed proofs.
  • sequencer code related to Aligned mode now does not assumes that the proofs are from sp1, handles risc0 too.
  • OnChainProposer now uses booleans to determine if proofs for a certain type are required
  • changed deployer options according to previous point.
  • OnChainProposer in Aligned mode will check for risc0 proofs too
  • rewritten L1 Proof Verifier aggregation check
  • renamed get_lastest_sent_batch_proof to get_latest_sent_batch_proof (extra 's' on second word)
  • fix SQL rollup store store_latest_sent_batch_proof not working
  • fix SP1 public inputs containing a bincode prefix
  • fix init-prover and build-prover rules not working for GPU
  • forcing SP1 backend to be built with the gpu feature instead of relying in the SP1_PROVER env var (to make it consistent with Risc0)
  • updated Aligned docs
  • pinned zkvm versions (sometimes changes are pushed into minor versions which make a proof not verifiable with an older version of the zkvm, I consider that a breaking change)

Base automatically changed from l2/reenable_risc0 to main July 2, 2025 19:12
@ilitteri ilitteri added the L2 Rollup client label Jul 3, 2025
@github-actions
Copy link

github-actions bot commented Jul 3, 2025

Lines of code report

Total lines added: 209
Total lines removed: 72
Total lines changed: 281

Detailed view
+----------------------------------------------------+-------+------+
| File                                               | Lines | Diff |
+----------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/l2/deployer.rs                   | 1123  | +43  |
+----------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/l2/options.rs                    | 1002  | -26  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/common/src/prover.rs              | 178   | +51  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backend/risc0.rs       | 103   | +12  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backend/sp1.rs         | 131   | -5   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/config.rs              | 11    | -1   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/guest_program/build.rs | 73    | -7   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/prover.rs              | 151   | +1   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sdk/src/sdk.rs                    | 898   | +11  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/configs.rs              | 100   | -1   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/errors.rs               | 383   | +21  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_proof_sender.rs      | 412   | +9   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_proof_verifier.rs    | 349   | +60  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/mod.rs                  | 230   | -5   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/proof_coordinator.rs    | 476   | -4   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/utils.rs                | 167   | -19  |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/storage/src/api.rs                | 128   | -1   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/storage/src/store_db/in_memory.rs | 345   | -3   |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/tee/quote-gen/src/sender.rs       | 82    | +1   |
+----------------------------------------------------+-------+------+

@ilitteri ilitteri moved this to In Progress in ethrex_l2 Jul 3, 2025
@github-actions
Copy link

Benchmark for e722057

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.3±1.49ms 38.0±1.11ms +4.68%
Trie/cita-trie insert 1k 2.8±0.01ms 2.9±0.23ms +3.57%
Trie/ethrex-trie insert 10k 54.5±2.52ms 50.3±3.03ms -7.71%
Trie/ethrex-trie insert 1k 5.5±0.02ms 5.5±0.17ms 0.00%

pub fn aligned_vm_program_code(&self) -> std::io::Result<Option<Vec<u8>>> {
match self {
Self::RISC0 => {
let path = format!(
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work on downloaded binaries. We should embed this in the binary. For reference, here's a way to do it:
https://github.com/lambdaclass/ethrex/pull/4014/files#diff-a73d7b3e1eec2d556992a25ceef5203288ab90a0f9bcc7b4a176a754c647dc42R72

@github-project-automation github-project-automation bot moved this from In Review to Requires Changes in ethrex_l2 Oct 24, 2025
@github-actions
Copy link

Benchmark for f9cc2c1

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.8±1.76ms 36.6±2.05ms +2.23%
Trie/cita-trie insert 1k 3.6±0.02ms 3.7±0.19ms +2.78%
Trie/ethrex-trie insert 10k 48.9±1.69ms 50.7±1.24ms +3.68%
Trie/ethrex-trie insert 1k 6.4±0.02ms 6.5±0.03ms +1.56%

@github-actions
Copy link

Benchmark for cd6e2ac

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.2±1.10ms 35.2±0.94ms +2.92%
Trie/cita-trie insert 1k 3.6±0.02ms 3.6±0.14ms 0.00%
Trie/ethrex-trie insert 10k 55.6±2.30ms 53.8±1.92ms -3.24%
Trie/ethrex-trie insert 1k 6.4±0.25ms 6.4±0.09ms 0.00%

@github-actions
Copy link

Benchmark for ec31811

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.1±1.10ms 35.1±0.73ms 0.00%
Trie/cita-trie insert 1k 3.5±0.17ms 3.7±0.26ms +5.71%
Trie/ethrex-trie insert 10k 48.4±0.72ms 48.6±0.77ms +0.41%
Trie/ethrex-trie insert 1k 6.3±0.12ms 6.4±0.03ms +1.59%

@github-actions
Copy link

Benchmark for 8331720

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 28.0±2.85ms 36.1±3.25ms +28.93%
Trie/cita-trie insert 1k 2.8±0.02ms 2.8±0.06ms 0.00%
Trie/ethrex-trie insert 10k 49.1±3.04ms 47.4±1.28ms -3.46%
Trie/ethrex-trie insert 1k 5.4±0.06ms 5.5±0.12ms +1.85%

@github-actions
Copy link

Benchmark for d9b5491

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.5±1.90ms 38.0±3.09ms +4.11%
Trie/cita-trie insert 1k 3.5±0.01ms 3.5±0.11ms 0.00%
Trie/ethrex-trie insert 10k 49.1±1.19ms 51.5±1.84ms +4.89%
Trie/ethrex-trie insert 1k 6.3±0.04ms 6.3±0.16ms 0.00%

@github-actions
Copy link

Benchmark for 20dee03

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.0±1.05ms 33.5±1.56ms -1.47%
Trie/cita-trie insert 1k 3.6±0.02ms 3.5±0.06ms -2.78%
Trie/ethrex-trie insert 10k 53.5±3.03ms 52.0±2.39ms -2.80%
Trie/ethrex-trie insert 1k 6.4±0.02ms 6.4±0.08ms 0.00%

Copy link
Contributor

@ManuelBilbao ManuelBilbao left a comment

Choose a reason for hiding this comment

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

Nit

@github-actions
Copy link

Benchmark for bd8ebd1

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 37.6±1.68ms 36.0±1.70ms -4.26%
Trie/cita-trie insert 1k 3.5±0.02ms 3.6±0.01ms +2.86%
Trie/ethrex-trie insert 10k 48.9±1.13ms 50.0±1.92ms +2.25%
Trie/ethrex-trie insert 1k 6.4±0.41ms 6.4±0.05ms 0.00%

@ManuelBilbao ManuelBilbao added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit 4df1f44 Oct 28, 2025
42 of 44 checks passed
@ManuelBilbao ManuelBilbao deleted the l2/risc0_aligned branch October 28, 2025 18:27
@github-project-automation github-project-automation bot moved this from Requires Changes to Done in ethrex_l2 Oct 28, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 1, 2025
**Motivation**

#3429 updated how SP1
verification key generation works, but the tag_release workflow was not
updated to take this into account.
xqft pushed a commit that referenced this pull request Nov 11, 2025
**Motivation**

#3429 updated how SP1
verification key generation works, but the tag_release workflow was not
updated to take this into account.
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.

6 participants