Skip to content

feat(l1): integrate OpenVM v2.0.0-beta.1 backend with full precompile acceleration#6499

Draft
ilitteri wants to merge 4 commits intomainfrom
openvm-v2-backend
Draft

feat(l1): integrate OpenVM v2.0.0-beta.1 backend with full precompile acceleration#6499
ilitteri wants to merge 4 commits intomainfrom
openvm-v2-backend

Conversation

@ilitteri
Copy link
Copy Markdown
Collaborator

@ilitteri ilitteri commented Apr 16, 2026

Summary

Replace the OpenVM v1.4.x proving backend with v2.0.0-beta.1 (SWIRL proof system). This is L1 stateless validation only — no L2 prover integration.

  • Backend rewrite: new SDK constructor with SystemParams + AggregationSystemParams, proof type changes from VmStarkProof to NonRootStarkProof, Groth16 path removed (Compressed only), per-call SDK construction (Sdk is !Send)
  • Full precompile acceleration: expand OpenVmCrypto from 2 to 15 accelerated methods — keccak256, sha256, BN254 (ecadd, ecmul, pairing), secp256r1 verify, BLS12-381 (G1 add/MSM, G2 add/MSM, pairing), modexp BN254 Fr fast path
  • Subgroup checks: BN254 G2, BLS12-381 G1/G2 membership checks to prevent invalid-curve attacks (ref: ere-guests)
  • Dependency cleanup: bump all OpenVM deps to v2.0.0-beta.1, remove openvm-continuations, add openvm-verify-stark-host, decouple openvm-kzg (blocked on v2) and secp256k1 C lib from openvm feature

Not in scope

  • L2 prover integration / ProverType registration
  • Groth16 / EVM proof generation
  • verify() / to_proof_bytes() implementation

Test plan

  • cargo check -p ethrex-prover --features openvm compiles cleanly
  • Guest ELF builds with cargo openvm build --no-transpile (v2 CLI)
  • Smoke test: execute() with empty ProgramInput — guest correctly rejects with domain error, no VM crash
  • EF test: test_blobbasefee_before_fork (Cancun block) passes through OpenVM VM in 7.7s
  • EF test: BLS12-381 precompile tests (Prague, 3 blocks) pass in 54.5s
  • All EF test failures are pre-existing (confirmed with Exec backend) — zero OpenVM-specific regressions
  • Full EF test suite run (requires ~24h, partial run showed 39 failures all pre-existing)

Replace the OpenVM v1.4.x proving backend with v2.0.0-beta.1 (SWIRL proof
system). The new SDK requires explicit SystemParams and
AggregationSystemParams for construction. Proof output type changes from
VmStarkProof to NonRootStarkProof. Groth16/EVM proof path removed (only
Compressed STARK supported for now).

Expand OpenVmCrypto from 2 overrides (ecrecover, recover_signer) to 15
accelerated methods covering keccak256, sha256, BN254 (ecadd, ecmul,
pairing), secp256r1 verify, BLS12-381 (G1 add, G1 MSM, G2 add, G2 MSM,
pairing), and modexp with BN254 Fr fast path. Add subgroup membership
checks for BN254 G2, BLS12-381 G1, and BLS12-381 G2 to prevent
invalid-curve attacks.

Decouple openvm-kzg (pinned to v1.4.1) and secp256k1 C library from the
openvm feature to avoid version conflicts and cross-compilation failures
in the guest binary.
@ilitteri ilitteri changed the title Integrate OpenVM v2.0.0-beta.1 backend feat(l1): integrate OpenVM v2.0.0-beta.1 backend with full precompile acceleration Apr 16, 2026
@github-actions github-actions bot added the L1 Ethereum client label Apr 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 16, 2026

Lines of code report

Total lines added: 488
Total lines removed: 0
Total lines changed: 488

Detailed view
+--------------------------------------------------+-------+------+
| File                                             | Lines | Diff |
+--------------------------------------------------+-------+------+
| ethrex/crates/guest-program/src/crypto/openvm.rs | 506   | +488 |
+--------------------------------------------------+-------+------+

Move SubgroupCheck trait and implementations from the separate
openvm_subgroup_check.rs module into the bottom of openvm.rs.
No functional change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant