diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 085ac1848..0e6ebb265 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -71,6 +71,7 @@ jobs: # which should be required to pass before merging a PR, don't forget to # update this list! - check + - check_no_std - hack - nextest - test @@ -122,6 +123,23 @@ jobs: echo "Linting or formatting errors detected, please run 'make lint-fix' to fix it"; exit 1 fi + + check_no_std: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: thumbv6m-none-eabi + override: true + - uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/nightly' }} + - name: Run check + run: make check-no-std + # Check that every combination of features is working properly. hack: name: features diff --git a/Cargo.toml b/Cargo.toml index c3fc2d6bc..6f54f10f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,31 +61,31 @@ jmt = "0.8.0" # External dependencies async-trait = "0.1.71" -anyhow = "1.0.68" +anyhow = { version = "1.0.68", default-features = false } arbitrary = { version = "1.3.1", features = ["derive"] } -borsh = { version = "0.10.3", features = ["rc", "bytes"] } +borsh = { version = "0.10.3", default-features = false } # TODO: Consider replacing this serialization format # https://github.com/Sovereign-Labs/sovereign-sdk/issues/283 bincode = "1.3.3" bcs = "0.1.5" -byteorder = "1.5.0" -bytes = "1.2.1" +byteorder = { version = "1.5.0", default-features = false } +bytes = { version = "1.2.1", default-features = false } +digest = { version = "0.10.6", default-features = false, features = ["alloc"] } futures = "0.3" -hex = "0.4.3" -once_cell = "1.10.0" +hex = { version = "0.4.3", default-features = false, features = ["alloc", "serde"] } +once_cell = { version = "1.10.0", default-features = false, features = ["alloc"] } prometheus = { version = "0.13.3", default-features = false } -proptest = "1.3.1" +proptest = { version = "1.3.1", default-features = false, features = ["alloc"] } proptest-derive = "0.3.0" rand = "0.8" rayon = "1.8.0" rocksdb = { version = "0.21.0", features = ["lz4"] } -serde = { version = "1.0.188", features = ["derive", "rc"] } -serde_json = { version = "1.0" } -sha2 = "0.10.6" -digest = "0.10.6" +serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"] } +serde_json = { version = "1.0", default-features = false, features = ["alloc"] } +sha2 = { version = "0.10.6", default-features = false } thiserror = "1.0.50" tiny-keccak = "2.0.2" -tracing = "0.1.40" +tracing = { version = "0.1.40", default-features = false } bech32 = "0.9.1" derive_more = "0.99.11" clap = { version = "4.4.5", features = ["derive"] } diff --git a/Makefile b/Makefile index cd154eced..d2f9c8b26 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +# no-std packages to be checked +NO_STD := "sov-rollup-interface" + .PHONY: help help: ## Display this help message @@ -23,6 +26,7 @@ install-dev-tools: ## Installs all necessary cargo helpers cargo install cargo-nextest --locked cargo install cargo-risczero cargo risczero install + rustup target add thumbv6m-none-eabi lint: ## cargo check and clippy. Skip clippy on guest code since it's not supported by risc0 ## fmt first, because it's the cheapest @@ -42,6 +46,18 @@ check-features: ## Checks that project compiles with all combinations of feature check-fuzz: ## Checks that fuzz member compiles $(MAKE) -C fuzz check +check-no-std: ## Checks that project compiles without std + @for package in $(NO_STD); do \ + echo "Checking no-std $${package}..."; \ + cargo check -p $$package \ + --target thumbv6m-none-eabi \ + --no-default-features ; \ + cargo check -p $$package \ + --target thumbv6m-none-eabi \ + --no-default-features \ + --features native ; \ + done + find-unused-deps: ## Prints unused dependencies for project. Note: requires nightly cargo udeps --all-targets --all-features diff --git a/examples/demo-rollup/provers/risc0/guest-celestia/Cargo.lock b/examples/demo-rollup/provers/risc0/guest-celestia/Cargo.lock index d3c882189..07b25135e 100644 --- a/examples/demo-rollup/provers/risc0/guest-celestia/Cargo.lock +++ b/examples/demo-rollup/provers/risc0/guest-celestia/Cargo.lock @@ -247,6 +247,21 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -822,6 +837,12 @@ dependencies = [ "paste", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "2.0.0" @@ -1393,6 +1414,8 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" dependencies = [ + "bit-set", + "bit-vec", "bitflags 2.4.0", "lazy_static", "num-traits", @@ -1400,6 +1423,8 @@ dependencies = [ "rand_chacha", "rand_xorshift", "regex-syntax", + "rusty-fork", + "tempfile", "unarray", ] @@ -1480,6 +1505,12 @@ dependencies = [ "prost 0.12.1", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.33" @@ -1747,6 +1778,18 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.15" @@ -2110,7 +2153,9 @@ dependencies = [ "bytes", "digest 0.10.7", "hex", + "proptest", "serde", + "sha2 0.10.8", "thiserror", ] @@ -2468,6 +2513,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/examples/demo-rollup/provers/risc0/guest-mock/Cargo.lock b/examples/demo-rollup/provers/risc0/guest-mock/Cargo.lock index 3f57b722f..c18d9b680 100644 --- a/examples/demo-rollup/provers/risc0/guest-mock/Cargo.lock +++ b/examples/demo-rollup/provers/risc0/guest-mock/Cargo.lock @@ -67,6 +67,21 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -367,6 +382,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "generic-array" version = "0.14.7" @@ -479,6 +500,12 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.148" @@ -538,6 +565,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -564,6 +592,12 @@ version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -582,6 +616,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.4.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "prost" version = "0.11.9" @@ -605,6 +659,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.33" @@ -614,11 +674,44 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] [[package]] name = "redox_syscall" @@ -629,6 +722,12 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "ripemd" version = "0.1.3" @@ -750,6 +849,18 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.15" @@ -1025,6 +1136,7 @@ dependencies = [ "bytes", "digest", "hex", + "proptest", "serde", "sha2", "thiserror", @@ -1198,6 +1310,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -1210,6 +1328,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/full-node/db/sov-db/Cargo.toml b/full-node/db/sov-db/Cargo.toml index 9b823b125..9f234d27c 100644 --- a/full-node/db/sov-db/Cargo.toml +++ b/full-node/db/sov-db/Cargo.toml @@ -17,16 +17,16 @@ resolver = "2" # Maintained by sovereign labs jmt = { workspace = true } sov-schema-db = { path = "../sov-schema-db", version = "0.3" } -sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3", features = ["native", "mocks"] } +sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3", features = ["native", "mocks", "tokio"] } # External -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } arbitrary = { workspace = true, optional = true } -byteorder = { workspace = true } -borsh = { workspace = true } -proptest = { workspace = true, optional = true } +byteorder = { workspace = true, default-features = true } +borsh = { workspace = true, default-features = true, features = ["bytes", "rc"] } +proptest = { workspace = true, optional = true, default-features = true } proptest-derive = { workspace = true, optional = true } -serde = { workspace = true, features = ["derive"] } +serde = { workspace = true, default-features = true, features = ["rc"] } tempfile = { workspace = true, optional = true } rocksdb = { workspace = true } bincode = { workspace = true } diff --git a/full-node/db/sov-schema-db/Cargo.toml b/full-node/db/sov-schema-db/Cargo.toml index a480672bc..9a8d0b936 100644 --- a/full-node/db/sov-schema-db/Cargo.toml +++ b/full-node/db/sov-schema-db/Cargo.toml @@ -14,17 +14,17 @@ readme = "README.md" [dependencies] # External dependencies -anyhow = { workspace = true } -once_cell = { workspace = true } +anyhow = { workspace = true, default-features = true } +once_cell = { workspace = true, default-features = true } prometheus = { workspace = true } -proptest = { workspace = true, optional = true } +proptest = { workspace = true, optional = true, default-features = true } proptest-derive = { workspace = true, optional = true } rocksdb = { workspace = true } -tracing = { workspace = true } +tracing = { workspace = true, default-features = true } thiserror = { workspace = true } [dev-dependencies] -byteorder = { workspace = true } +byteorder = { workspace = true, default-features = true } tempfile = { workspace = true } [features] diff --git a/module-system/sov-modules-api/Cargo.toml b/module-system/sov-modules-api/Cargo.toml index 35140ad34..ffbe11a61 100644 --- a/module-system/sov-modules-api/Cargo.toml +++ b/module-system/sov-modules-api/Cargo.toml @@ -51,6 +51,7 @@ arbitrary = [ "dep:arbitrary", "dep:proptest", "dep:proptest-derive", + "proptest/default", "sov-state/arbitrary", ] bench = ["sov-zk-cycle-macros", "risc0-zkvm", "risc0-zkvm-platform"] diff --git a/module-system/sov-state/Cargo.toml b/module-system/sov-state/Cargo.toml index 6e4874419..89596a8e3 100644 --- a/module-system/sov-state/Cargo.toml +++ b/module-system/sov-state/Cargo.toml @@ -14,11 +14,11 @@ resolver = "2" [dependencies] anyhow = { workspace = true } arbitrary = { workspace = true, optional = true } -borsh = { workspace = true } +borsh = { workspace = true, features = ["rc", "bytes"] } bcs = { workspace = true } proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } -serde = { workspace = true } +serde = { workspace = true, features = ["rc"] } serde_json = { workspace = true } thiserror = { workspace = true } sov-rollup-interface = { path = "../../rollup-interface", version = "0.3" } diff --git a/rollup-interface/Cargo.toml b/rollup-interface/Cargo.toml index 935243f06..14e4ff41f 100644 --- a/rollup-interface/Cargo.toml +++ b/rollup-interface/Cargo.toml @@ -15,38 +15,48 @@ exclude = [ ] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] +anyhow = { workspace = true, default-features = false } async-trait = { workspace = true } -borsh = { workspace = true, features = ["rc"] } -serde = { workspace = true } -bytes = { workspace = true } -hex = { workspace = true, features = ["serde"] } +borsh = { workspace = true } +bytes = { workspace = true, optional = true, default-features = true } digest = { workspace = true } +hex = { workspace = true } +serde = { workspace = true } sha2 = { workspace = true, optional = true } -thiserror = { workspace = true } +thiserror = { workspace = true, optional = true } +tokio = { workspace = true, optional = true } # TODO: Replace with serde-compatible borsh implementation when it becomes availabile # see https://github.com/Sovereign-Labs/sovereign-sdk/issues/215 -bincode = { workspace = true } - -anyhow = { workspace = true } +bincode = { workspace = true, optional = true } # Proptest should be a dev-dependency, but those can't be optional proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } -tokio = { workspace = true, optional = true} - [dev-dependencies] -serde_json = "1" +serde_json = { workspace = true } proptest = { workspace = true } proptest-derive = { workspace = true } [features] -default = [] -native = ["tokio"] -fuzzing = ["proptest", "proptest-derive", "sha2"] +default = ["std"] +native = [] +fuzzing = ["proptest", "proptest-derive", "sha2", "std"] mocks = ["sha2", "bytes/serde"] +std = [ + "anyhow/default", + "bincode", + "borsh/default", + "borsh/bytes", + "bytes", + "digest/default", + "hex/default", + "proptest?/default", + "serde/default", + "sha2?/default", + "thiserror" +] +tokio = ["dep:tokio", "std"] diff --git a/rollup-interface/src/lib.rs b/rollup-interface/src/lib.rs index 859337810..de096fd2c 100644 --- a/rollup-interface/src/lib.rs +++ b/rollup-interface/src/lib.rs @@ -2,12 +2,25 @@ //! It specifies the interfaces which allow the same "business logic" to run on different //! DA layers and be proven with different zkVMS, all while retaining compatibility //! with the same basic full node implementation. + +#![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] + +extern crate alloc; + mod state_machine; pub use state_machine::*; mod node; -pub use borsh::maybestd; pub use node::*; pub use {anyhow, digest}; + +/// A facade for the `std` crate. +pub mod maybestd { + // sync will be available only when the target supports atomic operations + #[cfg(target_has_atomic = "ptr")] + pub use alloc::sync; + + pub use borsh::maybestd::{borrow, boxed, collections, format, io, string, vec}; +} diff --git a/rollup-interface/src/node/rpc/mod.rs b/rollup-interface/src/node/rpc/mod.rs index a3cead72c..1a7a598e1 100644 --- a/rollup-interface/src/node/rpc/mod.rs +++ b/rollup-interface/src/node/rpc/mod.rs @@ -3,9 +3,8 @@ #[cfg(feature = "native")] use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; -#[cfg(feature = "native")] -use tokio::sync::broadcast::Receiver; +use crate::maybestd::vec::Vec; #[cfg(feature = "native")] use crate::stf::Event; use crate::stf::EventKey; @@ -143,7 +142,7 @@ pub struct SlotResponse { #[serde(with = "utils::rpc_hex")] pub hash: [u8; 32], /// The range of batches in this slot. - pub batch_range: std::ops::Range, + pub batch_range: core::ops::Range, /// The batches in this slot, if the [`QueryMode`] of the request is not `Compact` #[serde(skip_serializing_if = "Option::is_none")] pub batches: Option>>>, @@ -156,7 +155,7 @@ pub struct BatchResponse { #[serde(with = "utils::rpc_hex")] pub hash: [u8; 32], /// The range of transactions in this batch. - pub tx_range: std::ops::Range, + pub tx_range: core::ops::Range, /// The transactions in this batch, if the [`QueryMode`] of the request is not `Compact`. #[serde(skip_serializing_if = "Option::is_none")] pub txs: Option>>>, @@ -172,7 +171,7 @@ pub struct TxResponse { #[serde(with = "utils::rpc_hex")] pub hash: [u8; 32], /// The range of events occurring in this transaction. - pub event_range: std::ops::Range, + pub event_range: core::ops::Range, /// The transaction body, if stored by the rollup. #[serde(skip_serializing_if = "Option::is_none")] pub body: Option>, @@ -303,7 +302,8 @@ pub trait LedgerRpcProvider { ) -> Result>>, anyhow::Error>; /// Get a notification each time a slot is processed - fn subscribe_slots(&self) -> Result, anyhow::Error>; + #[cfg(feature = "tokio")] + fn subscribe_slots(&self) -> Result, anyhow::Error>; } /// JSON-RPC -related utilities. Occasionally useful but unimportant for most @@ -312,12 +312,15 @@ pub mod utils { /// Serialization and deserialization logic for `0x`-prefixed hex strings. pub mod rpc_hex { use core::fmt; - use std::marker::PhantomData; + use core::marker::PhantomData; use hex::{FromHex, ToHex}; use serde::de::{Error, Visitor}; use serde::{Deserializer, Serializer}; + use crate::maybestd::format; + use crate::maybestd::string::String; + /// Serializes `data` as hex string using lowercase characters and prefixing with '0x'. /// /// Lowercase characters are used (e.g. `f9b4ca`). The resulting string's length @@ -382,6 +385,9 @@ pub mod utils { mod rpc_hex_tests { use serde::{Deserialize, Serialize}; + use crate::maybestd::vec; + use crate::maybestd::vec::Vec; + #[derive(Serialize, Deserialize, PartialEq, Debug)] struct TestStruct { #[serde(with = "super::utils::rpc_hex")] diff --git a/rollup-interface/src/node/services/batch_builder.rs b/rollup-interface/src/node/services/batch_builder.rs index bc53b626b..90037aada 100644 --- a/rollup-interface/src/node/services/batch_builder.rs +++ b/rollup-interface/src/node/services/batch_builder.rs @@ -1,5 +1,7 @@ //! This module defines the trait that is used to build batches of transactions. +use crate::maybestd::vec::Vec; + /// BlockBuilder trait is responsible for managing mempool and building batches. pub trait BatchBuilder { /// Accept a new transaction. diff --git a/rollup-interface/src/node/services/da.rs b/rollup-interface/src/node/services/da.rs index 11897803e..29c9b9047 100644 --- a/rollup-interface/src/node/services/da.rs +++ b/rollup-interface/src/node/services/da.rs @@ -1,11 +1,13 @@ //! The da module defines traits used by the full node to interact with the DA layer. -use std::fmt::{self, Display}; +use core::fmt::{self, Display}; use async_trait::async_trait; use serde::de::DeserializeOwned; use serde::Serialize; use crate::da::{BlockHeaderTrait, DaSpec, DaVerifier}; +use crate::maybestd::boxed::Box; +use crate::maybestd::vec::Vec; use crate::zk::ValidityCondition; /// A DaService is the local side of an RPC connection talking to a node of the DA layer diff --git a/rollup-interface/src/state_machine/da.rs b/rollup-interface/src/state_machine/da.rs index 6153b06f0..cf85dd21b 100644 --- a/rollup-interface/src/state_machine/da.rs +++ b/rollup-interface/src/state_machine/da.rs @@ -1,13 +1,10 @@ //! Defines traits and types used by the rollup to verify claims about the //! DA layer. use core::fmt::Debug; -use std::cmp::min; use borsh::{BorshDeserialize, BorshSerialize}; -use bytes::Buf; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; -use thiserror::Error; use crate::zk::ValidityCondition; use crate::BasicAddress; @@ -70,12 +67,13 @@ pub trait DaVerifier { ) -> Result<::ValidityCondition, Self::Error>; } +#[cfg(feature = "std")] #[derive(Debug, Clone, Serialize, Deserialize, BorshDeserialize, BorshSerialize, PartialEq)] /// Simple structure that implements the Read trait for a buffer and counts the number of bytes read from the beginning. /// Useful for the partial blob reading optimization: we know for each blob how many bytes have been read from the beginning. /// /// Because of soundness issues we cannot implement the Buf trait because the prover could get unproved blob data using the chunk method. -pub struct CountedBufReader { +pub struct CountedBufReader { /// The original blob data. inner: B, @@ -84,7 +82,8 @@ pub struct CountedBufReader { accumulator: Vec, } -impl CountedBufReader { +#[cfg(feature = "std")] +impl CountedBufReader { /// Creates a new buffer reader with counter from an objet that implements the buffer trait pub fn new(inner: B) -> Self { let buf_size = inner.remaining(); @@ -104,7 +103,7 @@ impl CountedBufReader { } // `Buf::advance` would panic if `num_bytes` was greater than the length of the remaining unverified data, // but we just advance to the end of the buffer. - let num_to_read = min(remaining, requested); + let num_to_read = core::cmp::min(remaining, requested); // Extend the inner vector with zeros (copy_to_slice requires the vector to have // the correct *length* not just capacity) self.accumulator @@ -212,8 +211,12 @@ pub struct Time { nanos: u32, } -#[derive(Debug, Error)] -#[error("Only intervals less than one second may be represented as nanoseconds")] +#[derive(Debug)] +#[cfg_attr( + feature = "std", + derive(thiserror::Error), + error("Only intervals less than one second may be represented as nanoseconds") +)] /// An error that occurs when trying to create a `NanoSeconds` representing more than one second pub struct ErrTooManyNanos; diff --git a/rollup-interface/src/state_machine/mocks/da.rs b/rollup-interface/src/state_machine/mocks/da.rs index 5b27dc048..8cb006935 100644 --- a/rollup-interface/src/state_machine/mocks/da.rs +++ b/rollup-interface/src/state_machine/mocks/da.rs @@ -1,21 +1,11 @@ -use std::fmt::Display; -use std::str::FromStr; -#[cfg(feature = "native")] -use std::sync::Arc; +use core::fmt::Display; +use core::str::FromStr; -#[cfg(feature = "native")] -use async_trait::async_trait; use borsh::{BorshDeserialize, BorshSerialize}; -use bytes::Bytes; use serde::{Deserialize, Serialize}; -use crate::da::{ - BlobReaderTrait, BlockHashTrait, BlockHeaderTrait, CountedBufReader, DaSpec, DaVerifier, Time, -}; -use crate::mocks::MockValidityCond; -#[cfg(feature = "native")] -use crate::services::da::DaService; -use crate::services::da::SlotData; +use crate::da::{BlockHashTrait, BlockHeaderTrait, Time}; +use crate::maybestd::string::String; use crate::{BasicAddress, RollupAddress}; const JAN_1_2023: i64 = 1672531200; @@ -71,7 +61,7 @@ impl FromStr for MockAddress { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - let addr = hex::decode(s)?; + let addr = hex::decode(s).map_err(anyhow::Error::msg)?; if addr.len() != 32 { return Err(anyhow::anyhow!("Invalid address length")); } @@ -108,7 +98,7 @@ impl From<[u8; 32]> for MockAddress { } impl Display for MockAddress { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", hex::encode(self.addr)) } } @@ -116,60 +106,6 @@ impl Display for MockAddress { impl BasicAddress for MockAddress {} impl RollupAddress for MockAddress {} -#[derive( - Debug, - Clone, - PartialEq, - borsh::BorshDeserialize, - borsh::BorshSerialize, - serde::Serialize, - serde::Deserialize, -)] - -/// A mock BlobTransaction from a DA layer used for testing. -pub struct MockBlob { - address: MockAddress, - hash: [u8; 32], - data: CountedBufReader, -} - -impl BlobReaderTrait for MockBlob { - type Address = MockAddress; - - fn sender(&self) -> Self::Address { - self.address - } - - fn hash(&self) -> [u8; 32] { - self.hash - } - - fn verified_data(&self) -> &[u8] { - self.data.accumulator() - } - - fn total_len(&self) -> usize { - self.data.total_len() - } - - #[cfg(feature = "native")] - fn advance(&mut self, num_bytes: usize) -> &[u8] { - self.data.advance(num_bytes); - self.verified_data() - } -} - -impl MockBlob { - /// Creates a new mock blob with the given data, claiming to have been published by the provided address. - pub fn new(data: Vec, address: MockAddress, hash: [u8; 32]) -> Self { - Self { - address, - data: CountedBufReader::new(bytes::Bytes::from(data)), - hash, - } - } -} - /// A mock hash digest. #[derive( Clone, @@ -245,139 +181,10 @@ impl BlockHeaderTrait for MockBlockHeader { } } -/// A mock block type used for testing. -#[derive(Serialize, Deserialize, PartialEq, core::fmt::Debug, Clone)] -pub struct MockBlock { - /// The header of this block. - pub header: MockBlockHeader, - /// Validity condition - pub validity_cond: MockValidityCond, - /// Blobs - pub blobs: Vec, -} - -impl Default for MockBlock { - fn default() -> Self { - Self { - header: MockBlockHeader { - prev_hash: [0; 32].into(), - hash: [1; 32].into(), - height: 0, - }, - validity_cond: Default::default(), - blobs: Default::default(), - } - } -} - -impl SlotData for MockBlock { - type BlockHeader = MockBlockHeader; - type Cond = MockValidityCond; - - fn hash(&self) -> [u8; 32] { - self.header.hash.0 - } - - fn header(&self) -> &Self::BlockHeader { - &self.header - } - - fn validity_condition(&self) -> MockValidityCond { - self.validity_cond - } -} - -/// A [`DaSpec`] suitable for testing. +/// A [`crate::da::DaSpec`] suitable for testing. #[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Eq)] pub struct MockDaSpec; -impl DaSpec for MockDaSpec { - type SlotHash = MockHash; - type BlockHeader = MockBlockHeader; - type BlobTransaction = MockBlob; - type Address = MockAddress; - type ValidityCondition = MockValidityCond; - type InclusionMultiProof = [u8; 32]; - type CompletenessProof = (); - 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 { - sender: Sender>, - receiver: Arc>>>, - sequencer_da_address: MockAddress, -} - -#[cfg(feature = "native")] -impl MockDaService { - /// Creates a new MockDaService. - pub fn new(sequencer_da_address: MockAddress) -> Self { - let (sender, receiver) = mpsc::channel(100); - Self { - sender, - receiver: Arc::new(Mutex::new(receiver)), - sequencer_da_address, - } - } -} - -#[cfg(feature = "native")] -#[async_trait] -impl DaService for MockDaService { - type Spec = MockDaSpec; - type Verifier = MockDaVerifier; - type FilteredBlock = MockBlock; - type Error = anyhow::Error; - - async fn get_finalized_at(&self, _height: u64) -> Result { - let data = self.receiver.lock().await.recv().await; - let data = data.unwrap(); - let hash = [0; 32]; - - let blob = MockBlob::new(data, self.sequencer_da_address, hash); - - Ok(MockBlock { - blobs: vec![blob], - ..Default::default() - }) - } - - async fn get_block_at(&self, height: u64) -> Result { - self.get_finalized_at(height).await - } - - fn extract_relevant_blobs( - &self, - block: &Self::FilteredBlock, - ) -> Vec<::BlobTransaction> { - block.blobs.clone() - } - - async fn get_extraction_proof( - &self, - _block: &Self::FilteredBlock, - _blobs: &[::BlobTransaction], - ) -> ( - ::InclusionMultiProof, - ::CompletenessProof, - ) { - ([0u8; 32], ()) - } - - async fn send_transaction(&self, blob: &[u8]) -> Result<(), Self::Error> { - self.sender.send(blob.to_vec()).await.unwrap(); - Ok(()) - } -} - /// The configuration for mock da #[derive(Debug, Clone, PartialEq, serde::Deserialize, serde::Serialize)] pub struct MockDaConfig { @@ -389,29 +196,10 @@ pub struct MockDaConfig { /// DaVerifier used in tests. pub struct MockDaVerifier {} -impl DaVerifier for MockDaVerifier { - type Spec = MockDaSpec; - - type Error = anyhow::Error; - - fn new(_params: ::ChainParams) -> Self { - Self {} - } - - fn verify_relevant_tx_list( - &self, - _block_header: &::BlockHeader, - _txs: &[::BlobTransaction], - _inclusion_proof: ::InclusionMultiProof, - _completeness_proof: ::CompletenessProof, - ) -> Result<::ValidityCondition, Self::Error> { - Ok(Default::default()) - } -} - #[cfg(test)] mod tests { use super::*; + use crate::maybestd::string::ToString; #[test] fn test_mock_address_string() { diff --git a/rollup-interface/src/state_machine/mocks/mod.rs b/rollup-interface/src/state_machine/mocks/mod.rs index 3afbfd835..f463f3566 100644 --- a/rollup-interface/src/state_machine/mocks/mod.rs +++ b/rollup-interface/src/state_machine/mocks/mod.rs @@ -2,13 +2,19 @@ //! for testing, fuzzing, and benchmarking. mod da; +#[cfg(all(feature = "native", feature = "tokio"))] +mod service; +#[cfg(feature = "std")] +mod use_std; mod validity_condition; mod zk_vm; -#[cfg(feature = "native")] -pub use da::MockDaService; pub use da::{ - MockAddress, MockBlob, MockBlock, MockBlockHeader, MockDaConfig, MockDaSpec, MockDaVerifier, - MockHash, MOCK_SEQUENCER_DA_ADDRESS, + MockAddress, MockBlockHeader, MockDaConfig, MockDaSpec, MockDaVerifier, MockHash, + MOCK_SEQUENCER_DA_ADDRESS, }; +#[cfg(all(feature = "native", feature = "tokio"))] +pub use service::MockDaService; +#[cfg(feature = "std")] +pub use use_std::{MockBlob, MockBlock}; pub use validity_condition::{MockValidityCond, MockValidityCondChecker}; pub use zk_vm::{MockCodeCommitment, MockProof, MockZkvm}; diff --git a/rollup-interface/src/state_machine/mocks/service.rs b/rollup-interface/src/state_machine/mocks/service.rs new file mode 100644 index 000000000..31292cdd1 --- /dev/null +++ b/rollup-interface/src/state_machine/mocks/service.rs @@ -0,0 +1,76 @@ +use async_trait::async_trait; +use tokio::sync::mpsc::{self, Receiver, Sender}; +use tokio::sync::Mutex; + +use crate::da::DaSpec; +use crate::maybestd::sync::Arc; +use crate::mocks::{MockAddress, MockBlob, MockBlock, MockDaSpec, MockDaVerifier}; +use crate::services::da::DaService; + +#[derive(Clone)] +/// DaService used in tests. +pub struct MockDaService { + sender: Sender>, + receiver: Arc>>>, + sequencer_da_address: MockAddress, +} + +impl MockDaService { + /// Creates a new MockDaService. + pub fn new(sequencer_da_address: MockAddress) -> Self { + let (sender, receiver) = mpsc::channel(100); + Self { + sender, + receiver: Arc::new(Mutex::new(receiver)), + sequencer_da_address, + } + } +} + +#[async_trait] +impl DaService for MockDaService { + type Spec = MockDaSpec; + type Verifier = MockDaVerifier; + type FilteredBlock = MockBlock; + type Error = anyhow::Error; + + async fn get_finalized_at(&self, _height: u64) -> Result { + let data = self.receiver.lock().await.recv().await; + let data = data.unwrap(); + let hash = [0; 32]; + + let blob = MockBlob::new(data, self.sequencer_da_address, hash); + + Ok(MockBlock { + blobs: vec![blob], + ..Default::default() + }) + } + + async fn get_block_at(&self, height: u64) -> Result { + self.get_finalized_at(height).await + } + + fn extract_relevant_blobs( + &self, + block: &Self::FilteredBlock, + ) -> Vec<::BlobTransaction> { + block.blobs.clone() + } + + async fn get_extraction_proof( + &self, + _block: &Self::FilteredBlock, + _blobs: &[::BlobTransaction], + ) -> ( + ::InclusionMultiProof, + ::CompletenessProof, + ) { + ([0u8; 32], ()) + } + + async fn send_transaction(&self, blob: &[u8]) -> Result<(), Self::Error> { + self.sender.send(blob.to_vec()).await.unwrap(); + Ok(()) + } +} diff --git a/rollup-interface/src/state_machine/mocks/use_std.rs b/rollup-interface/src/state_machine/mocks/use_std.rs new file mode 100644 index 000000000..ad3f5a704 --- /dev/null +++ b/rollup-interface/src/state_machine/mocks/use_std.rs @@ -0,0 +1,134 @@ +use bytes::Bytes; +use serde::{Deserialize, Serialize}; + +use crate::da::{BlobReaderTrait, CountedBufReader, DaSpec, DaVerifier}; +use crate::mocks::{ + MockAddress, MockBlockHeader, MockDaSpec, MockDaVerifier, MockHash, MockValidityCond, +}; +use crate::services::da::SlotData; + +#[derive( + Debug, + Clone, + PartialEq, + borsh::BorshDeserialize, + borsh::BorshSerialize, + serde::Serialize, + serde::Deserialize, +)] +/// A mock BlobTransaction from a DA layer used for testing. +pub struct MockBlob { + address: MockAddress, + hash: [u8; 32], + data: CountedBufReader, +} + +impl MockBlob { + /// Creates a new mock blob with the given data, claiming to have been published by the provided address. + pub fn new(data: Vec, address: MockAddress, hash: [u8; 32]) -> Self { + Self { + address, + data: CountedBufReader::new(bytes::Bytes::from(data)), + hash, + } + } +} + +impl BlobReaderTrait for MockBlob { + type Address = MockAddress; + + fn sender(&self) -> Self::Address { + self.address + } + + fn hash(&self) -> [u8; 32] { + self.hash + } + + fn verified_data(&self) -> &[u8] { + self.data.accumulator() + } + + fn total_len(&self) -> usize { + self.data.total_len() + } + + #[cfg(feature = "native")] + fn advance(&mut self, num_bytes: usize) -> &[u8] { + self.data.advance(num_bytes); + self.verified_data() + } +} + +/// A mock block type used for testing. +#[derive(Serialize, Deserialize, PartialEq, core::fmt::Debug, Clone)] +pub struct MockBlock { + /// The header of this block. + pub header: MockBlockHeader, + /// Validity condition + pub validity_cond: MockValidityCond, + /// Blobs + pub blobs: Vec, +} + +impl Default for MockBlock { + fn default() -> Self { + Self { + header: MockBlockHeader { + prev_hash: [0; 32].into(), + hash: [1; 32].into(), + height: 0, + }, + validity_cond: Default::default(), + blobs: Default::default(), + } + } +} + +impl SlotData for MockBlock { + type BlockHeader = MockBlockHeader; + type Cond = MockValidityCond; + + fn hash(&self) -> [u8; 32] { + self.header.hash.0 + } + + fn header(&self) -> &Self::BlockHeader { + &self.header + } + + fn validity_condition(&self) -> MockValidityCond { + self.validity_cond + } +} + +impl DaSpec for MockDaSpec { + type SlotHash = MockHash; + type BlockHeader = MockBlockHeader; + type BlobTransaction = MockBlob; + type Address = MockAddress; + type ValidityCondition = MockValidityCond; + type InclusionMultiProof = [u8; 32]; + type CompletenessProof = (); + type ChainParams = (); +} + +impl DaVerifier for MockDaVerifier { + type Spec = MockDaSpec; + + type Error = anyhow::Error; + + fn new(_params: ::ChainParams) -> Self { + Self {} + } + + fn verify_relevant_tx_list( + &self, + _block_header: &::BlockHeader, + _txs: &[::BlobTransaction], + _inclusion_proof: ::InclusionMultiProof, + _completeness_proof: ::CompletenessProof, + ) -> Result<::ValidityCondition, Self::Error> { + Ok(Default::default()) + } +} diff --git a/rollup-interface/src/state_machine/mocks/validity_condition.rs b/rollup-interface/src/state_machine/mocks/validity_condition.rs index f7ad4ceb2..c0cbd00f1 100644 --- a/rollup-interface/src/state_machine/mocks/validity_condition.rs +++ b/rollup-interface/src/state_machine/mocks/validity_condition.rs @@ -1,4 +1,4 @@ -use std::marker::PhantomData; +use core::marker::PhantomData; use anyhow::Error; use borsh::{BorshDeserialize, BorshSerialize}; diff --git a/rollup-interface/src/state_machine/mocks/zk_vm.rs b/rollup-interface/src/state_machine/mocks/zk_vm.rs index ca9eb4607..8b33e0eee 100644 --- a/rollup-interface/src/state_machine/mocks/zk_vm.rs +++ b/rollup-interface/src/state_machine/mocks/zk_vm.rs @@ -1,11 +1,10 @@ -use std::io::Write; - use anyhow::ensure; use borsh::{BorshDeserialize, BorshSerialize}; -use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; -use crate::zk::{Matches, Zkvm}; +use crate::maybestd::io; +use crate::maybestd::vec::Vec; +use crate::zk::Matches; /// A mock commitment to a particular zkVM program. #[derive(Debug, Clone, PartialEq, Eq, BorshDeserialize, BorshSerialize, Serialize, Deserialize)] @@ -30,7 +29,7 @@ pub struct MockProof<'a> { impl<'a> MockProof<'a> { /// Serializes a proof into a writer. - pub fn encode(&self, mut writer: impl Write) { + pub fn encode(&self, mut writer: impl io::Write) { writer.write_all(&self.program_id.0).unwrap(); let is_valid_byte = if self.is_valid { 1 } else { 0 }; writer.write_all(&[is_valid_byte]).unwrap(); @@ -61,7 +60,7 @@ impl<'a> MockProof<'a> { /// A mock implementing the zkVM trait. pub struct MockZkvm; -impl Zkvm for MockZkvm { +impl crate::zk::Zkvm for MockZkvm { type CodeCommitment = MockCodeCommitment; type Error = anyhow::Error; @@ -79,10 +78,11 @@ impl Zkvm for MockZkvm { Ok(proof.log) } + #[cfg(feature = "std")] fn verify_and_extract_output< Add: crate::RollupAddress, Da: crate::da::DaSpec, - Root: Serialize + DeserializeOwned, + Root: Serialize + serde::de::DeserializeOwned, >( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, @@ -90,6 +90,18 @@ impl Zkvm for MockZkvm { let output = Self::verify(serialized_proof, code_commitment)?; Ok(bincode::deserialize(output)?) } + + #[cfg(not(feature = "std"))] + fn verify_and_extract_output< + Add: crate::RollupAddress, + Da: crate::da::DaSpec, + Root: Serialize + serde::de::DeserializeOwned, + >( + _serialized_proof: &[u8], + _code_commitment: &Self::CodeCommitment, + ) -> Result, Self::Error> { + todo!("the current version of bincode doesn't support no-std; however, the next version is scheduled to") + } } #[test] diff --git a/rollup-interface/src/state_machine/mod.rs b/rollup-interface/src/state_machine/mod.rs index e5242e2e1..4b4a90c0b 100644 --- a/rollup-interface/src/state_machine/mod.rs +++ b/rollup-interface/src/state_machine/mod.rs @@ -5,6 +5,7 @@ pub mod da; pub mod stf; pub mod zk; +#[cfg(feature = "std")] pub use bytes::{Buf, BufMut, Bytes, BytesMut}; use serde::de::DeserializeOwned; use serde::Serialize; @@ -23,10 +24,10 @@ pub trait BasicAddress: + Send + Sync + Clone - + std::hash::Hash + + core::hash::Hash + AsRef<[u8]> + for<'a> TryFrom<&'a [u8], Error = anyhow::Error> - + std::str::FromStr + + core::str::FromStr + Serialize + DeserializeOwned + 'static diff --git a/rollup-interface/src/state_machine/stf.rs b/rollup-interface/src/state_machine/stf.rs index bbe14e726..76ed6a30b 100644 --- a/rollup-interface/src/state_machine/stf.rs +++ b/rollup-interface/src/state_machine/stf.rs @@ -8,6 +8,7 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use crate::da::DaSpec; +use crate::maybestd::vec::Vec; use crate::zk::{ValidityCondition, Zkvm}; #[cfg(any(all(test, feature = "sha2"), feature = "fuzzing"))] diff --git a/rollup-interface/src/state_machine/stf/fuzzing.rs b/rollup-interface/src/state_machine/stf/fuzzing.rs index 96199f6b2..5d90e5821 100644 --- a/rollup-interface/src/state_machine/stf/fuzzing.rs +++ b/rollup-interface/src/state_machine/stf/fuzzing.rs @@ -6,6 +6,8 @@ use proptest::prelude::{any, Arbitrary}; use proptest::strategy::{BoxedStrategy, Strategy}; use super::{BatchReceipt, Event, TransactionReceipt}; +use crate::maybestd::boxed::Box; +use crate::maybestd::vec::Vec; /// An object-safe hashing trait, which is blanket implemented for all /// [`digest::Digest`] implementors. diff --git a/rollup-interface/src/state_machine/zk/mod.rs b/rollup-interface/src/state_machine/zk/mod.rs index 3cdb0e227..9e20cca55 100644 --- a/rollup-interface/src/state_machine/zk/mod.rs +++ b/rollup-interface/src/state_machine/zk/mod.rs @@ -48,7 +48,7 @@ pub trait Zkvm { + DeserializeOwned; /// The error type which is returned when a proof fails to verify - type Error: Debug + From; + type Error: Debug; /// Interpret a sequence of a bytes as a proof and attempt to verify it against the code commitment. /// If the proof is valid, return a reference to the public outputs of the proof. diff --git a/sov-rollup-starter/provers/risc0/guest-mock/Cargo.lock b/sov-rollup-starter/provers/risc0/guest-mock/Cargo.lock new file mode 100644 index 000000000..d0bcdae92 --- /dev/null +++ b/sov-rollup-starter/provers/risc0/guest-mock/Cargo.lock @@ -0,0 +1,1373 @@ +# 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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a" +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 = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[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.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[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 = "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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +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 = "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.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" + +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "serde", + "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", + "serde", + "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 = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[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 = "guest-mock-starter" +version = "0.3.0" +dependencies = [ + "anyhow", + "risc0-zkvm", + "risc0-zkvm-platform", + "sov-modules-api", + "sov-modules-stf-template", + "sov-risc0-adapter", + "sov-rollup-interface", + "sov-state", + "stf-starter", +] + +[[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.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23f1cb339f7d5288603665c0ccbef7ad33a782ced36e18b6b207f175479eb3b7" +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 = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[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 = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[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", + "libm", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[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 = "proptest" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.4.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[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 = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[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" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[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 = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[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 = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[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 = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[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.3.0" +dependencies = [ + "anyhow", + "borsh", + "serde", + "sov-modules-api", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-bank" +version = "0.3.0" +dependencies = [ + "anyhow", + "borsh", + "serde", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", + "thiserror", +] + +[[package]] +name = "sov-first-read-last-write-cache" +version = "0.3.0" +dependencies = [ + "thiserror", +] + +[[package]] +name = "sov-modules-api" +version = "0.3.0" +dependencies = [ + "anyhow", + "bech32", + "borsh", + "derive_more", + "ed25519-dalek", + "hex", + "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.3.0" +dependencies = [ + "anyhow", + "borsh", + "proc-macro2", + "quote", + "schemars", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "sov-modules-stf-template" +version = "0.3.0" +dependencies = [ + "anyhow", + "borsh", + "hex", + "jmt", + "serde", + "sov-modules-api", + "sov-rollup-interface", + "sov-state", + "thiserror", + "tracing", +] + +[[package]] +name = "sov-risc0-adapter" +version = "0.3.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.3.0" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "borsh", + "bytes", + "digest", + "hex", + "proptest", + "serde", + "sha2", + "spin", + "thiserror", +] + +[[package]] +name = "sov-sequencer-registry" +version = "0.3.0" +dependencies = [ + "anyhow", + "borsh", + "serde", + "sov-bank", + "sov-modules-api", + "sov-state", +] + +[[package]] +name = "sov-state" +version = "0.3.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.3.0" +dependencies = [ + "anyhow", + "borsh", + "hex", + "serde", + "serde_json", + "sov-rollup-interface", +] + +[[package]] +name = "sov-zk-cycle-utils" +version = "0.3.0" +dependencies = [ + "risc0-zkvm", + "risc0-zkvm-platform", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stf-starter" +version = "0.3.0" +dependencies = [ + "anyhow", + "borsh", + "serde", + "sov-accounts", + "sov-bank", + "sov-modules-api", + "sov-modules-stf-template", + "sov-rollup-interface", + "sov-sequencer-registry", + "sov-state", + "sov-stf-runner", + "tracing", +] + +[[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.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +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.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[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 = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[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" + +[[patch.unused]] +name = "cc" +version = "1.0.79" +source = "git+https://github.com/rust-lang/cc-rs?rev=e5bbdfa#e5bbdfa1fa468c028cb38fee6c35a3cf2e5a2736"