Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
35c7246
feat: port `crates` and `ere-guests` from `zkevm-benchmark-workload@8…
han0110 Jan 2, 2026
93f5b18
chore: remove host crates
han0110 Jan 2, 2026
c862a50
feat: re-organize guest libs into crates
han0110 Jan 2, 2026
436ce48
chore: add `.gitignore` and `rustfmt.toml`
han0110 Jan 2, 2026
d096923
chore: reorganize `ere-guests` into `bin`
han0110 Jan 2, 2026
fdd348e
feat: update `block-encoding-length`
han0110 Dec 31, 2025
814b3aa
feat: update `empty`
han0110 Dec 31, 2025
95e4e3c
feat: update `panic`
han0110 Dec 31, 2025
aacbfa9
feat: update `stateless-validator-ethrex`
han0110 Dec 31, 2025
72902dd
feat: update `stateless-validator-reth`
han0110 Dec 31, 2025
aed19a7
chore: more consistent
han0110 Dec 31, 2025
7055f5c
feat: add missing zkvm guest for block-length-encoding, empty, panic …
han0110 Dec 31, 2025
32552b0
ci: add compile and release workflow
han0110 Dec 31, 2025
39368ac
fix: unused patches
han0110 Dec 31, 2025
1f9368a
refactor: reexport `reth-stateless` features
han0110 Jan 1, 2026
123922a
ci: refactor and add duplicated pkg check
han0110 Jan 1, 2026
e81fbeb
chore: fmt
han0110 Jan 1, 2026
1cbeeef
chore: update
han0110 Jan 1, 2026
157d04a
ci: simplify
han0110 Jan 1, 2026
e936e47
chore: update `README.md`
han0110 Jan 1, 2026
562c942
ci: fix
han0110 Jan 1, 2026
90b91e0
ci: fix
han0110 Jan 1, 2026
5081005
ci: tweak
han0110 Jan 1, 2026
4c60b92
feat: add back compilation test
han0110 Jan 1, 2026
b7fe777
ci: tweak
han0110 Jan 1, 2026
9c8fedd
ci: chore
han0110 Jan 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/scripts/check-duplicate-pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/bin/bash

set -uo pipefail

INCLUDE=""
EXCLUDE=""
CARGO_LOCK=""

# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--include)
INCLUDE="$2"
shift 2
;;
--exclude)
EXCLUDE="$2"
shift 2
;;
--cargo-lock)
CARGO_LOCK="$2"
shift 2
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 --include <regex-pattern> [--exclude <regex-pattern>] [--cargo-lock <path>]"
exit 1
;;
esac
done

if [ -z "$INCLUDE" ]; then
echo "Error: --include <regex-pattern> is required"
echo "Usage: $0 --include <regex-pattern> [--exclude <regex-pattern>] [--cargo-lock <path>]"
exit 1
fi

check_duplicate_pkg() {
local CARGO_LOCK="$1"
local HAS_DUPLICATES=0

echo "Checking duplicate packages in $CARGO_LOCK..."
echo

# Get all package names matching the regex pattern
local MATCHING_PACKAGES
if [ -n "$EXCLUDE" ]; then
MATCHING_PACKAGES=$(grep '^name = "' "$CARGO_LOCK" | sed 's/^name = "//; s/"$//' | grep -E "$INCLUDE" | grep -v -E "$EXCLUDE" | sort -u || true)
else
MATCHING_PACKAGES=$(grep '^name = "' "$CARGO_LOCK" | sed 's/^name = "//; s/"$//' | grep -E "$INCLUDE" | sort -u || true)
fi

if [ -z "$MATCHING_PACKAGES" ]; then
echo "No packages matching pattern found"
echo
return 0
fi

echo "Checking packages matching pattern:"
echo " $MATCHING_PACKAGES" | tr '\n' ' '
echo
echo

# Single pass through Cargo.lock to collect all package info
local RESULTS
RESULTS=$(awk -v pkgs="$MATCHING_PACKAGES" '
BEGIN {
split(pkgs, pkg_array, "\n")
for (i in pkg_array) {
if (pkg_array[i] != "") {
pkg_map[pkg_array[i]] = 1
}
}
}
/^\[\[package\]\]/ { in_pkg=1; name=""; version=""; source="" }
in_pkg && /^name = / { gsub(/^name = "|"$/, ""); name=$0 }
in_pkg && /^version = / { gsub(/^version = "|"$/, ""); version=$0 }
in_pkg && /^source = / { gsub(/^source = "|"$/, ""); source=$0 }
in_pkg && /^$/ {
if (name in pkg_map) {
pkg_versions[name]++
pkg_info[name, pkg_versions[name]] = sprintf("version: %s\nsource: %s", version, (source ? source : "local"))
}
in_pkg=0
}
END {
for (pkg in pkg_versions) {
if (pkg_versions[pkg] > 1) {
printf "Package '\''%s'\'' has more than 1 versions\n\n", pkg
for (i = 1; i <= pkg_versions[pkg]; i++) {
print pkg_info[pkg, i]
print ""
}
}
}
}
' "$CARGO_LOCK")

if [ -n "$RESULTS" ]; then
echo "$RESULTS"
echo
HAS_DUPLICATES=1
fi

return $HAS_DUPLICATES
}

HAS_DUPLICATES=0

if [ -n "$CARGO_LOCK" ]; then
# Check only the specified Cargo.lock file
if [ ! -f "$CARGO_LOCK" ]; then
echo "Error: Cargo.lock not found at $CARGO_LOCK"
exit 1
fi
check_duplicate_pkg "$CARGO_LOCK" || HAS_DUPLICATES=1
else
# Iterate through all Cargo.lock files in bin directory
while read -r CARGO_LOCK; do
check_duplicate_pkg "$CARGO_LOCK" || HAS_DUPLICATES=1
done < <(find bin -name "Cargo.lock" -type f)
fi

exit $HAS_DUPLICATES
18 changes: 18 additions & 0 deletions .github/scripts/check-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -uo pipefail

HAS_ERRORS=0

echo "Checking format of workspace..."
echo
cargo +nightly fmt --check --all || HAS_ERRORS=1

while read -r CARGO_TOML; do
DIR=$(dirname "$CARGO_TOML")
echo "Checking format of $DIR..."
echo
(cd "$DIR" && cargo +nightly fmt --check --all) || HAS_ERRORS=1
done < <(find bin -name "Cargo.toml" -type f)

exit $HAS_ERRORS
69 changes: 69 additions & 0 deletions .github/scripts/check-unused-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -uo pipefail

CARGO_LOCK=""

# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--cargo-lock)
CARGO_LOCK="$2"
shift 2
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--cargo-lock <path>]"
exit 1
;;
esac
done

check_unused_patch() {
local CARGO_LOCK="$1"
local HAS_ERRORS=0

echo "Checking unused patches in $CARGO_LOCK..."
echo

# Check for [[patch.unused]] section in Cargo.lock
if grep -q "^\[\[patch\.unused\]\]$" "$CARGO_LOCK"; then
# Extract package names from [[patch.unused]] section
local UNUSED_PATCHES=$(awk '
/^\[\[patch\.unused\]\]$/ { in_unused=1; next }
/^\[\[/ && !/^\[\[patch\.unused\]\]$/ { in_unused=0 }
in_unused && /^name = / {
gsub(/^name = "|"$/, "")
print
}
' "$CARGO_LOCK")

if [ -n "$UNUSED_PATCHES" ]; then
echo "The following patches are unused:"
echo " $UNUSED_PATCHES" | tr '\n' ' '
echo
echo
HAS_ERRORS=1
fi
fi

return $HAS_ERRORS
}

HAS_ERRORS=0

if [ -n "$CARGO_LOCK" ]; then
# Check only the specified Cargo.lock file
if [ ! -f "$CARGO_LOCK" ]; then
echo "Error: Cargo.lock not found at $CARGO_LOCK"
exit 1
fi
check_unused_patch "$CARGO_LOCK" || HAS_ERRORS=1
else
# Iterate through all Cargo.lock files in bin directory
while read -r CARGO_LOCK; do
check_unused_patch "$CARGO_LOCK" || HAS_ERRORS=1
done < <(find bin -name "Cargo.lock" -type f)
fi

exit $HAS_ERRORS
131 changes: 131 additions & 0 deletions .github/workflows/compile-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Compile and Release Compiled Guests

on:
push:
branches:
- main
tags:
- 'v*'

env:
CARGO_TERM_COLOR: always

permissions:
contents: write

jobs:
compile:
name: Compile ${{ matrix.guest }}-${{ matrix.zkvm }}
runs-on: ubuntu-latest
outputs:
ere_tag: ${{ steps.get_ere_tag.outputs.ere_tag }}
strategy:
fail-fast: false
matrix:
guest:
- block-encoding-length
- empty
- panic
- stateless-validator-ethrex
- stateless-validator-reth
zkvm:
- airbender
- openvm
- pico
- risc0
- sp1
- zisk
exclude:
- guest: stateless-validator-ethrex
zkvm: airbender
- guest: stateless-validator-ethrex
zkvm: openvm
- guest: stateless-validator-ethrex
zkvm: pico
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Ere tag
id: get_ere_tag
run: |
ERE_TAG=$(cargo tree -p ere-platform-trait | head -n 1 | sed -E 's/ere-platform-trait v([0-9.]+) \(.*#([a-f0-9]{7}).*/\1-\2/')
echo "ere_tag=${ERE_TAG}" >> $GITHUB_OUTPUT
echo "Ere tag: ${ERE_TAG}"

- name: Pull compiler image
run: |
docker pull ghcr.io/eth-act/ere/ere-compiler-${{ matrix.zkvm }}:${{ steps.get_ere_tag.outputs.ere_tag }}

- name: Compile guest
run: |
docker run \
-v $PWD:/ere-guests \
-v $PWD/output:/output \
ghcr.io/eth-act/ere/ere-compiler-${{ matrix.zkvm }}:${{ steps.get_ere_tag.outputs.ere_tag }} \
--compiler-kind rust-customized \
--guest-path /ere-guests/bin/${{ matrix.guest }}/${{ matrix.zkvm }} \
--output-path /output/${{ matrix.guest }}-${{ matrix.zkvm }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.guest }}-${{ matrix.zkvm }}
path: output/${{ matrix.guest }}-${{ matrix.zkvm }}
if-no-files-found: error

create-release:
name: Create release
needs: compile
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Display structure of downloaded files
run: ls -R artifacts

- name: Generate release notes
run: |
echo "This release contains compiled guest programs for various zkVMs." > release-body.md
echo "" >> release-body.md
echo "Built with Ere compiler version: \`${{ needs.compile.outputs.ere_tag }}\`." >> release-body.md
echo "" >> release-body.md
echo "## Compiled guest programs" >> release-body.md
echo "" >> release-body.md

# Get unique guest names
declare -A guests
for file in artifacts/*; do
if [ -f "$file" ]; then
filename=$(basename "$file")
guest=$(echo "$filename" | sed 's/-[^-]*$//')
guests["$guest"]=1
fi
done

# Sort and group by guest
for guest in $(echo "${!guests[@]}" | tr ' ' '\n' | sort); do
echo "### $guest" >> release-body.md
echo "" >> release-body.md
for file in artifacts/$guest-*; do
if [ -f "$file" ]; then
filename=$(basename "$file")
echo "- [\`$filename\`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/$filename)" >> release-body.md
fi
done
echo "" >> release-body.md
done

- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Compiled Guests (${{ github.ref_name }})
files: artifacts/*
body_path: release-body.md
Loading