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

Run tests with prover enabled. #932

Merged
merged 25 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 21 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,19 @@ jobs:
- name: cargo hack
run: make check-features
test:
name: test
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 60
env:
CI_SKIP_GUEST_BUILD: "1"
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- name: Install Rust
run: rustup show
# `cargo-nextest` is much faster than standard `cargo test`.
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -144,6 +147,10 @@ jobs:
- uses: rui314/setup-mold@v1
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
Expand Down Expand Up @@ -193,17 +200,20 @@ jobs:
echo "demo-rollup took too long to process transaction; exiting"
exit 1
coverage:
name: coverage
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 90
env:
CI_SKIP_GUEST_BUILD: "1"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: rui314/setup-mold@v1
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- name: add llvm component
run: rustup component add llvm-tools-preview
- name: cargo install cargo-llvm-cov
Expand Down Expand Up @@ -295,11 +305,18 @@ jobs:
run: git diff --exit-code
check-demo-rollup-bash-commands:
runs-on: ubuntu-latest
# `test` has already built dependencies, so we can share
# caches (the profile is `dev` in both cases).
needs: test
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/demo-prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ You'll need at least 96GiB of RAM to run this example on a x86_64 CPU. If you do
3. Make sure that there's no data from previous runs `rm -rf demo_data`
4. Execute `cargo run -- ../demo-rollup/rollup_config.toml`.

## Development

Follow our [IDE integration](./ide_setup.md) guide document.

## License

Expand Down
26 changes: 0 additions & 26 deletions examples/demo-prover/ide_setup.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/demo-prover/methods/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
risc0-build = { workspace = true }

[package.metadata.risc0]
methods = ["guest"]
methods = ["guest-celestia", "guest-mock"]

[features]
bench = []
11 changes: 8 additions & 3 deletions examples/demo-prover/methods/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ fn main() {
let out_dir = std::env::var_os("OUT_DIR").unwrap();
let out_dir = std::path::Path::new(&out_dir);
let methods_path = out_dir.join("methods.rs");
std::fs::write(methods_path, "pub const ROLLUP_ELF: &[u8] = &[];")
.expect("Failed to write mock rollup elf");

let elf = r#"
pub const ROLLUP_ELF: &[u8] = &[];
pub const MOCK_DA_ELF: &[u8] = &[];
"#;

std::fs::write(methods_path, elf).expect("Failed to write mock rollup elf");
} else {
let guest_pkg_to_options = get_guest_options();
risc0_build::embed_methods_with_options(guest_pkg_to_options);
Expand All @@ -23,7 +28,7 @@ fn get_guest_options() -> HashMap<&'static str, risc0_build::GuestOptions> {
fn get_guest_options() -> HashMap<&'static str, risc0_build::GuestOptions> {
let mut guest_pkg_to_options = HashMap::new();
guest_pkg_to_options.insert(
"sov-demo-prover-guest",
"sov-demo-prover-guest-celestia",
risc0_build::GuestOptions {
features: vec!["bench".to_string()],
},
Expand Down
Loading