Skip to content

Conversation

@ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Nov 8, 2025

Motivation

We need releases of ethrex's ELFs and VKs to use independently for proving L1 blocks execution.

Description

  • Adds a build-ethrex-guest workflow to run with a mattrix strategy (for sp1 and risc0) that builds the guest_program crate with the features sp1 and risc0. We need this as a separate job and cannot reuse the builds from ubuntu-22.04 for l2_gpu because the guest program being built there is different than the one we need for statelessly verifying L1 blocks.
  • Adds a package-ethrex-guests workflow to create ethrex-guests.tar.gz compressing SP1 and RISC0 elf and vks.
  • RISC0's ELF file is now generated.

@ilitteri ilitteri requested a review from ManuelBilbao November 8, 2025 18:10
@ilitteri ilitteri self-assigned this Nov 8, 2025
@ilitteri ilitteri requested a review from a team as a code owner November 8, 2025 18:10
Copilot AI review requested due to automatic review settings November 8, 2025 18:10
@github-actions github-actions bot added the L2 Rollup client label Nov 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for building and distributing RISC0 ELF files alongside verification keys in the release workflow. The key changes include writing the RISC0 ELF binary to disk during the build process and updating the GitHub workflow to upload both ELF files and verification keys as release artifacts.

  • Extracts and writes the RISC0 ELF binary to a file during the build process
  • Adds a new CI job to build guest programs for both SP1 and RISC0 zkVMs
  • Updates the release workflow to download and include verification keys as separate artifacts

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/l2/prover/src/guest_program/build.rs Adds extraction and writing of RISC0 ELF binary to file system
.github/workflows/tag_release.yaml Adds new job to build guest programs and handle verification keys as separate artifacts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 199 to 200
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ethrex-riscv32im-risc0-elf-${{ github.ref_name}}
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ${{ matrix.zkvm }}_verification_keys/ethrex-riscv32im-risc0-vk-${{ github.ref_name}}
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Missing closing brace in template expression. Both lines should use ${{ github.ref_name }} with a closing brace, not ${{ github.ref_name}}.

Suggested change
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ethrex-riscv32im-risc0-elf-${{ github.ref_name}}
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ${{ matrix.zkvm }}_verification_keys/ethrex-riscv32im-risc0-vk-${{ github.ref_name}}
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ethrex-riscv32im-risc0-elf-${{ github.ref_name }}
mv crates/l2/prover/src/guest_program/src/${{ matrix.zkvm }}/out/riscv32im-risc0-vk ${{ matrix.zkvm }}_verification_keys/ethrex-riscv32im-risc0-vk-${{ github.ref_name }}

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Nov 8, 2025

Lines of code report

Total lines added: 3
Total lines removed: 0
Total lines changed: 3

Detailed view
+----------------------------------------------------+-------+------+
| File                                               | Lines | Diff |
+----------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/guest_program/build.rs | 76    | +3   |
+----------------------------------------------------+-------+------+

uses: actions/download-artifact@v4
with:
path: ./bin
pattern: "*_verification_keys" # sp1_verification_keys, risc0_verification_keys
Copy link
Contributor Author

@ilitteri ilitteri Nov 8, 2025

Choose a reason for hiding this comment

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

I'm not sure if the pattern needs to be instead "*_verification_keys/*"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd put VKs and ELFs in a .tar file so we don't add 5 more files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 222 to 223
- name: Checkout code
uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed

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.

Just a nit

finalize-release:
needs:
- build-ethrex
- build-ethrex-guest
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not needed since it is required in package-ethrex-guest

@ilitteri ilitteri enabled auto-merge November 10, 2025 22:20
@ilitteri ilitteri added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 66cd9fb Nov 10, 2025
43 checks passed
@ilitteri ilitteri deleted the ethrex_zkvm_elf_releases branch November 10, 2025 23:08
xqft pushed a commit that referenced this pull request Nov 11, 2025
**Motivation**

We need releases of ethrex's ELFs and VKs to use independently for
proving L1 blocks execution.

**Description**

- Adds a `build-ethrex-guest` workflow to run with a mattrix strategy
(for sp1 and risc0) that builds the `guest_program` crate with the
features `sp1` and `risc0`. We need this as a separate job and cannot
reuse the builds from ubuntu-22.04 for l2_gpu because the guest program
being built there is different than the one we need for statelessly
verifying L1 blocks.
- Adds a `package-ethrex-guests` workflow to create
`ethrex-guests.tar.gz` compressing SP1 and RISC0 elf and vks.
- RISC0's ELF file is now generated.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

4 participants