Skip to content

Commit

Permalink
Prepare for client-only zkvm usage
Browse files Browse the repository at this point in the history
This doesn't yet change any default feature flags, so should still be fairly minimal. 

The planned set of PRs include:
* add release process to build r0vm for all major targets
  * use cargo zigbuild on linux to build with a specific glibc for max compat with older linux distros
  * use something like https://github.com/cargo-bins/release-pr to automatically build/publish binaries on a per-release basis
* update `cargo risczero install` or adjust docs to have users do `cargo binstall cargo-risczero` (depending on whether we package `r0vm` as standalone or combined with `cargo-risczero`)
  • Loading branch information
flaub authored Oct 2, 2023
1 parent e249d72 commit 3e78293
Show file tree
Hide file tree
Showing 75 changed files with 9,080 additions and 963 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bench_datasheet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RISC0_BUILD_LOCKED: 1

jobs:
bench:
runs-on: [self-hosted, prod, bench, "${{ matrix.os }}", "${{ matrix.device }}"]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/bench_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RISC0_BUILD_LOCKED: 1

jobs:
bench:
runs-on: [self-hosted, prod, bench, "${{ matrix.os }}", "${{ matrix.device }}"]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/bench_trends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RISC0_BUILD_LOCKED: 1

jobs:
bench:
runs-on: [self-hosted, prod, bench, "${{ matrix.os }}", "${{ matrix.device }}"]
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RISC0_BUILD_LOCKED: 1

jobs:
bonsai:
runs-on: [self-hosted, prod, Linux, cpu]
Expand Down Expand Up @@ -47,10 +50,12 @@ jobs:

# Test
- name: run cargo tests in bonsai
run: cargo test --manifest-path bonsai/Cargo.toml --tests -- --include-ignored --nocapture
run: cargo test --locked --tests -- --include-ignored --nocapture
working-directory: bonsai

- name: run cargo tests in bonsai/examples/governance
run: cargo test --manifest-path bonsai/examples/governance/Cargo.toml
run: cargo test --locked
working-directory: bonsai/examples/governance

- name: run forge tests in bonsai/ethereum
run: forge test -vvv
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
env:
CUDA_LIBRARY_PATH: /usr/lib/cuda
FEATURE: ${{ matrix.feature }}
RISC0_BUILD_LOCKED: 1
RISC0_SERVER_PATH: ${{ github.workspace }}/target/release/r0vm
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
steps:
Expand All @@ -82,21 +84,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cargo xtask install
- run: cargo xtask gen-receipt
- run: cargo build --release -F $FEATURE -p risc0-r0vm
- run: cargo test -F $FEATURE -F profiler
- run: cargo test --workspace -F $FEATURE --tests -- --ignored --test-threads 1
- run: cargo test -F $FEATURE -F disable-dev-mode -p risc0-r0vm
- run: cargo test -F $FEATURE -F fault-proof -p risc0-zkvm -- tests::memory_io tests::memory_access
if: matrix.device == 'cpu'
- run: cargo test -F experimental -p cargo-risczero
if: matrix.device == 'cpu'
- run: cargo check -F $FEATURE --benches
- run: cargo check -p risc0-build
if: matrix.device == 'cpu'
- run: cargo check -F $FEATURE -p risc0-circuit-rv32im
- run: cargo check -p risc0-core
if: matrix.device == 'cpu'
- run: cargo check -p cargo-risczero
if: matrix.device == 'cpu'
- run: cargo check -p cargo-risczero -F experimental
if: matrix.device == 'cpu'
- run: cargo check -F $FEATURE -p risc0-r0vm
- run: cargo check -F $FEATURE -p risc0-sys
- run: cargo check -F $FEATURE -p risc0-zkp
Expand Down Expand Up @@ -127,6 +128,10 @@ jobs:
env:
CUDA_LIBRARY_PATH: /usr/lib/cuda
FEATURE: ${{ matrix.feature }}
RISC0_BUILD_LOCKED: 1
RISC0_EXECUTOR: ipc
RISC0_PROVER: ipc
RISC0_SERVER_PATH: ${{ github.workspace }}/target/release/r0vm
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
steps:
Expand All @@ -146,7 +151,8 @@ jobs:
- run: cargo run --bin cargo-risczero -- risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cargo test -F $FEATURE
- run: cargo build --release -F $FEATURE -p risc0-r0vm
- run: cargo test --locked -F $FEATURE
working-directory: examples

doc:
Expand Down Expand Up @@ -174,24 +180,35 @@ jobs:
fail-fast: false
matrix:
os: [Linux, macOS]
env:
RISC0_SERVER_PATH: ${{ github.workspace }}/target/release/r0vm
RUSTC_WRAPPER: sccache

steps:
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :"
- uses: actions/checkout@v3
- uses: ./.github/actions/rustup
- uses: ./.github/actions/sccache
- run: cargo run --bin cargo-risczero -- risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cargo build --release -p risc0-r0vm
- run: |
cargo run -p cargo-risczero risczero new --template templates/rust-starter --templ-subdir="" --path $(pwd) --dest ${{ runner.temp }} template-test
cargo run -p cargo-risczero risczero new \
--template templates/rust-starter \
--templ-subdir="" \
--path $(pwd) \
--dest ${{ runner.temp }} \
template-test
shell: bash
- run: cargo build --release --manifest-path ${{ runner.temp }}/template-test/Cargo.toml
- run: ${{ runner.temp }}/template-test/target/release/host

web:
runs-on: ubuntu-latest-8-cores
env:
RISC0_BUILD_LOCKED: 1
RUSTC_WRAPPER: sccache
steps:
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842
Expand Down Expand Up @@ -225,5 +242,5 @@ jobs:
with:
node-version: 18
- run: cargo run --bin cargo-risczero -- risczero install
- run: cargo test -p risc0-build -F docker
- run: cargo test -F default -F profiler -F test-exact-cycles -p risc0-zkvm
- run: cargo test -F docker -p risc0-build
- run: cargo test -F docker -p risc0-zkvm -- "docker::"
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
description: 'How many crates (sorted by downloads) to test'
default: 100

env:
RISC0_BUILD_LOCKED: 1

jobs:
crates_validate:
runs-on: [self-hosted, prod, Linux, cpu]
Expand Down
Loading

0 comments on commit 3e78293

Please sign in to comment.