Skip to content

Commit

Permalink
Refactor prover api (#106)
Browse files Browse the repository at this point in the history
* update zkvm usage

* update lib

* update risc0-ethereum

* improve local prover instructions

* update deps

* bump risc0-ethereum

* bump risc0-ethereum

* bump risc0-ethereum

* add deployment guide

* bump risc0-ethereum

* use local prover

* fix action

* use main branch

* use sccache

* add permissions

* use ubuntu

* Set submodule commits to match dependencies on risc0-ethereum (#109)

* remove dependency on murky

* update forge std and openzeppelin versions

* point risc0-ethereum submodule to release-1.0 branch

* switch cargo refs to main

* fix up build issues

* update notes in the README about proving with Groth16

* point to the pending release-1.0 branch

* move TxSender directly into publisher

* remove unused submodule

* use cargo-risczero-install action from risc0-ethereum and remove unused deps

* fix use of removed env var

* i see you, whitespace

* use pending version of cargo-risczero-install

* bump CI

* bump

* bump cargo-risczero-install action

* update risc0-ethereum refs to the v1.0.0-rc.6 tag

---------

Co-authored-by: Victor Graf <[email protected]>
  • Loading branch information
capossele and nategraf committed May 31, 2024
1 parent 53d849b commit 39b01a4
Show file tree
Hide file tree
Showing 21 changed files with 962 additions and 902 deletions.
43 changes: 15 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ 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: "v1.0.0-rc.6"

jobs:
test:
Expand All @@ -32,21 +31,15 @@ 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: risc0/risc0-ethereum/.github/actions/[email protected]
with:
ref: ${{ env.RISC0_MONOREPO_REF }}

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

bonsai-integration:
name: test bonsai integration
integration-test:
name: integration test
runs-on: ubuntu-latest
env:
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 @@ -76,32 +71,24 @@ 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: risc0/risc0-ethereum/.github/actions/[email protected]
with:
ref: ${{ env.RISC0_MONOREPO_REF }}

- 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 +101,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
8 changes: 1 addition & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/solidity-bytes-utils"]
path = lib/solidity-bytes-utils
url = https://github.com/GNSPS/solidity-bytes-utils
[submodule "lib/risc0-ethereum"]
path = lib/risc0-ethereum
url = https://github.com/risc0/risc0-ethereum
branch = release-0.9
branch = v1.0.0-rc.6
Loading

0 comments on commit 39b01a4

Please sign in to comment.