diff --git a/Cargo.lock b/Cargo.lock index e9698c72c1..c6657d2653 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,18 +25,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" dependencies = [ "backtrace", ] @@ -435,9 +435,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -480,9 +480,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", @@ -697,18 +697,18 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", "serde", + "windows-targets 0.52.6", ] [[package]] @@ -1011,9 +1011,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.17" +version = "1.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93fe60e2fc87b6ba2c117f67ae14f66e3fc7d6a1e612a25adb238cc980eadb3" +checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" dependencies = [ "jobserver", "libc", @@ -1487,9 +1487,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.74+curl-8.9.0" +version = "0.4.75+curl-8.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af10b986114528fcdc4b63b6f5f021b7057618411046a4de2ba0f0149a097bf" +checksum = "2a4fd752d337342e4314717c0d9b6586b059a120c80029ebe4d49b11fec7875e" dependencies = [ "cc", "libc", @@ -2593,9 +2593,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "git2" @@ -3012,7 +3012,7 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3038,9 +3038,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes 1.7.1", "futures-channel", @@ -3058,9 +3058,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3200,9 +3200,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is-terminal" @@ -3348,9 +3348,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3531,11 +3531,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -4217,9 +4217,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -4412,9 +4412,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -4425,15 +4425,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -4551,7 +4551,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.20", + "toml_edit 0.22.21", ] [[package]] @@ -4692,7 +4692,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "socket2", "thiserror", "tokio", @@ -4709,7 +4709,7 @@ dependencies = [ "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "slab", "thiserror", "tinyvec", @@ -4855,9 +4855,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -4986,7 +4986,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", @@ -5188,9 +5188,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -5226,14 +5226,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -5275,9 +5275,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -5352,20 +5352,20 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.16" +version = "2.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb7ac86243095b70a7920639507b71d51a63390d1ba26c4f60a552fbb914a37" +checksum = "0c947adb109a8afce5fc9c7bf951f87f146e9147b3a6a58413105628fb1d1e66" dependencies = [ "sdd", ] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5428,9 +5428,9 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" +checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" [[package]] name = "sec1" @@ -5736,9 +5736,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", @@ -5870,7 +5870,7 @@ dependencies = [ [[package]] name = "sp1-build" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "cargo_metadata", @@ -5881,7 +5881,7 @@ dependencies = [ [[package]] name = "sp1-cli" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anstyle", "anyhow", @@ -5916,7 +5916,7 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "bytemuck", @@ -5953,7 +5953,7 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "arrayref", @@ -6020,7 +6020,7 @@ dependencies = [ [[package]] name = "sp1-cuda" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "ctrlc", @@ -6041,7 +6041,7 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "1.2.0" +version = "2.0.0" dependencies = [ "curve25519-dalek", "dashu", @@ -6061,7 +6061,7 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "1.2.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -6070,7 +6070,7 @@ dependencies = [ [[package]] name = "sp1-eval" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -6090,14 +6090,14 @@ dependencies = [ [[package]] name = "sp1-helper" -version = "1.2.0" +version = "2.0.0" dependencies = [ "sp1-build", ] [[package]] name = "sp1-lib" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -6109,7 +6109,7 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "1.2.0" +version = "2.0.0" dependencies = [ "itertools 0.13.0", "lazy_static", @@ -6121,7 +6121,7 @@ dependencies = [ [[package]] name = "sp1-prover" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -6160,7 +6160,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit-v2" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "ff 0.13.0", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "1.2.0" +version = "2.0.0" dependencies = [ "backtrace", "criterion", @@ -6231,7 +6231,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "backtrace", @@ -6268,7 +6268,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core-v2" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "backtrace", @@ -6308,7 +6308,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "1.2.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -6317,7 +6317,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-cli" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "clap", @@ -6326,7 +6326,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "1.2.0" +version = "2.0.0" dependencies = [ "anyhow", "bincode", @@ -6351,7 +6351,7 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "1.2.0" +version = "2.0.0" dependencies = [ "alloy-sol-types", "anyhow", @@ -6398,7 +6398,7 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "1.2.0" +version = "2.0.0" dependencies = [ "arrayref", "getrandom 0.2.15", @@ -6432,7 +6432,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.2.0" +version = "2.0.0" dependencies = [ "bincode", "cfg-if", @@ -6972,7 +6972,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] @@ -6999,7 +6999,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit 0.22.21", ] [[package]] @@ -7024,9 +7024,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap 2.5.0", "serde", @@ -7252,9 +7252,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-linebreak" diff --git a/Cargo.toml b/Cargo.toml index 61c3524c0b..2f99c90924 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "1.2.0" +version = "2.0.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/succinctlabs/sp1" @@ -30,7 +30,11 @@ members = [ "crates/stark", "crates/zkvm/*", ] -exclude = ["examples/target", "crates/recursion/program", "crates/recursion/circuit"] +exclude = [ + "examples/target", + "crates/recursion/program", + "crates/recursion/circuit", +] resolver = "2" [profile.release] @@ -46,29 +50,29 @@ debug-assertions = true [workspace.dependencies] # sp1 -sp1-build = { path = "crates/build", version = "1.2.0" } -sp1-cli = { path = "crates/cli", version = "1.2.0", default-features = false } -sp1-core-machine = { path = "crates/core/machine", version = "1.2.0" } -sp1-core-executor = { path = "crates/core/executor", version = "1.2.0" } -sp1-curves = { path = "crates/curves", version = "1.2.0" } -sp1-derive = { path = "crates/derive", version = "1.2.0" } -sp1-eval = { path = "crates/eval", version = "1.2.0" } -sp1-helper = { path = "crates/helper", version = "1.2.0", default-features = false } -sp1-primitives = { path = "crates/primitives", version = "1.2.0" } -sp1-prover = { path = "crates/prover", version = "1.2.0" } -sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "1.2.0" } -sp1-recursion-core = { path = "crates/recursion/core", version = "1.2.0", default-features = false } -sp1-recursion-core-v2 = { path = "crates/recursion/core-v2", version = "1.2.0", default-features = false } -sp1-recursion-circuit-v2 = { path = "crates/recursion/circuit-v2", version = "1.2.0", default-features = false } -sp1-recursion-derive = { path = "crates/recursion/derive", version = "1.2.0", default-features = false } -sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "1.2.0", default-features = false } -sp1-recursion-program = { path = "crates/recursion/program", version = "1.2.0", default-features = false } -sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "1.2.0", default-features = false } -sp1-sdk = { path = "crates/sdk", version = "1.2.0" } -sp1-cuda = { path = "crates/cuda", version = "1.2.0" } -sp1-stark = { path = "crates/stark", version = "1.2.0" } -sp1-lib = { path = "crates/zkvm/lib", version = "1.2.0", default-features = false } -sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "1.2.0", default-features = false } +sp1-build = { path = "crates/build", version = "2.0.0" } +sp1-cli = { path = "crates/cli", version = "2.0.0", default-features = false } +sp1-core-machine = { path = "crates/core/machine", version = "2.0.0" } +sp1-core-executor = { path = "crates/core/executor", version = "2.0.0" } +sp1-curves = { path = "crates/curves", version = "2.0.0" } +sp1-derive = { path = "crates/derive", version = "2.0.0" } +sp1-eval = { path = "crates/eval", version = "2.0.0" } +sp1-helper = { path = "crates/helper", version = "2.0.0", default-features = false } +sp1-primitives = { path = "crates/primitives", version = "2.0.0" } +sp1-prover = { path = "crates/prover", version = "2.0.0" } +sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "2.0.0" } +sp1-recursion-core = { path = "crates/recursion/core", version = "2.0.0", default-features = false } +sp1-recursion-core-v2 = { path = "crates/recursion/core-v2", version = "2.0.0", default-features = false } +sp1-recursion-derive = { path = "crates/recursion/derive", version = "2.0.0", default-features = false } +sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "2.0.0", default-features = false } +sp1-recursion-program = { path = "crates/recursion/program", version = "2.0.0", default-features = false } +sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "2.0.0", default-features = false } +sp1-recursion-circuit-v2 = { path = "crates/recursion/circuit-v2", version = "2.0.0", default-features = false } +sp1-sdk = { path = "crates/sdk", version = "2.0.0" } +sp1-cuda = { path = "crates/cuda", version = "2.0.0" } +sp1-stark = { path = "crates/stark", version = "2.0.0" } +sp1-lib = { path = "crates/zkvm/lib", version = "2.0.0", default-features = false } +sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "2.0.0", default-features = false } # p3 p3-air = "0.1.3-succinct" diff --git a/book/SUMMARY.md b/book/SUMMARY.md index 553a35a415..53f0c71efe 100644 --- a/book/SUMMARY.md +++ b/book/SUMMARY.md @@ -34,7 +34,6 @@ - [Proof Aggregation](./writing-programs/proof-aggregation.md) - # Generating Proofs - [Setup](./generating-proofs/setup.md) @@ -46,13 +45,15 @@ - [Recommended Workflow](./generating-proofs/recommended-workflow.md) - [Prover Network Beta](./generating-proofs/prover-network.md) - - [Key Setup](./generating-proofs/prover-network/key-setup.md) - - [Usage](./generating-proofs/prover-network/usage.md) - - [Supported Versions](./generating-proofs/prover-network/versions.md) + + - [Key Setup](./generating-proofs/prover-network/key-setup.md) + - [Usage](./generating-proofs/prover-network/usage.md) + - [Supported Versions](./generating-proofs/prover-network/versions.md) - [Hardware Acceleration](./generating-proofs/hardware-acceleration.md) - - [AVX](./generating-proofs/hardware-acceleration/avx.md) - - [CUDA](./generating-proofs/hardware-acceleration/cuda.md) + + - [AVX](./generating-proofs/hardware-acceleration/avx.md) + - [CUDA](./generating-proofs/hardware-acceleration/cuda.md) - [FAQ](./generating-proofs/sp1-sdk-faq.md) @@ -64,7 +65,6 @@ - [Contract Addresses](./onchain-verification/contract-addresses.md) - # Developers - [Common Issues](./developers/common-issues.md) @@ -73,6 +73,4 @@ - [RV32IM Specification](./developers/rv32im-specification.md) -- [Building PLONK Artifacts](./developers/building-plonk-artifacts.md) - - +- [Building Circuit Artifacts](./developers/building-circuit-artifacts.md) diff --git a/book/developers/building-plonk-artifacts.md b/book/developers/building-circuit-artifacts.md similarity index 72% rename from book/developers/building-plonk-artifacts.md rename to book/developers/building-circuit-artifacts.md index 8f7eb5ad16..9e936d3ff3 100644 --- a/book/developers/building-plonk-artifacts.md +++ b/book/developers/building-circuit-artifacts.md @@ -1,6 +1,6 @@ # Building Circuit Artifacts -To build the production PLONK and Groth16 Bn254 artifacts from scratch, you can use the `Makefile` inside the `prover` directory. +To build the production Groth16 and PLONK Bn254 artifacts from scratch, you can use the `Makefile` inside the `prover` directory. ```shell,noplayground cd prover diff --git a/book/developers/common-issues.md b/book/developers/common-issues.md index 06556b82dd..f26f3ba0ae 100644 --- a/book/developers/common-issues.md +++ b/book/developers/common-issues.md @@ -22,7 +22,7 @@ This is likely due to two different versions of `alloy_sol_types` being used. To ```toml [dependencies] -sp1-sdk = { version = "1.1.0", default-features = false } +sp1-sdk = { version = "2.0.0", default-features = false } ``` This will configure out the `network` feature which will remove the dependency on `alloy_sol_types` and configure out the `NetworkProver`. @@ -100,7 +100,7 @@ C++ toolchain be setting this variable manually: export CC_riscv32im_succinct_zkvm_elf=/path/to/toolchain ``` -## Compilation Errors with [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html) +## Compilation Errors with [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html) If you are using the [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html) function, you may encounter compilation errors when building your program. @@ -108,14 +108,15 @@ If you are using the [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-l [sp1] = note: rust-lld: error: undefined symbol: syscall_verify_sp1_proof [sp1] >>> referenced by sp1_lib.b593533d149f0f6e-cgu.0 [sp1] >>> sp1_lib-8f5deb4c47d01871.sp1_lib.b593533d149f0f6e-cgu.0.rcgu.o:(sp1_lib::verify::verify_sp1_proof::h5c1bb38f11b3fe71) in ... - [sp1] - [sp1] + [sp1] + [sp1] [sp1] error: could not compile `package-name` (bin "package-name") due to 1 previous error - ``` +``` + +To resolve this, ensure that you're importing both `sp1-lib` and `sp1-zkvm` with the verify feature enabled. - To resolve this, ensure that you're importing both `sp1-lib` and `sp1-zkvm` with the verify feature enabled. - ```toml - [dependencies] - sp1-lib = { version = "", features = ["verify"] } - sp1-zkvm = { version = "", features = ["verify"] } - ``` \ No newline at end of file +```toml +[dependencies] +sp1-lib = { version = "", features = ["verify"] } +sp1-zkvm = { version = "", features = ["verify"] } +``` diff --git a/book/generating-proofs/advanced.md b/book/generating-proofs/advanced.md index 2d17439012..4b1f30c544 100644 --- a/book/generating-proofs/advanced.md +++ b/book/generating-proofs/advanced.md @@ -48,7 +48,7 @@ RUSTFLAGS='-C target-cpu=native' cargo run --release Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-sdk` feature `neon` in your script crate's `Cargo.toml` file. ```toml -sp1-sdk = { version = "1.1.0", features = ["neon"] } +sp1-sdk = { version = "2.0.0", features = ["neon"] } ``` ## Performance diff --git a/book/generating-proofs/basics.md b/book/generating-proofs/basics.md index 06a3383ff0..faeb0cbfec 100644 --- a/book/generating-proofs/basics.md +++ b/book/generating-proofs/basics.md @@ -10,10 +10,10 @@ To make this more concrete, let's walk through a simple example of generating a {{#include ../../examples/fibonacci/script/src/main.rs}} ``` -You can run the above script in the `script` directory with `RUST_LOG=info cargo run --release`. Note that running the above script will generate a proof locally. +You can run the above script in the `script` directory with `RUST_LOG=info cargo run --release`. Note that running the above script will generate a proof locally.
-WARNING: Local proving often is much slower than the prover network and for certain proof types (e.g. PLONK) requires a significant amount of RAM and will likely not work on a laptop. +WARNING: Local proving often is much slower than the prover network and for certain proof types (e.g. Groth16, PLONK) require a significant amount of RAM and will likely not work on a laptop.
-We recommend using the [prover network](./prover-network.md) to generate proofs. Read more about the [recommended workflow](./recommended-workflow.md) for developing with SP1. \ No newline at end of file +We recommend using the [prover network](./prover-network.md) to generate proofs. Read more about the [recommended workflow](./recommended-workflow.md) for developing with SP1. diff --git a/book/generating-proofs/proof-types.md b/book/generating-proofs/proof-types.md index 70513f8faa..d6542d73bc 100644 --- a/book/generating-proofs/proof-types.md +++ b/book/generating-proofs/proof-types.md @@ -4,12 +4,12 @@ There are a few different types of proofs that can be generated by the SP1 zkVM. The `ProverClient` follows a "builder" pattern that allows you to configure the proof type and other options after creating a `ProverClient` and calling `prove` on it. -For a full list of options, see the following [docs](https://docs.rs/sp1-sdk/1.1.0/sp1_sdk/action/struct.Prove.html). +For a full list of options, see the following [docs](https://docs.rs/sp1-sdk/1.2.0/sp1_sdk/action/struct.Prove.html). ## Core (Default) The default prover mode generates a list of STARK proofs that in aggregate have size proportional to - the size of the execution. Use this in settings where you don't care about **verification cost / proof size**. +the size of the execution. Use this in settings where you don't care about **verification cost / proof size**. ```rust,noplayground let client = ProverClient::new(); @@ -19,22 +19,39 @@ client.prove(&pk, stdin).run().unwrap(); ## Compressed The compressed prover mode generates STARK proofs that have constant size. Use this in settings where you -care about **verification cost / proof size**. This is useful for applications where you want to recursively verify SP1 proofs within SP1 (see the [proof aggregation](../writing-programs/proof-aggregation.md) section). +care about **verification cost / proof size**. This is useful for applications where you want to recursively verify SP1 proofs within SP1 (see the [proof aggregation](../writing-programs/proof-aggregation.md) section). ```rust,noplayground let client = ProverClient::new(); client.prove(&pk, stdin).compressed().run().unwrap(); ``` -## PLONK +## Groth16 (testnet only) + +
+WARNING: Groth16 proofs are currently only verifiable on testnets & are not production-ready +
-WARNING: The PLONK prover requires around 64GB of RAM and is only guaranteed to work on official releases of SP1. We recommend using the prover network to generate PLONK proofs. +WARNING: The Groth16 prover requires around 64GB of RAM and are only guaranteed to work on official releases of SP1. We recommend using the prover network to generate these proofs.
+The Groth16 prover mode generate a SNARK proof with extremely small proof size and low verification cost. +This mode generates proofs that can be verified onchain for around ~270k gas. + +```rust,noplayground +let client = ProverClient::new(); +client.prove(&pk, stdin).groth16().run().unwrap(); +``` + +## PLONK + +
+WARNING: The PLONK prover requires around 64GB of RAM and are only guaranteed to work on official releases of SP1. We recommend using the prover network to generate these proofs. +
-The PLONK prover mode generates a SNARK proof with extremely small proof size and low verification cost. -This mode is necessary for generating proofs that can be verified onchain for around ~300k gas. +The Groth16 and PLONK prover modes generate a SNARK proof with extremely small proof size and low verification cost. +This mode generates proofs that can be verified onchain for around ~300k gas. ```rust,noplayground let client = ProverClient::new(); diff --git a/book/generating-proofs/prover-network.md b/book/generating-proofs/prover-network.md index 593a9f41aa..f5b61d2204 100644 --- a/book/generating-proofs/prover-network.md +++ b/book/generating-proofs/prover-network.md @@ -1,8 +1,9 @@ # Prover Network Beta -> **Currently, the supported version of SP1 on the prover network is `v1.1.0`.** +> **See [Supported Versions](./prover-network/versions.md) for the currently supported versions of SP1 on the Prover Network.** Succinct [has been building](https://blog.succinct.xyz/succinct-network/) the Succinct Prover Network, a distributed network of provers that can generate proofs of any size quickly and reliably. It's currently in private beta, but you can get access by following the steps below. To get started, **[FILL OUT THIS FORM](https://forms.gle/rTUvhstS8PFfv9B3A)** to gain access to the Succinct -Network. Completing this form requires you to complete the [key setup](./prover-network/key-setup.md) steps below. \ No newline at end of file +Network. Completing this form requires you to complete the [key +setup](./prover-network/key-setup.md) steps below. diff --git a/book/generating-proofs/prover-network/usage.md b/book/generating-proofs/prover-network/usage.md index c334228d4c..6d1ce02fe3 100644 --- a/book/generating-proofs/prover-network/usage.md +++ b/book/generating-proofs/prover-network/usage.md @@ -1,6 +1,6 @@ # Prover Network: Usage -> **Currently, the supported version of SP1 on the prover network is `v1.1.0`.** +> **See [Supported Versions](./versions.md) for the currently supported versions of SP1 on the Prover Network.** ## Sending a proof request diff --git a/book/generating-proofs/prover-network/versions.md b/book/generating-proofs/prover-network/versions.md index 633fbe6e24..271a09078b 100644 --- a/book/generating-proofs/prover-network/versions.md +++ b/book/generating-proofs/prover-network/versions.md @@ -2,13 +2,14 @@ The prover network currently only supports specific versions of SP1: -| Environment | RPC URL | Supported Version | -| ----------- | -------------------------- | ----------------- | -| Production | `https://rpc.succinct.xyz` | `v1.2.X` | +| Version | Description | +| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| v2.X.X | Audited, production ready version. | +| v3.X.X | Pre-release version with enhanced performance, currently being audited. **Recommended for benchmarking or testing, not recommended for production use.** | -Where `X` denotes that any patch version is supported (e.g. `v1.2.0`, `v1.2.1`). +`X` denotes that any minor and patch version is supported (e.g. `v2.1.0`, `v2.1.1`). -If you submit a proof request to the prover network and your are not using the supported version, you will receive an error message. +If you submit a proof request to the prover network and you are not using a supported version, you will receive an error message. ## Changing versions @@ -16,14 +17,14 @@ You must switch to a supported version before submitting a proof. To do so, repl ```toml [dependencies] -sp1-zkvm = "1.1.0" +sp1-zkvm = "2.0.0" ``` replace the `sp1-sdk` version in your script's `Cargo.toml`: ```toml [dependencies] -sp1-sdk = "1.1.0" +sp1-sdk = "2.0.0" ``` Re-build your program and script, and then try again. diff --git a/book/generating-proofs/recommended-workflow.md b/book/generating-proofs/recommended-workflow.md index 1f2af07972..9f9acfa034 100644 --- a/book/generating-proofs/recommended-workflow.md +++ b/book/generating-proofs/recommended-workflow.md @@ -2,7 +2,7 @@ We recommend the following workflow for developing with SP1. -## Step 1: Iterate on your program with execution only +## Step 1: Iterate on your program with execution only While iterating on your SP1 program, you should **only execute** the program with the RISC-V runtime. This will allow you to verify the correctness of your program and test the `SP1Stdin` as well as the `SP1PublicValues` that are returned, without having to generate a proof (which can be slow and/or expensive). If the execution of your program succeeds, then proof generation should succeed as well! @@ -14,7 +14,7 @@ Note that printing out the total number of executed cycles and the full executio **Crate Setup:** We recommend that your program crate that defines the `main` function (around which you wrap the `sp1_zkvm::entrypoint!` macro) should be kept minimal. Most of your business logic should be in a separate crate (in the same repo/workspace) that can be tested independently and that is not tied to the SP1 zkVM. This will allow you to unit test your program logic without having to worry about the `zkvm` compilation target. This will also allow you to efficient reuse types between your program crate and your crate that generates proofs. -## Step 2: Generate proofs +## Step 2: Generate proofs After you have iterated on your program and finalized that it works correctly, you can generate proofs for your program for final end to end testing or production use. @@ -28,7 +28,7 @@ There are a few things to keep in mind when using the prover network. #### Benchmarking latency on the prover network -The prover network currently parallelizes proof generation across multiple machines. This means the latency of proof generation does not scale linearly with the number of cycles of your program, but rather with the number of cycles of your program divided by the number of currently available machines on the prover network. +The prover network currently parallelizes proof generation across multiple machines. This means the latency of proof generation does not scale linearly with the number of cycles of your program, but rather with the number of cycles of your program divided by the number of currently available machines on the prover network. Our prover network currently has limited capacity because it is still in beta. If you have an extremely latency sensitive use-case and you want to figure out the **minimal latency possible** for your program, you should [reach out to us](https://partner.succinct.xyz/) and we can onboard you to our reserved capacity cluster that has a dedicated instances that can significantly reduce latency. @@ -40,13 +40,13 @@ Note that **latency is not the same as cost**, because we parallelize proof gene #### Benchmarking on small vs. large programs -In SP1, there is a fixed overhead for proving that is independent of your program's cycle count. This means that benchmarking on *small programs* is not representative of the performance of larger programs. To get an idea of the scale of programs for real-world workloads, you can refer to our [benchmarking blog post](https://blog.succinct.xyz/sp1-production-benchmarks) and also some numbers below: +In SP1, there is a fixed overhead for proving that is independent of your program's cycle count. This means that benchmarking on _small programs_ is not representative of the performance of larger programs. To get an idea of the scale of programs for real-world workloads, you can refer to our [benchmarking blog post](https://blog.succinct.xyz/sp1-production-benchmarks) and also some numbers below: -* An average Ethereum block can be between 100-500M cycles (including merkle proof verification for storage and execution of transactions) with our `keccak` and `secp256k1` precompiles. -* For a Tendermint light client, the average cycle count can be between 10M and 50M cycles (including our ed25519 precompiles). -* We consider programs with <2M cycles to be "small" and by default, the fixed overhead of proving will dominate the proof latency. If latency is incredibly important for your use-case, we can specialize the prover network for your program if you reach out to us. +- An average Ethereum block can be between 100-500M cycles (including merkle proof verification for storage and execution of transactions) with our `keccak` and `secp256k1` precompiles. +- For a Tendermint light client, the average cycle count can be between 10M and 50M cycles (including our ed25519 precompiles). +- We consider programs with <2M cycles to be "small" and by default, the fixed overhead of proving will dominate the proof latency. If latency is incredibly important for your use-case, we can specialize the prover network for your program if you reach out to us. -Note that if you generate PLONK proofs on the prover network, you will encounter a fixed overhead of 90 seconds for the STARK -> SNARK wrapping step. We're actively working on reducing this overhead in our next release. +Note that if you generate Groth16 or PLONK proofs on the prover network, you will encounter a fixed overhead for the STARK -> SNARK wrapping step. We're actively working on reducing this overhead in future releases. #### On-Demand vs. Reserved Capacity @@ -54,4 +54,4 @@ The prover network is currently in beta and has limited capacity. For high volum ### Generating proofs locally -If you want to generate proofs locally, you can use the `sp1_sdk` crate to generate proofs locally as outlined in the [Basics](./basics.md) section. By default, the `ProverClient` will generate proofs locally using your CPU. Check out the hardware requirements for locally proving [here](../getting-started/hardware-requirements.md#local-proving). \ No newline at end of file +If you want to generate proofs locally, you can use the `sp1_sdk` crate to generate proofs locally as outlined in the [Basics](./basics.md) section. By default, the `ProverClient` will generate proofs locally using your CPU. Check out the hardware requirements for locally proving [here](../getting-started/hardware-requirements.md#local-proving). diff --git a/book/generating-proofs/setup.md b/book/generating-proofs/setup.md index 9a8561cea0..88db15fb8e 100644 --- a/book/generating-proofs/setup.md +++ b/book/generating-proofs/setup.md @@ -32,7 +32,7 @@ name = "script" edition = "2021" [dependencies] -sp1-sdk = "1.1.0" +sp1-sdk = "2.0.0" ``` The `sp1-sdk` crate includes the necessary utilities to generate, save, and verify proofs. diff --git a/book/getting-started/hardware-requirements.md b/book/getting-started/hardware-requirements.md index b567f897ab..8e149fb023 100644 --- a/book/getting-started/hardware-requirements.md +++ b/book/getting-started/hardware-requirements.md @@ -4,6 +4,7 @@ We recommend that developers who want to use SP1 for non-trivial programs generate proofs on our prover network. The prover network generates SP1 proofs across multiple machines, reducing latency and also runs SP1 on optimized hardware instances that result in faster + cheaper proof generation times. We recommend that for any production benchmarking, you use the prover network to estimate latency and costs of proof generation. + ## Local Proving @@ -12,16 +13,16 @@ If you want to generate SP1 proofs locally, this section has an overview of the **The most important requirement is CPU for performance/latency and RAM to prevent running out of memory.** -| | Mock / Network | Core / Compress | PLONK (EVM) | -|----------------|------------------------------|------------------------------------|----------------------------| -| CPU | 1+, single-core perf matters | 16+, more is better | 32+, more is better | -| Memory | 8GB+, more is better | 32GB+, more if you have more cores | 64GB+ (for PLONK) | -| Disk | 20GB+ | 20GB+ | 100GB+ (for trusted setup) | -| EVM Compatible | ✅ | ❌ | ✅ | +| | Mock / Network | Core / Compress | Groth16 and PLONK (EVM) | +| -------------- | ---------------------------- | ---------------------------------- | ----------------------- | +| CPU | 1+, single-core perf matters | 16+, more is better | 32+, more is better | +| Memory | 8GB+, more is better | 32GB+, more if you have more cores | 64GB+, more is better | +| Disk | 20GB+ | 20GB+ | 12GB+ | +| EVM Compatible | ✅ | ❌ | ✅ | ### CPU -The execution & trace generation of the zkVM is mostly CPU bound, having a high single-core +The execution & trace generation of the zkVM is mostly CPU bound, having a high single-core performance is recommended to accelerate these steps. The rest of the prover is mostly bound by hashing/field operations which can be parallelized with multiple cores. @@ -30,13 +31,12 @@ which can be parallelized with multiple cores. Our prover requires keeping large matrices (i.e., traces) in memory to generate the proofs. Certain steps of the prover have a minimum memory requirement, meaning that if you have less than this amount of memory, the process will OOM. -This effect is most noticeable when using the PLONK prover, which requires around 128GB of RAM to generate a proof. We use PLONK to avoid -having to perform a trusted setup, which other SNARKs like Groth16 require. We have future optimizations planned to reduce -the memory requirements of the PLONK prover substantially. +This effect is most noticeable when using the Groth16 or PLONK provers, which requires around 128GB +of RAM to generate a proof. ### Disk -Disk is required to install the SP1 zkVM toolchain and to install the trused setup artifacts, if you plan to locally build the PLONK prover. - -Furthermore, disk is used to checkpoint the state of the program execution, which is required to generate the proofs. +Disk is required to install the SP1 zkVM toolchain and to install the circuit artifacts, if you +plan to locally build the Groth16 or PLONK provers. +Furthermore, disk is used to checkpoint the state of the program execution, which is required to generate the proofs. diff --git a/book/onchain-verification/getting-started.md b/book/onchain-verification/getting-started.md index 110553e7e8..93051b9da0 100644 --- a/book/onchain-verification/getting-started.md +++ b/book/onchain-verification/getting-started.md @@ -12,20 +12,22 @@ Refer to the section on [Contract Addresses](./contract-addresses.md) for the ad By default, the proofs generated by SP1 are not verifiable onchain, as they are non-constant size and STARK verification on Ethereum is very expensive. To generate a proof that can be verified onchain, we use performant STARK recursion to combine SP1 shard proofs into a single STARK proof and then wrap that in a SNARK proof. Our `ProverClient` has a prover option for this called `plonk`. Behind the scenes, this function will first generate a normal SP1 proof, then recursively combine all of them into a single proof using the STARK recursion protocol. Finally, the proof is wrapped in a SNARK proof using PLONK. -> WARNING: The PLONK prover is only guaranteed to work on official releases of SP1. To use PLONK proving & verification locally, ensure that you have Docker installed and have at least 128GB of RAM. +> WARNING: The Groth16 and PLONK provers are only guaranteed to work on official releases of SP1. To +> use Groth16 or PLONK proving & verification locally, ensure that you have Docker installed and have +> at least 128GB of RAM. ### Example ```rust,noplayground -{{#include ../../examples/fibonacci/script/bin/plonk_bn254.rs}} +{{#include ../../examples/fibonacci/script/bin/groth16_bn254.rs}} ``` -You can run the above script with `RUST_LOG=info cargo run --bin plonk_bn254 --release` in `examples/fibonacci/script`. +You can run the above script with `RUST_LOG=info cargo run --bin groth16_bn254 --release` in `examples/fibonacci/script`. -#### Using PLONK without Docker (Advanced) +#### Using Groth16 and PLONK without Docker (Advanced) -If you would like to run the PLONK prover directly without Docker, you must have Go 1.22 installed and enable the `native-plonk` feature in `sp1-sdk`. This path is not recommended and may require additional native dependencies. +If you would like to run the Groth16 or PLONK prover directly without Docker, you must have Go 1.22 installed and enable the `native-gnark` feature in `sp1-sdk`. This path is not recommended and may require additional native dependencies. ```toml -sp1-sdk = { version = "1.1.0", features = ["native-plonk"] } +sp1-sdk = { version = "2.0.0", features = ["native-gnark"] } ``` diff --git a/book/writing-programs/compiling.md b/book/writing-programs/compiling.md index 29a33cedd7..f1acd49b0d 100644 --- a/book/writing-programs/compiling.md +++ b/book/writing-programs/compiling.md @@ -34,7 +34,6 @@ Under the hood, this CLI command calls `cargo build` with the `riscv32im-succinc You can pass additional arguments to the `cargo prove build` command to customize the build process, like configuring what features are enabled, customizing the output directory and more. To see all available options, run `cargo prove build --help`. Many of these options mirror the options available in the `cargo build` command. - ## Production Builds For production builds of programs, you can build your program inside a Docker container which will generate a **reproducible ELF** on all platforms. To do so, just use the `--docker` flag and optionally the `--tag` flag with the release version you want to use (defaults to `latest`). For example: @@ -62,12 +61,12 @@ The path passed in to `build_program` should point to the directory containing t ```toml [build-dependencies] -sp1-build = "1.2.0" +sp1-build = "2.0.0" ``` You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt: -```` +``` [fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/src [fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.toml [fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.lock @@ -75,11 +74,10 @@ You will see output like the following from the build script if the program has [fibonacci-script 0.1.0] [sp1] Compiling fibonacci-program v0.1.0 (/Users/umaroy/Documents/fibonacci/program) [fibonacci-script 0.1.0] [sp1] Finished release [optimized] target(s) in 0.15s warning: fibonacci-script@0.1.0: fibonacci-program built at 2024-03-02 22:01:26 -```` +``` The above output was generated by running `RUST_LOG=info cargo run --release -vv` for the `script` folder of the Fibonacci example. - ### Advanced Build Options To configure the build process when using the `sp1-build` crate, you can pass a [`BuildArgs`](https://docs.rs/sp1-build/1.2.0/sp1_build/struct.BuildArgs.html) struct to to the [`build_program_with_args`](https://docs.rs/sp1-build/1.2.0/sp1_build/fn.build_program_with_args.html) function. The build arguments are the same as the ones available from the `cargo prove build` command. @@ -99,4 +97,4 @@ fn main() { } ``` -**Note:** If you want reproducible builds with the `build.rs` approach, you should use the `docker` flag and the `build_program_with_args` function, as shown in the example above. \ No newline at end of file +**Note:** If you want reproducible builds with the `build.rs` approach, you should use the `docker` flag and the `build_program_with_args` function, as shown in the example above. diff --git a/book/writing-programs/cycle-tracking.md b/book/writing-programs/cycle-tracking.md index 176249b45e..c560f28ae5 100644 --- a/book/writing-programs/cycle-tracking.md +++ b/book/writing-programs/cycle-tracking.md @@ -14,7 +14,7 @@ Note that to use the macro, you must add the `sp1-derive` crate to your dependen ```toml [dependencies] -sp1-derive = "1.1.0" +sp1-derive = "2.0.0" ``` In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output: @@ -43,6 +43,7 @@ stdout: result: 2940 Note that we elegantly handle nested cycle tracking, as you can see above. ### Get Tracked Cycle Counts + To include tracked cycle counts in the `ExecutionReport` when using `ProverClient::execute`, use the following annotations: ```rust,noplayground @@ -65,8 +66,7 @@ First, we need to generate a trace file of the program counter at each cycle whi TRACE_FILE=trace.log RUST_LOG=info cargo run --release ``` -When the `TRACE_FILE` environment variable is set, as SP1's RISC-V runtime is executing, it will write a log of the program counter to the file specified by `TRACE_FILE`. - +When the `TRACE_FILE` environment variable is set, as SP1's RISC-V runtime is executing, it will write a log of the program counter to the file specified by `TRACE_FILE`. Next, we can use the `cargo prove` CLI with the `trace` command to analyze the trace file and generate a table of instruction counts. This can be done with the following command: diff --git a/book/writing-programs/precompiles.md b/book/writing-programs/precompiles.md index e0049eea56..004ede9f1f 100644 --- a/book/writing-programs/precompiles.md +++ b/book/writing-programs/precompiles.md @@ -19,5 +19,5 @@ If you are an advanced user you can interact with the precompiles directly using Here is a list of all available system calls & precompiles. ```rust,noplayground -{{#include ../../zkvm/lib/src/lib.rs}} +{{#include ../../crates/zkvm/lib/src/lib.rs}} ``` diff --git a/book/writing-programs/setup.md b/book/writing-programs/setup.md index 0346b3b7ad..aa3f4a2cca 100644 --- a/book/writing-programs/setup.md +++ b/book/writing-programs/setup.md @@ -32,7 +32,7 @@ name = "program" edition = "2021" [dependencies] -sp1-zkvm = "1.1.0" +sp1-zkvm = "2.0.0" ``` The `sp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs, diff --git a/crates/core/machine/src/lib.rs b/crates/core/machine/src/lib.rs index 5e72baff9a..5ceb81064e 100644 --- a/crates/core/machine/src/lib.rs +++ b/crates/core/machine/src/lib.rs @@ -30,7 +30,7 @@ pub mod utils; /// This string should be updated whenever any step in verifying an SP1 proof changes, including /// core, recursion, and plonk-bn254. This string is used to download SP1 artifacts and the gnark /// docker image. -pub const SP1_CIRCUIT_VERSION: &str = "v1.3.0-rc2"; +pub const SP1_CIRCUIT_VERSION: &str = "v2.0.0"; // Re-export the `SP1ReduceProof` struct from sp1_core_machine. // diff --git a/crates/recursion/core-v2/src/shape.rs b/crates/recursion/core-v2/src/shape.rs index 4baac1498a..7d0c4617a5 100644 --- a/crates/recursion/core-v2/src/shape.rs +++ b/crates/recursion/core-v2/src/shape.rs @@ -59,7 +59,6 @@ impl, const DEGREE: usize, const COL_P } if let Some(shape) = closest_shape { - tracing::info!("Found shape with minimal hamming distance: {}", min_distance); let shape = RecursionShape { inner: shape }; program.shape = Some(shape); } else { diff --git a/crates/recursion/gnark-ffi/go/sp1/babybear/babybear.go b/crates/recursion/gnark-ffi/go/sp1/babybear/babybear.go index 8f0da5b430..55cacdc51a 100644 --- a/crates/recursion/gnark-ffi/go/sp1/babybear/babybear.go +++ b/crates/recursion/gnark-ffi/go/sp1/babybear/babybear.go @@ -50,26 +50,21 @@ func NewChip(api frontend.API) *Chip { func Zero() Variable { return Variable{ Value: frontend.Variable("0"), - NbBits: 1, + NbBits: 32, } } func One() Variable { return Variable{ Value: frontend.Variable("1"), - NbBits: 1, + NbBits: 32, } } func NewF(value string) Variable { - if value == "0" { - return Zero() - } else if value == "1" { - return One() - } return Variable{ Value: frontend.Variable(value), - NbBits: 31, + NbBits: 32, } } diff --git a/examples/fibonacci/script/Cargo.toml b/examples/fibonacci/script/Cargo.toml index e8b0ebeeba..c6c510ba40 100644 --- a/examples/fibonacci/script/Cargo.toml +++ b/examples/fibonacci/script/Cargo.toml @@ -14,8 +14,8 @@ sha2 = "0.10.8" sp1-build = { workspace = true } [[bin]] -name = "plonk_bn254" -path = "bin/plonk_bn254.rs" +name = "groth16_bn254" +path = "bin/groth16_bn254.rs" [[bin]] name = "compressed" diff --git a/examples/fibonacci/script/bin/plonk_bn254.rs b/examples/fibonacci/script/bin/groth16_bn254.rs similarity index 86% rename from examples/fibonacci/script/bin/plonk_bn254.rs rename to examples/fibonacci/script/bin/groth16_bn254.rs index ee09e43b1c..2e25c7e724 100644 --- a/examples/fibonacci/script/bin/plonk_bn254.rs +++ b/examples/fibonacci/script/bin/groth16_bn254.rs @@ -16,7 +16,7 @@ fn main() { // Generate the proof for the given program and input. let client = ProverClient::new(); let (pk, vk) = client.setup(ELF); - let proof = client.prove(&pk, stdin).plonk().run().unwrap(); + let proof = client.prove(&pk, stdin).groth16().run().unwrap(); println!("generated proof"); @@ -32,9 +32,7 @@ fn main() { client.verify(&proof, &vk).expect("verification failed"); // Save the proof. - proof - .save("proof-with-pis.bin") - .expect("saving proof failed"); + proof.save("proof-with-pis.bin").expect("saving proof failed"); println!("successfully generated and verified proof for the program!") }