From d307ac5e4bac2d4241aa4cf5fb6f2eebe4dd0ee5 Mon Sep 17 00:00:00 2001 From: Blazej Kolad Date: Wed, 27 Sep 2023 19:11:22 +0200 Subject: [PATCH] Run tests with prover enabled. (#932) * Remove demo-rollup dep from demo-prover * add methods to demo-rollup * fix cargo hack * fix cargo hack * Cargo.toml * install toolchain * install toolchain * modify workflow * update cargo.toml * rust.yaml * Add guest-mock * use real prover in bank tests * native * fix lint * update yaml * fic coverage * ELF in CI * update bench get_guest_options() * update build.rs * remove local from demo-rollup * fix lint * remove ide_setup * Remove riscv32im-risc0-zkvm-elf --- .github/workflows/rust.yml | 25 +- Cargo.lock | 1 + examples/demo-prover/README.md | 3 - examples/demo-prover/ide_setup.md | 26 - examples/demo-prover/methods/Cargo.toml | 2 +- examples/demo-prover/methods/build.rs | 11 +- .../{guest => guest-celestia}/Cargo.lock | 20 +- .../{guest => guest-celestia}/Cargo.toml | 5 +- .../src/bin/rollup.rs | 2 +- .../demo-prover/methods/guest-mock/Cargo.lock | 1262 +++++++++++++++++ .../demo-prover/methods/guest-mock/Cargo.toml | 33 + .../methods/guest-mock/src/bin/mock_da.rs | 20 + .../demo-prover/methods/guest/download_std.rs | 175 --- .../guest/riscv32im-risc0-zkvm-elf.json | 21 - examples/demo-rollup/Cargo.toml | 7 +- examples/demo-rollup/src/lib.rs | 2 - examples/demo-rollup/src/rollup.rs | 5 +- examples/demo-rollup/src/verifier.rs | 17 - examples/demo-rollup/tests/bank/mod.rs | 8 +- examples/demo-rollup/tests/evm/mod.rs | 16 +- examples/demo-rollup/tests/test_helpers.rs | 4 +- examples/demo-stf/Cargo.toml | 6 +- examples/demo-stf/src/lib.rs | 17 + full-node/sov-stf-runner/Cargo.toml | 2 +- rollup-interface/Cargo.toml | 2 +- .../src/state_machine/mocks/da.rs | 11 +- .../src/state_machine/mocks/mod.rs | 6 +- 27 files changed, 1404 insertions(+), 305 deletions(-) delete mode 100644 examples/demo-prover/ide_setup.md rename examples/demo-prover/methods/{guest => guest-celestia}/Cargo.lock (99%) rename examples/demo-prover/methods/{guest => guest-celestia}/Cargo.toml (80%) rename examples/demo-prover/methods/{guest => guest-celestia}/src/bin/rollup.rs (96%) create mode 100644 examples/demo-prover/methods/guest-mock/Cargo.lock create mode 100644 examples/demo-prover/methods/guest-mock/Cargo.toml create mode 100644 examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs delete mode 100644 examples/demo-prover/methods/guest/download_std.rs delete mode 100644 examples/demo-prover/methods/guest/riscv32im-risc0-zkvm-elf.json delete mode 100644 examples/demo-rollup/src/verifier.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 502ae161ea..1b90e7b04d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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: @@ -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" @@ -193,10 +200,9 @@ 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: @@ -204,6 +210,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 - name: add llvm component run: rustup component add llvm-tools-preview - name: cargo install cargo-llvm-cov @@ -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" diff --git a/Cargo.lock b/Cargo.lock index fa03da5946..2d13c986c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7307,6 +7307,7 @@ dependencies = [ "ethers-signers", "hex", "jsonrpsee", + "methods", "prettytable-rs", "prometheus 0.11.0", "proptest", diff --git a/examples/demo-prover/README.md b/examples/demo-prover/README.md index 861c11da3a..4609954565 100644 --- a/examples/demo-prover/README.md +++ b/examples/demo-prover/README.md @@ -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 diff --git a/examples/demo-prover/ide_setup.md b/examples/demo-prover/ide_setup.md deleted file mode 100644 index b22cbb4ae4..0000000000 --- a/examples/demo-prover/ide_setup.md +++ /dev/null @@ -1,26 +0,0 @@ -# Getting Started - -## Setting up your IDE - -To get Rust Analyzer (or other language plugins) to work with Risc0, you'll need to set up the risc0 stdlib binaries in your sysroot. - -0. `cd methods/guest`. All future instructions assume that you're at the root of the guest crate. -1. Use `download_std.rs` to fetch the modified std lib code. One easy way to run this code is to rename it to `build.rs` and then - `cargo build`. The downloaded code will be stored in a directory called "riscv-guest-shim", which should be placed in the - `methods/guest` directory. -2. Build `.rlib` binaries from the modified stdlib. To build the standard library, use the command below (replacing the path). - To minimize extraneous code, you may want to comment out the dependencies section of `Cargo.toml` and the body of - `rollup.rs` before continuing. - -``` -__CARGO_TESTS_ONLY_SRC_ROOT="/path/to/riscv-guest-shim/rust-std" cargo run -Zbuild-std=core,alloc,proc_macro,panic_abort,std -Zbuild-std-features=compiler-builtins-mem --test --release -``` - -The output of this build will be stored in `target/riscv32im-risc0-zkvm-elf/release/deps`. - -Identify the `SYSROOT` from your default rust compiler using the command `rustc --print sysyroot`. Make a new directory -`lib/rustlib/riscv32im-risc0-zkvm-elf/lib` under your sysroot, and copy all of the stdlib `*.rlib` files into it. Now, your -toolchain will recognize `riscv32im-risc0-zkvm-elf` as an installed target. - -If you encounter any problems, try re-running above `cargo run -Zbuildstd ...` command without the `--test` flag, copy any additional -`.rlib`s into the `sysroot/lib/rustlib/riscv32im-risc0-zkvm-elf/lib` directory. diff --git a/examples/demo-prover/methods/Cargo.toml b/examples/demo-prover/methods/Cargo.toml index 166071cadf..06e539cb18 100644 --- a/examples/demo-prover/methods/Cargo.toml +++ b/examples/demo-prover/methods/Cargo.toml @@ -10,7 +10,7 @@ publish = false risc0-build = { workspace = true } [package.metadata.risc0] -methods = ["guest"] +methods = ["guest-celestia", "guest-mock"] [features] bench = [] diff --git a/examples/demo-prover/methods/build.rs b/examples/demo-prover/methods/build.rs index 15d8003f1c..79be247d98 100644 --- a/examples/demo-prover/methods/build.rs +++ b/examples/demo-prover/methods/build.rs @@ -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); @@ -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()], }, diff --git a/examples/demo-prover/methods/guest/Cargo.lock b/examples/demo-prover/methods/guest-celestia/Cargo.lock similarity index 99% rename from examples/demo-prover/methods/guest/Cargo.lock rename to examples/demo-prover/methods/guest-celestia/Cargo.lock index 3bdff2f9a5..414c154a87 100644 --- a/examples/demo-prover/methods/guest/Cargo.lock +++ b/examples/demo-prover/methods/guest-celestia/Cargo.lock @@ -312,6 +312,7 @@ dependencies = [ "sov-rollup-interface", "sov-sequencer-registry", "sov-state", + "sov-stf-runner", "sov-value-setter", "tracing", ] @@ -1341,7 +1342,7 @@ dependencies = [ ] [[package]] -name = "sov-demo-prover-guest" +name = "sov-demo-prover-guest-celestia" version = "0.2.0" dependencies = [ "anyhow", @@ -1350,23 +1351,7 @@ dependencies = [ "risc0-zkvm", "risc0-zkvm-platform", "sov-celestia-adapter", - "sov-demo-rollup", - "sov-risc0-adapter", -] - -[[package]] -name = "sov-demo-rollup" -version = "0.2.0" -dependencies = [ - "const-rollup-config", - "demo-stf", - "sov-celestia-adapter", - "sov-modules-api", - "sov-modules-stf-template", "sov-risc0-adapter", - "sov-rollup-interface", - "sov-state", - "sov-stf-runner", ] [[package]] @@ -1500,7 +1485,6 @@ dependencies = [ "borsh", "hex", "serde", - "sov-celestia-adapter", "sov-modules-api", "sov-rollup-interface", "sov-state", diff --git a/examples/demo-prover/methods/guest/Cargo.toml b/examples/demo-prover/methods/guest-celestia/Cargo.toml similarity index 80% rename from examples/demo-prover/methods/guest/Cargo.toml rename to examples/demo-prover/methods/guest-celestia/Cargo.toml index c0945ff9c1..3927761c63 100644 --- a/examples/demo-prover/methods/guest/Cargo.toml +++ b/examples/demo-prover/methods/guest-celestia/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sov-demo-prover-guest" +name = "sov-demo-prover-guest-celestia" version = "0.2.0" edition = "2021" resolver = "2" @@ -10,8 +10,7 @@ resolver = "2" anyhow = "1.0.68" risc0-zkvm = { version = "0.18", default-features = false, features = ["std"] } risc0-zkvm-platform = "0.18" -demo-stf = { path = "../../../demo-stf", default-features = false } -sov-demo-rollup = { path = "../../../demo-rollup", default-features = false } +demo-stf = { path = "../../../demo-stf" } sov-risc0-adapter = { path = "../../../../adapters/risc0" } const-rollup-config = { path = "../../../const-rollup-config" } sov-celestia-adapter = { path = "../../../../adapters/celestia" } diff --git a/examples/demo-prover/methods/guest/src/bin/rollup.rs b/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs similarity index 96% rename from examples/demo-prover/methods/guest/src/bin/rollup.rs rename to examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs index 4d8c6f17a9..729d0d734e 100644 --- a/examples/demo-prover/methods/guest/src/bin/rollup.rs +++ b/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs @@ -6,7 +6,7 @@ use const_rollup_config::ROLLUP_NAMESPACE_RAW; use demo_stf::app::create_zk_app_template; use sov_celestia_adapter::types::NamespaceId; use sov_celestia_adapter::verifier::CelestiaVerifier; -use sov_demo_rollup::AppVerifier; +use demo_stf::AppVerifier; use sov_risc0_adapter::guest::Risc0Guest; // The rollup stores its data in the namespace b"sov-test" on Celestia diff --git a/examples/demo-prover/methods/guest-mock/Cargo.lock b/examples/demo-prover/methods/guest-mock/Cargo.lock new file mode 100644 index 0000000000..5e881876d6 --- /dev/null +++ b/examples/demo-prover/methods/guest-mock/Cargo.lock @@ -0,0 +1,1262 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bcs" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd3ffe8b19a604421a5d461d4a70346223e535903fbc3067138bddbebddcf77" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive", + "bytes", + "hashbrown", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "git+https://github.com/rust-lang/cc-rs?rev=e5bbdfa#e5bbdfa1fa468c028cb38fee6c35a3cf2e5a2736" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "const-rollup-config" +version = "0.2.0" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "demo-stf" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "hex", + "serde", + "sov-accounts", + "sov-bank", + "sov-blob-storage", + "sov-chain-state", + "sov-modules-api", + "sov-modules-stf-template", + "sov-nft-module", + "sov-rollup-interface", + "sov-sequencer-registry", + "sov-state", + "sov-stf-runner", + "sov-value-setter", + "tracing", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" + +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elf" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" + +[[package]] +name = "errno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "ics23" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442d4bab37956e76f739c864f246c825d87c0bb7f9afa65660c57833c91bf6d4" +dependencies = [ + "anyhow", + "bytes", + "hex", + "informalsystems-pbjson", + "prost", + "ripemd", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "informalsystems-pbjson" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eecd90f87bea412eac91c6ef94f6b1e390128290898cbe14f2b926787ae1fb" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jmt" +version = "0.7.0" +source = "git+https://github.com/penumbra-zone/jmt.git?rev=199ae1c185e74ee2133db773efacff56706085aa#199ae1c185e74ee2133db773efacff56706085aa" +dependencies = [ + "anyhow", + "borsh", + "digest", + "hashbrown", + "hex", + "ics23", + "itertools", + "mirai-annotations", + "num-derive 0.3.3", + "num-traits", + "serde", + "sha2", + "thiserror", + "tracing", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.148" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" + +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "risc0-binfmt" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede27631e6b2a946a43db812063453c9701d5d2544d82f9abec2cc12574ebb8e" +dependencies = [ + "anyhow", + "elf", + "log", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e00222152fdc94cacc9b6682b5c0cbe8138f1ee82e80c24a64d9ad2c6d7415" +dependencies = [ + "anyhow", + "log", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "tracing", +] + +[[package]] +name = "risc0-core" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08605aec93ea22ed83f7f81f42e2d7287a5b0c749d8671f94de9d5994020045c" +dependencies = [ + "bytemuck", + "rand_core", +] + +[[package]] +name = "risc0-zkp" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28166926bb177824939f4e91083198f9f3da8137aeac32361bd34548c0526fa5" +dependencies = [ + "anyhow", + "blake2", + "bytemuck", + "digest", + "hex", + "log", + "paste", + "rand_core", + "risc0-core", + "risc0-zkvm-platform", + "serde", + "sha2", + "tracing", +] + +[[package]] +name = "risc0-zkvm" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec972152bcaa1a2967e412e22a84f6e2984a95c701bcc7943ca8ca10126ee0a2" +dependencies = [ + "anyhow", + "bytemuck", + "cfg-if", + "getrandom", + "hex", + "libm", + "log", + "num-derive 0.4.0", + "num-traits", + "risc0-binfmt", + "risc0-circuit-rv32im", + "risc0-core", + "risc0-zkp", + "risc0-zkvm-platform", + "serde", + "tempfile", + "tracing", +] + +[[package]] +name = "risc0-zkvm-platform" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8524b46783b58b00e9b2a4712e837093c975b23cf25bfaf99e1cf69e9011bf6b" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schemars" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "git+https://github.com/risc0/RustCrypto-hashes?tag=sha2/v0.10.6-risc0#e75cafd9f55da196061f6fadf8bc8a86778192b7" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" + +[[package]] +name = "sov-accounts" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "sov-modules-api", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-bank" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-blob-storage" +version = "0.2.0" +dependencies = [ + "anyhow", + "bincode", + "borsh", + "hex", + "sov-chain-state", + "sov-modules-api", + "sov-sequencer-registry", + "sov-state", + "tracing", +] + +[[package]] +name = "sov-chain-state" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "serde", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", +] + +[[package]] +name = "sov-demo-prover-guest-mock" +version = "0.2.0" +dependencies = [ + "anyhow", + "const-rollup-config", + "demo-stf", + "risc0-zkvm", + "risc0-zkvm-platform", + "sov-risc0-adapter", + "sov-rollup-interface", +] + +[[package]] +name = "sov-first-read-last-write-cache" +version = "0.2.0" +dependencies = [ + "thiserror", +] + +[[package]] +name = "sov-modules-api" +version = "0.2.0" +dependencies = [ + "anyhow", + "bech32", + "borsh", + "derive_more", + "ed25519-dalek", + "jmt", + "serde", + "sha2", + "sov-first-read-last-write-cache", + "sov-modules-macros", + "sov-rollup-interface", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-modules-macros" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "proc-macro2", + "quote", + "schemars", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "sov-modules-stf-template" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "hex", + "jmt", + "serde", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", + "thiserror", + "tracing", +] + +[[package]] +name = "sov-nft-module" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "sov-modules-api", + "sov-modules-macros", + "sov-state", +] + +[[package]] +name = "sov-risc0-adapter" +version = "0.2.0" +dependencies = [ + "anyhow", + "bincode", + "bytemuck", + "risc0-zkvm", + "risc0-zkvm-platform", + "serde", + "sov-rollup-interface", + "sov-zk-cycle-utils", +] + +[[package]] +name = "sov-rollup-interface" +version = "0.2.0" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "borsh", + "bytes", + "digest", + "hex", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "sov-sequencer-registry" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "sov-bank", + "sov-modules-api", + "sov-state", +] + +[[package]] +name = "sov-state" +version = "0.2.0" +dependencies = [ + "anyhow", + "bcs", + "borsh", + "hex", + "jmt", + "serde", + "serde_json", + "sha2", + "sov-first-read-last-write-cache", + "sov-rollup-interface", + "thiserror", +] + +[[package]] +name = "sov-stf-runner" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "hex", + "serde", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", +] + +[[package]] +name = "sov-value-setter" +version = "0.2.0" +dependencies = [ + "anyhow", + "borsh", + "sov-modules-api", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-zk-cycle-utils" +version = "0.2.0" +dependencies = [ + "risc0-zkvm", + "risc0-zkvm-platform", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/examples/demo-prover/methods/guest-mock/Cargo.toml b/examples/demo-prover/methods/guest-mock/Cargo.toml new file mode 100644 index 0000000000..3daff6a756 --- /dev/null +++ b/examples/demo-prover/methods/guest-mock/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "sov-demo-prover-guest-mock" +version = "0.2.0" +edition = "2021" +resolver = "2" + +[workspace] + +[dependencies] +anyhow = "1.0.68" +risc0-zkvm = { version = "0.18", default-features = false, features = ["std"] } +risc0-zkvm-platform = "0.18" +sov-rollup-interface = { path = "../../../../rollup-interface", features = ["mocks"] } +demo-stf = { path = "../../../demo-stf" } +sov-risc0-adapter = { path = "../../../../adapters/risc0" } +const-rollup-config = { path = "../../../const-rollup-config" } + +[patch.crates-io] +sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2/v0.10.6-risc0" } + +[profile.dev] +opt-level = 3 + +[profile.dev.build-override] +opt-level = 3 + +[profile.release] +debug = 1 +lto = true + +[profile.release.build-override] +opt-level = 3 + diff --git a/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs b/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs new file mode 100644 index 0000000000..dc24324a0c --- /dev/null +++ b/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs @@ -0,0 +1,20 @@ +#![no_main] + +use demo_stf::app::create_zk_app_template; +use demo_stf::AppVerifier; +use sov_risc0_adapter::guest::Risc0Guest; + +use sov_rollup_interface::mocks::MockDaVerifier; + +risc0_zkvm::guest::entry!(main); + +pub fn main() { + let guest = Risc0Guest::new(); + + let mut stf_verifier = + AppVerifier::new(create_zk_app_template::(), MockDaVerifier {}); + + stf_verifier + .run_block(guest) + .expect("Prover must be honest"); +} diff --git a/examples/demo-prover/methods/guest/download_std.rs b/examples/demo-prover/methods/guest/download_std.rs deleted file mode 100644 index d6aba603b1..0000000000 --- a/examples/demo-prover/methods/guest/download_std.rs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2023 RISC Zero, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use std::{ - default::Default, - fs::{self, File}, - path::{Path, PathBuf}, -}; - -use downloader::{Download, Downloader}; -// use sha2::{Digest as ShaDigest, Sha256}; -use tempfile::tempdir_in; -use zip::ZipArchive; - -#[derive(Debug)] -struct ZipMapEntry { - filename: &'static str, - zip_url: &'static str, - src_prefix: &'static str, - dst_prefix: &'static str, -} - -// Sources for standard library, and where they should be mapped to. -const RUST_LIB_MAP : &[ZipMapEntry] = &[ - ZipMapEntry { - filename: "53bbc8fc2afb2e10e3a90d7bf188bfd6598374ab.zip", - zip_url: "https://github.com/risc0/rust/archive/53bbc8fc2afb2e10e3a90d7bf188bfd6598374ab.zip", - src_prefix: "rust-53bbc8fc2afb2e10e3a90d7bf188bfd6598374ab/library", - dst_prefix: "library" - }, - ZipMapEntry { - filename: "790411f93c4b5eada3c23abb4c9a063fb0b24d99.zip", - zip_url: "https://github.com/rust-lang/stdarch/archive/790411f93c4b5eada3c23abb4c9a063fb0b24d99.zip", - src_prefix:"stdarch-790411f93c4b5eada3c23abb4c9a063fb0b24d99", - dst_prefix: "library/stdarch" - }, - ZipMapEntry { - filename: "07872f28cd8a65c3c7428811548dc85f1f2fb05b.zip", - zip_url: "https://github.com/rust-lang/backtrace-rs/archive/07872f28cd8a65c3c7428811548dc85f1f2fb05b.zip", - src_prefix:"backtrace-rs-07872f28cd8a65c3c7428811548dc85f1f2fb05b", - dst_prefix: "library/backtrace" - }, -]; - -fn setup_guest_build_env

(out_dir: P) -where - P: AsRef, -{ - // Rust standard library. If any of the RUST_LIB_MAP changed, we - // want to have a different hash so that we make sure we recompile. - // let (_, _) = sha_digest_with_hex(format!("{:?}", RUST_LIB_MAP).as_bytes()); - // TODO: This breaks change detection for the std source. Fix it - let rust_lib_path = out_dir.as_ref().join("rust-std"); - if !rust_lib_path.exists() { - println!( - "Standard library {} does not exist; downloading", - rust_lib_path.display() - ); - - download_zip_map(RUST_LIB_MAP, &rust_lib_path); - } -} - -fn risc0_cache() -> PathBuf { - directories::ProjectDirs::from("com.risczero", "RISC Zero", "risc0") - .unwrap() - .cache_dir() - .into() -} - -fn download_zip_map

(zip_map: &[ZipMapEntry], dest_base: P) -where - P: AsRef, -{ - let cache_dir = risc0_cache(); - if !cache_dir.is_dir() { - fs::create_dir_all(&cache_dir).unwrap(); - } - - let temp_dir = tempdir_in(&cache_dir).unwrap(); - let mut downloader = Downloader::builder() - .download_folder(temp_dir.path()) - .build() - .unwrap(); - - let tmp_dest_base = dest_base.as_ref().with_extension("downloadtmp"); - if tmp_dest_base.exists() { - fs::remove_dir_all(&tmp_dest_base).unwrap(); - } - - for zm in zip_map.iter() { - let src_prefix = Path::new(&zm.src_prefix); - let dst_prefix = tmp_dest_base.join(&zm.dst_prefix); - fs::create_dir_all(&dst_prefix).unwrap(); - - let zip_path = cache_dir.join(zm.filename); - if !zip_path.is_file() { - println!( - "Downloading {}, mapping {} to {}", - zm.zip_url, - zm.src_prefix, - dst_prefix.display() - ); - let dl = Download::new(zm.zip_url); - downloader.download(&[dl]).unwrap().iter().for_each(|x| { - let summary = x.as_ref().unwrap(); - println!("Downloaded: {}", summary.file_name.display()); - }); - fs::rename(temp_dir.path().join(zm.filename), &zip_path).unwrap(); - } - - let zip_file = File::open(zip_path).unwrap(); - let mut zip = ZipArchive::new(zip_file).unwrap(); - println!("Got zip with {} files", zip.len()); - - let mut nwrote: u32 = 0; - for i in 0..zip.len() { - let mut f = zip.by_index(i).unwrap(); - let name = f.enclosed_name().unwrap(); - if let Ok(relative_src) = name.strip_prefix(src_prefix) { - let dest_name = dst_prefix.join(relative_src); - if f.is_dir() { - fs::create_dir_all(dest_name).unwrap(); - continue; - } - if !f.is_file() { - continue; - } - std::io::copy(&mut f, &mut File::create(&dest_name).unwrap()).unwrap(); - nwrote += 1; - } - } - println!("Wrote {} files", nwrote); - } - fs::rename(&tmp_dest_base, dest_base.as_ref()).unwrap(); -} - -/// Options defining how to embed a guest package in -/// [`embed_methods_with_options`]. -pub struct GuestOptions { - /// Features for cargo to build the guest with. - pub features: Vec, - - /// Enable standard library support - pub std: bool, -} - -impl Default for GuestOptions { - fn default() -> Self { - GuestOptions { - features: vec![], - std: true, - } - } -} - -/// Embeds methods built for RISC-V for use by host-side dependencies. -/// Specify custom options for a guest package by defining its [GuestOptions]. -/// See [embed_methods]. -fn main() { - let guest_dir = Path::new("riscv-guest-shim"); - - setup_guest_build_env(&guest_dir); -} diff --git a/examples/demo-prover/methods/guest/riscv32im-risc0-zkvm-elf.json b/examples/demo-prover/methods/guest/riscv32im-risc0-zkvm-elf.json deleted file mode 100644 index d97ac0febc..0000000000 --- a/examples/demo-prover/methods/guest/riscv32im-risc0-zkvm-elf.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "arch": "riscv32", - "cpu": "generic-rv32", - "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", - "eh-frame-header": false, - "emit-debug-gdb-scripts": false, - "executables": true, - "features": "+m", - "is-builtin": false, - "linker": "rust-lld", - "linker-flavor": "ld.lld", - "link-script": "OUTPUT_FORMAT(\"elf32-littleriscv\", \"elf32-littleriscv\", \"elf32-littleriscv\")\nOUTPUT_ARCH(riscv)\nENTRY(_start)\nEXTERN(__start)\n\n/* Must match risc0/zkvm/platform/src/memory.rs */\nMEMORY {\n stack : ORIGIN = 0x00000400, LENGTH = 8M - 1K\n data (RW) : ORIGIN = 0x00080000, LENGTH = 24M\n heap : ORIGIN = 0x02000000, LENGTH = 80M\n prog (X) : ORIGIN = 0x07000000, LENGTH = 80M\n}\n\nSECTIONS {\n .text : {\n *(.text._start)\n *(.text.__start)\n *(.text*)\n *(.rodata*)\n *(.srodata*)\n } >prog\n\n .data : {\n *(.data .data.*)\n *(.gnu.linkonce.d.*)\n __global_pointer$ = . + 0x800;\n *(.sdata .sdata.* .sdata2.*)\n *(.gnu.linkonce.s.*)\n } >data\n\n . = ALIGN(4);\n\n .bss (NOLOAD) : {\n __bss_begin = .;\n *(.sbss*)\n *(.gnu.linkonce.sb.*)\n *(.bss .bss.*)\n *(.gnu.linkonce.b.*)\n *(COMMON)\n . = ALIGN(4);\n __bss_end = .;\n } >data\n\n __bss_size = __bss_end - __bss_begin;\n\n __heap_start = ORIGIN(heap);\n __heap_end = __heap_start + LENGTH(heap);\n __heap_size = LENGTH(heap);\n\n __stack_init$ = ORIGIN(stack) + LENGTH(stack) - 4;\n\n /DISCARD/ : {\n *(.rel*)\n *(.comment)\n *(.eh_frame)\n *(.riscv.attributes)\n }\n}", - "llvm-target": "riscv32", - "max-atomic-width": 32, - "os": "zkvm", - "panic-strategy": "abort", - "relocation-model": "static", - "singlethread": true, - "target-pointer-width": "32", - "vendor": "risc0" -} diff --git a/examples/demo-rollup/Cargo.toml b/examples/demo-rollup/Cargo.toml index 2c3a0a2c25..2814df35ec 100644 --- a/examples/demo-rollup/Cargo.toml +++ b/examples/demo-rollup/Cargo.toml @@ -20,7 +20,7 @@ sov-rollup-interface = { path = "../../rollup-interface" } sov-modules-stf-template = { path = "../../module-system/sov-modules-stf-template" } sov-modules-api = { path = "../../module-system/sov-modules-api" } demo-stf = { path = "../demo-stf" } - +methods = { path = "../demo-prover/methods" } async-trait = { workspace = true, optional = true } anyhow = { workspace = true, optional = true } borsh = { workspace = true, features = ["bytes"], optional = true } @@ -73,13 +73,12 @@ revm = { workspace = true } [features] default = ["native"] # Deviate from convention by making the "native" feature active by default. This aligns with how this package is meant to be used (as a binary first, library second). -experimental = ["sov-ethereum/experimental", "reth-primitives", "secp256k1", "demo-stf/experimental", "local"] +experimental = ["default", "sov-ethereum/experimental", "reth-primitives", "secp256k1", "demo-stf/experimental", "sov-ethereum/local"] native = ["anyhow", "jsonrpsee", "serde", "serde_json", "tracing", "tokio", "tracing-subscriber", "demo-stf/native", "sov-modules-stf-template/native", "sov-risc0-adapter/native", "sov-modules-api/native", "sov-state/native", "sov-cli", "clap", "sov-celestia-adapter/native", "sov-db", "sov-sequencer", "sov-stf-runner/native", - "sov-modules-api/native"] + "sov-modules-api/native", "sov-rollup-interface/native"] bench = ["native", "async-trait", "borsh", "hex"] -local = ["sov-ethereum/local"] offchain = ["demo-stf/offchain"] [[bench]] diff --git a/examples/demo-rollup/src/lib.rs b/examples/demo-rollup/src/lib.rs index 68d2030bcc..e25d878f5c 100644 --- a/examples/demo-rollup/src/lib.rs +++ b/examples/demo-rollup/src/lib.rs @@ -6,7 +6,6 @@ pub mod register_rpc; #[cfg(feature = "native")] mod rollup; -mod verifier; use const_rollup_config::ROLLUP_NAMESPACE_RAW; #[cfg(feature = "native")] pub use rollup::{ @@ -16,7 +15,6 @@ pub use rollup::{ use sov_celestia_adapter::types::NamespaceId; #[cfg(feature = "native")] use sov_db::ledger_db::LedgerDB; -pub use verifier::AppVerifier; /// The rollup stores its data in the namespace b"sov-test" on Celestia /// You can change this constant to point your rollup at a different namespace diff --git a/examples/demo-rollup/src/rollup.rs b/examples/demo-rollup/src/rollup.rs index 48032cbd1d..cdaec16b6a 100644 --- a/examples/demo-rollup/src/rollup.rs +++ b/examples/demo-rollup/src/rollup.rs @@ -8,6 +8,7 @@ use demo_stf::app::DefaultPrivateKey; use demo_stf::app::{create_zk_app_template, App, DefaultContext}; use demo_stf::genesis_config::get_genesis_config; use demo_stf::runtime::{get_rpc_methods, GenesisConfig, Runtime}; +use demo_stf::AppVerifier; #[cfg(feature = "experimental")] use secp256k1::SecretKey; use sov_celestia_adapter::verifier::address::CelestiaAddress; @@ -32,7 +33,7 @@ use tracing::debug; #[cfg(feature = "experimental")] use crate::register_rpc::register_ethereum; use crate::register_rpc::{register_ledger, register_sequencer}; -use crate::{initialize_ledger, AppVerifier, ROLLUP_NAMESPACE}; +use crate::{initialize_ledger, ROLLUP_NAMESPACE}; #[cfg(feature = "experimental")] const TX_SIGNER_PRIV_KEY_PATH: &str = "../test-data/keys/tx_signer_private_key.json"; @@ -136,7 +137,6 @@ pub async fn new_rollup_with_celestia_da( eth_rpc_config: EthRpcConfig { min_blob_size: Some(1), sov_tx_signer_priv_key: read_sov_tx_signer_priv_key()?, - #[cfg(feature = "local")] eth_signer, }, prover, @@ -185,7 +185,6 @@ pub fn new_rollup_with_mock_da_from_config( eth_rpc_config: EthRpcConfig { min_blob_size: Some(1), sov_tx_signer_priv_key: read_sov_tx_signer_priv_key()?, - #[cfg(feature = "local")] eth_signer, }, prover, diff --git a/examples/demo-rollup/src/verifier.rs b/examples/demo-rollup/src/verifier.rs deleted file mode 100644 index bdd769e5b2..0000000000 --- a/examples/demo-rollup/src/verifier.rs +++ /dev/null @@ -1,17 +0,0 @@ -use demo_stf::runtime::Runtime; -use sov_modules_api::default_context::ZkDefaultContext; -use sov_modules_stf_template::AppTemplate; -use sov_rollup_interface::da::DaVerifier; -use sov_stf_runner::verifier::StateTransitionVerifier; - -/// A verifier for the demo rollup -pub type AppVerifier = StateTransitionVerifier< - AppTemplate< - ZkDefaultContext, - ::Spec, - Zk, - Runtime::Spec>, - >, - DA, - Zk, ->; diff --git a/examples/demo-rollup/tests/bank/mod.rs b/examples/demo-rollup/tests/bank/mod.rs index 4c381f2ae9..8db0f08e55 100644 --- a/examples/demo-rollup/tests/bank/mod.rs +++ b/examples/demo-rollup/tests/bank/mod.rs @@ -5,6 +5,8 @@ use demo_stf::app::DefaultPrivateKey; use demo_stf::runtime::RuntimeCall; use jsonrpsee::core::client::{Subscription, SubscriptionClientT}; use jsonrpsee::rpc_params; +use methods::MOCK_DA_ELF; +use sov_demo_rollup::DemoProverConfig; use sov_modules_api::default_context::DefaultContext; use sov_modules_api::transaction::Transaction; use sov_modules_api::{PrivateKey, Spec}; @@ -68,11 +70,11 @@ async fn send_test_create_token_tx(rpc_address: SocketAddr) -> Result<(), anyhow async fn bank_tx_tests() -> Result<(), anyhow::Error> { let (port_tx, port_rx) = tokio::sync::oneshot::channel(); - // Use a dummy `elf` file, since the prover doesn't currently use it in native execution - let prover = Risc0Host::new(&[]); + let prover = Risc0Host::new(MOCK_DA_ELF); + let config = DemoProverConfig::Execute; let rollup_task = tokio::spawn(async { - start_rollup(port_tx, Some(prover)).await; + start_rollup(port_tx, Some((prover, config))).await; }); // Wait for rollup task to start: diff --git a/examples/demo-rollup/tests/evm/mod.rs b/examples/demo-rollup/tests/evm/mod.rs index 932a5f24ad..cc867c47ae 100644 --- a/examples/demo-rollup/tests/evm/mod.rs +++ b/examples/demo-rollup/tests/evm/mod.rs @@ -205,7 +205,6 @@ impl TestClient { Ok(ethereum_types::U256::from(resp_array)) } - #[cfg(feature = "local")] async fn eth_accounts(&self) -> Vec

{ self.http_client .request("eth_accounts", rpc_params![]) @@ -213,7 +212,6 @@ impl TestClient { .unwrap() } - #[cfg(feature = "local")] async fn eth_send_transaction(&self, tx: TypedTransaction) -> PendingTransaction<'_, Http> { self.client .provider() @@ -303,10 +301,8 @@ impl TestClient { set_value_req.await.unwrap().unwrap().transaction_hash }; - { - let get_arg = self.query_contract(contract_address).await?; - assert_eq!(set_arg, get_arg.as_u32()); - } + let get_arg = self.query_contract(contract_address).await?; + assert_eq!(set_arg, get_arg.as_u32()); // Check that the second block has published // None should return the latest block @@ -343,7 +339,6 @@ impl TestClient { assert_eq!(102, get_arg.as_u32()); } - #[cfg(feature = "local")] { let value = 103; @@ -378,11 +373,8 @@ async fn send_tx_test_to_eth(rpc_address: SocketAddr) -> Result<(), Box( rpc_reporting_channel: oneshot::Sender, - prover: Option, + prover: Option<(Vm, DemoProverConfig)>, ) { let temp_dir = tempfile::tempdir().unwrap(); let temp_path = temp_dir.path(); @@ -26,7 +26,7 @@ pub async fn start_rollup( }, da: MockDaConfig {}, }; - let prover = prover.map(|vm| (vm, DemoProverConfig::Simulate)); + let rollup = new_rollup_with_mock_da_from_config(rollup_config, prover).expect("Rollup config is valid"); rollup diff --git a/examples/demo-stf/Cargo.toml b/examples/demo-stf/Cargo.toml index 2d888f2226..28a93152ed 100644 --- a/examples/demo-stf/Cargo.toml +++ b/examples/demo-stf/Cargo.toml @@ -22,6 +22,8 @@ tokio = { workspace = true, optional = true } hex = { workspace = true } tracing = { workspace = true } + +sov-stf-runner = { path = "../../full-node/sov-stf-runner" } sov-rollup-interface = { path = "../../rollup-interface" } sov-cli = { path = "../../module-system/sov-cli", optional = true } sov-sequencer-registry = { path = "../../module-system/module-implementations/sov-sequencer-registry" } @@ -36,7 +38,6 @@ sov-accounts = { path = "../../module-system/module-implementations/sov-accounts sov-state = { path = "../../module-system/sov-state" } sov-modules-api = { path = "../../module-system/sov-modules-api" } sov-sequencer = { path = "../../full-node/sov-sequencer", optional = true } -sov-stf-runner = { path = "../../full-node/sov-stf-runner", optional = true } # Only enable the evm on "experimental" feature sov-evm = { path = "../../module-system/module-implementations/sov-evm", optional = true } reth-primitives = { workspace = true, optional = true } @@ -53,6 +54,7 @@ default = [] offchain = ["sov-nft-module/offchain"] experimental = ["sov-evm/experimental", "reth-primitives"] native = [ + "sov-stf-runner/native", "sov-bank/native", "sov-nft-module/native", "sov-cli", @@ -63,9 +65,9 @@ native = [ "sov-value-setter/native", "sov-modules-api/native", "sov-rollup-interface/mocks", + "sov-rollup-interface/native", "sov-modules-stf-template/native", "sov-sequencer", - "sov-stf-runner/native", "clap", "serde_json", "jsonrpsee", diff --git a/examples/demo-stf/src/lib.rs b/examples/demo-stf/src/lib.rs index cc9131986f..c5a6402131 100644 --- a/examples/demo-stf/src/lib.rs +++ b/examples/demo-stf/src/lib.rs @@ -10,4 +10,21 @@ pub mod tests; #[cfg(feature = "native")] pub mod cli; +use runtime::Runtime; +use sov_modules_api::default_context::ZkDefaultContext; +use sov_modules_stf_template::AppTemplate; +use sov_rollup_interface::da::DaVerifier; pub use sov_state::ArrayWitness; +use sov_stf_runner::verifier::StateTransitionVerifier; + +/// A verifier for the demo rollup +pub type AppVerifier = StateTransitionVerifier< + AppTemplate< + ZkDefaultContext, + ::Spec, + Zk, + Runtime::Spec>, + >, + DA, + Zk, +>; diff --git a/full-node/sov-stf-runner/Cargo.toml b/full-node/sov-stf-runner/Cargo.toml index ef0d24cd41..dc4be096bb 100644 --- a/full-node/sov-stf-runner/Cargo.toml +++ b/full-node/sov-stf-runner/Cargo.toml @@ -26,9 +26,9 @@ sov-db = { path = "../db/sov-db", version = "0.2", optional = true } sov-rollup-interface = { path = "../../rollup-interface", version = "0.2" } sov-state = { path = "../../module-system/sov-state", version = "0.2" } sov-modules-api = { path = "../../module-system/sov-modules-api", version = "0.2" } -sov-celestia-adapter = { path = "../../adapters/celestia", version = "0.2" } [dev-dependencies] +sov-celestia-adapter = { path = "../../adapters/celestia", version = "0.2" } tempfile = { workspace = true } rand = { workspace = true } diff --git a/rollup-interface/Cargo.toml b/rollup-interface/Cargo.toml index 9dfc68798c..56161665e2 100644 --- a/rollup-interface/Cargo.toml +++ b/rollup-interface/Cargo.toml @@ -49,4 +49,4 @@ proptest-derive = { workspace = true } default = [] native = ["tokio"] fuzzing = ["proptest", "proptest-derive", "sha2"] -mocks = ["sha2", "bytes/serde", "tokio"] +mocks = ["sha2", "bytes/serde"] diff --git a/rollup-interface/src/state_machine/mocks/da.rs b/rollup-interface/src/state_machine/mocks/da.rs index 2ad670eaec..20c38d2eb7 100644 --- a/rollup-interface/src/state_machine/mocks/da.rs +++ b/rollup-interface/src/state_machine/mocks/da.rs @@ -1,6 +1,8 @@ use std::fmt::Display; +#[cfg(feature = "native")] use std::sync::Arc; +#[cfg(feature = "native")] use async_trait::async_trait; use borsh::{BorshDeserialize, BorshSerialize}; use bytes::Bytes; @@ -10,7 +12,9 @@ use crate::da::{ BlobReaderTrait, BlockHashTrait, BlockHeaderTrait, CountedBufReader, DaSpec, DaVerifier, Time, }; use crate::mocks::MockValidityCond; -use crate::services::da::{DaService, SlotData}; +#[cfg(feature = "native")] +use crate::services::da::DaService; +use crate::services::da::SlotData; use crate::{BasicAddress, RollupAddress}; const JAN_1_2023: i64 = 1672531200; @@ -269,9 +273,12 @@ impl DaSpec for MockDaSpec { type ChainParams = (); } +#[cfg(feature = "native")] use tokio::sync::mpsc::{self, Receiver, Sender}; +#[cfg(feature = "native")] use tokio::sync::Mutex; +#[cfg(feature = "native")] #[derive(Clone)] /// DaService used in tests. pub struct MockDaService { @@ -280,6 +287,7 @@ pub struct MockDaService { sequencer_da_address: MockAddress, } +#[cfg(feature = "native")] impl MockDaService { /// Creates a new MockDaService. pub fn new(sequencer_da_address: MockAddress) -> Self { @@ -292,6 +300,7 @@ impl MockDaService { } } +#[cfg(feature = "native")] #[async_trait] impl DaService for MockDaService { type Spec = MockDaSpec; diff --git a/rollup-interface/src/state_machine/mocks/mod.rs b/rollup-interface/src/state_machine/mocks/mod.rs index 232a5626f2..a489035eac 100644 --- a/rollup-interface/src/state_machine/mocks/mod.rs +++ b/rollup-interface/src/state_machine/mocks/mod.rs @@ -4,9 +4,11 @@ mod da; mod validity_condition; mod zk_vm; +#[cfg(feature = "native")] +pub use da::MockDaService; pub use da::{ - MockAddress, MockBlob, MockBlock, MockBlockHeader, MockDaConfig, MockDaService, MockDaSpec, - MockDaVerifier, MockHash, + MockAddress, MockBlob, MockBlock, MockBlockHeader, MockDaConfig, MockDaSpec, MockDaVerifier, + MockHash, }; pub use validity_condition::{MockValidityCond, MockValidityCondChecker}; pub use zk_vm::{MockCodeCommitment, MockProof, MockZkvm};