Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor prover api #106

Merged
merged 28 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
44e5700
update zkvm usage
capossele May 14, 2024
3007e20
update lib
capossele May 14, 2024
7f66d3c
update risc0-ethereum
capossele May 16, 2024
5af9804
improve local prover instructions
capossele May 16, 2024
97f3c70
update deps
capossele May 16, 2024
327c0e5
bump risc0-ethereum
capossele May 16, 2024
c72acb6
bump risc0-ethereum
capossele May 16, 2024
0d81032
bump risc0-ethereum
capossele May 16, 2024
5eb4d68
Merge branch 'dev' into capossele/refactor-prover-api
capossele May 16, 2024
180a4b7
add deployment guide
capossele May 16, 2024
68d345d
Merge branch 'dev' into capossele/refactor-prover-api
capossele May 16, 2024
d0cd672
bump risc0-ethereum
capossele May 16, 2024
4921f1b
use local prover
capossele May 17, 2024
30bd652
fix action
capossele May 17, 2024
8dfd40d
use main branch
capossele May 17, 2024
626f08b
use sccache
capossele May 17, 2024
bc4ea3f
add permissions
capossele May 17, 2024
2cc0db4
use ubuntu
capossele May 17, 2024
b62281d
Set submodule commits to match dependencies on risc0-ethereum (#109)
nategraf May 30, 2024
c280230
use cargo-risczero-install action from risc0-ethereum and remove unus…
nategraf May 30, 2024
eca7aea
fix use of removed env var
nategraf May 30, 2024
fadfb87
i see you, whitespace
nategraf May 30, 2024
604ba43
Merge branch 'dev' of github.com:risc0/bonsai-foundry-template into c…
nategraf May 30, 2024
51f26b4
use pending version of cargo-risczero-install
nategraf May 30, 2024
a2da5ed
bump CI
nategraf May 30, 2024
be09e86
bump
nategraf May 30, 2024
fdb1e4f
bump cargo-risczero-install action
nategraf May 31, 2024
296c9d9
update risc0-ethereum refs to the v1.0.0-rc.6 tag
nategraf May 31, 2024
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
41 changes: 41 additions & 0 deletions .github/actions/cargo-risczero-install/action.yaml
nategraf marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: cargo risczero install
description: Install cargo risczero, build toolchains, and r0vm.

inputs:
ref:
description: 'Git reference to pull from risc0/risc0 and build'
required: true
type: string
toolchain-version:
description: 'Version of the RISC Zero toolchains to install'
required: true
features:
description: 'Comma separated list of feature flags to set when building cargo risczero'
required: false
default: 'default'
type: string

runs:
using: composite
steps:
- name: checkout risc0
uses: actions/checkout@v4
with:
repository: 'risc0/risc0'
path: 'tmp/risc0'
ref: ${{ inputs.ref }}
lfs: true
- name: install cargo-risczero
run: cargo install --path risc0/cargo-risczero --no-default-features --features "${{ inputs.features }}"
working-directory: tmp/risc0
shell: bash
- name: install r0vm
run: cargo install --bin r0vm --path risc0/cargo-risczero --features "${{ inputs.features }}"
shell: bash
working-directory: tmp/risc0
- name: install toolchains
run: cargo risczero install --version ${{ inputs.toolchain-version }}
shell: bash
- name: cleanup
run: rm -rf tmp
shell: bash
59 changes: 30 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ concurrency:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUST_BACKTRACE: "1"
RISC0_CRATE_VERSION: "^0.21"
RISC0_TOOLCHAIN_VERSION: v2024-02-08.1
RISC0_MONOREPO_REF: "main"
RISC0_TOOLCHAIN_VERSION: v2024-04-22.0
nategraf marked this conversation as resolved.
Show resolved Hide resolved

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature: [default]
nategraf marked this conversation as resolved.
Show resolved Hide resolved
steps:
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842
- name: checkout dummy commit (submodule bug workaround)
Expand All @@ -32,21 +36,17 @@ jobs:
submodules: recursive

- name: Install rust
uses: risc0/risc0/.github/actions/rustup@release-0.21
uses: risc0/risc0/.github/actions/rustup@main

- name: Install Foundry
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f

- name: Install cargo-install
uses: risc0/cargo-install@v1
with:
crate: cargo-binstall

- name: Cargo binstall cargo-risczero
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_CRATE_VERSION }}

- name: risczero toolchain install
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
uses: ./.github/actions/cargo-risczero-install
with:
ref: ${{ env.RISC0_MONOREPO_REF }}
toolchain-version: ${{ env.RISC0_TOOLCHAIN_VERSION }}
features: ${{ matrix.feature }}

- name: build rust guest
run: cargo build
Expand All @@ -62,9 +62,16 @@ jobs:
RISC0_DEV_MODE: true
run: forge test -vvv

bonsai-integration:
name: test bonsai integration
integration-test:
name: integration test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature: [default]
env:
FEATURE: ${{ matrix.feature }}
RUST_BACKTRACE: full
steps:
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842
- name: checkout dummy commit (submodule bug workaround)
Expand All @@ -74,34 +81,28 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install rust
uses: risc0/risc0/.github/actions/rustup@release-0.21
uses: risc0/risc0/.github/actions/rustup@main

- name: Install Foundry
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f

- name: Install cargo-install
uses: risc0/cargo-install@v1
with:
crate: cargo-binstall

- name: Cargo binstall cargo-risczero
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_CRATE_VERSION }}

- name: risczero toolchain install
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
uses: ./.github/actions/cargo-risczero-install
with:
ref: ${{ env.RISC0_MONOREPO_REF }}
toolchain-version: ${{ env.RISC0_TOOLCHAIN_VERSION }}
features: ${{ matrix.feature }}

- name: build rust guest
run: cargo build

- name: build solidity contracts
run: forge build

- name: run foundry tests with bonsai proving
- name: run foundry tests with local prover
env:
BONSAI_API_URL: ${{ secrets.BONSAI_API_URL }}
BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }}
RISC0_DEV_MODE: false
run: forge test -vvv

Expand All @@ -114,7 +115,7 @@ jobs:
submodules: recursive

- name: install rust
uses: risc0/risc0/.github/actions/rustup@release-0.21
uses: risc0/risc0/.github/actions/rustup@main

- name: install cargo-sort
uses: risc0/cargo-install@v1
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
[submodule "lib/risc0-ethereum"]
path = lib/risc0-ethereum
url = https://github.com/risc0/risc0-ethereum
branch = release-0.9
branch = capossele/refactor-zkvm-usage
nategraf marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading