diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ef4831f9a6..fee5069436 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -227,4 +227,4 @@ jobs: cd ../script cargo remove sp1-sdk cargo add sp1-sdk --path $GITHUB_WORKSPACE/sdk - SP1_DEV=1 RUST_LOG=info cargo run --release + SP1_DEV=1 RUST_LOG=info cargo run --release -- --prove diff --git a/.vscode/settings.json b/.vscode/settings.json index eb7b799168..7e4fd0ca18 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,12 +24,16 @@ // // Examples. // "examples/chess/program/Cargo.toml", // "examples/chess/script/Cargo.toml", + // "examples/cycle-tracking/program/Cargo.toml", + // "examples/cycle-tracking/script/Cargo.toml", // "examples/fibonacci/program/Cargo.toml", // "examples/fibonacci/script/Cargo.toml", // "examples/io/program/Cargo.toml", // "examples/io/script/Cargo.toml", // "examples/json/program/Cargo.toml", // "examples/json/script/Cargo.toml", + // "examples/patch-testing/program/Cargo.toml", + // "examples/patch-testing/script/Cargo.toml", // "examples/regex/program/Cargo.toml", // "examples/regex/script/Cargo.toml", // "examples/rsa/program/Cargo.toml", diff --git a/Cargo.lock b/Cargo.lock index 439931343f..d962c8f7b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,7 +58,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "arrayvec", "bytes", @@ -569,7 +569,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.72", "which", @@ -706,9 +706,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] @@ -722,6 +722,26 @@ dependencies = [ "serde", ] +[[package]] +name = "capstone" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1097e608594dad3bad608295567f757742b883606fe150faf7a9740b849730d8" +dependencies = [ + "capstone-sys", + "libc", +] + +[[package]] +name = "capstone-sys" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7f651d5ec4c2a2e6c508f2c8032655003cd728ec85663e9796616990e25b5a" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "cargo-platform" version = "0.1.8" @@ -953,7 +973,7 @@ version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ - "encode_unicode", + "encode_unicode 0.3.6", "lazy_static", "libc", "unicode-width", @@ -1280,6 +1300,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -1292,6 +1322,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "downcast-rs" version = "1.2.1" @@ -1313,9 +1354,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -1359,7 +1400,6 @@ dependencies = [ "rand_core", "sec1", "subtle", - "tap", "zeroize", ] @@ -1375,6 +1415,12 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "encoding_rs" version = "0.8.34" @@ -2002,6 +2048,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "goblin" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "group" version = "0.12.1" @@ -2608,9 +2665,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3585,6 +3642,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "plotters" version = "0.3.6" @@ -3638,11 +3701,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.6.6", + "zerocopy", ] [[package]] @@ -3655,6 +3718,20 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "prettytable-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" +dependencies = [ + "csv", + "encode_unicode 1.0.0", + "is-terminal", + "lazy_static", + "term", + "unicode-width", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -3748,34 +3825,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" -dependencies = [ - "bytes", - "prost-derive 0.13.1", + "prost-derive", ] [[package]] name = "prost-build" -version = "0.13.1" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck", - "itertools 0.13.0", + "itertools 0.12.1", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost 0.13.1", + "prost", "prost-types", "regex", "syn 2.0.72", @@ -3795,26 +3862,13 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "prost-derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" -dependencies = [ - "anyhow", - "itertools 0.13.0", - "proc-macro2", - "quote", - "syn 2.0.72", -] - [[package]] name = "prost-types" -version = "0.13.1" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.13.1", + "prost", ] [[package]] @@ -3834,16 +3888,17 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.0.0", "rustls 0.23.12", + "socket2", "thiserror", "tokio", "tracing", @@ -3851,14 +3906,14 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ "bytes", "rand", "ring 0.17.8", - "rustc-hash", + "rustc-hash 2.0.0", "rustls 0.23.12", "slab", "thiserror", @@ -3875,6 +3930,7 @@ dependencies = [ "libc", "once_cell", "socket2", + "tracing", "windows-sys 0.52.0", ] @@ -3983,9 +4039,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -4095,7 +4151,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls 0.23.12", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", "serde_json", @@ -4255,6 +4311,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -4329,9 +4391,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -4432,9 +4494,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.6" +version = "2.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ccfb12511cdb770157ace92d7dda771e498445b78f9886e8cdbc5140a4eced" +checksum = "8d777f59627453628a9a5be1ee8d948745b94b1dfc2d0c3099cbd9e08ab89e7c" dependencies = [ "sdd", ] @@ -4454,6 +4516,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "scrypt" version = "0.10.0" @@ -4580,9 +4662,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", "memchr", @@ -4699,9 +4781,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" dependencies = [ "cc", "cfg-if", @@ -4774,6 +4856,12 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "snowbridge-amcl" version = "1.0.2" @@ -4796,7 +4884,7 @@ dependencies = [ [[package]] name = "sp1-build" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anyhow", "cargo_metadata", @@ -4806,19 +4894,25 @@ dependencies = [ [[package]] name = "sp1-cli" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anstyle", "anyhow", + "capstone", "cargo_metadata", "clap", + "ctrlc", "dirs", "downloader", "futures-util", + "goblin", "hex", "indicatif", + "prettytable-rs", "rand", + "regex", "reqwest 0.12.5", + "rustc-demangle", "serde", "serde_json", "sp1-build", @@ -4827,6 +4921,7 @@ dependencies = [ "sp1-sdk", "target-lexicon", "tempfile", + "textwrap", "tokio", "vergen", "yansi", @@ -4834,7 +4929,7 @@ dependencies = [ [[package]] name = "sp1-core" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anyhow", "arrayref", @@ -4898,7 +4993,7 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "1.0.1" +version = "1.1.1" dependencies = [ "proc-macro2", "quote", @@ -4907,7 +5002,7 @@ dependencies = [ [[package]] name = "sp1-eval" -version = "1.0.1" +version = "1.1.1" dependencies = [ "clap", "csv", @@ -4918,7 +5013,7 @@ dependencies = [ [[package]] name = "sp1-helper" -version = "1.0.1" +version = "1.1.1" dependencies = [ "cargo_metadata", "chrono", @@ -4927,20 +5022,17 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anyhow", "bincode", "cfg-if", - "hex", - "k256", "serde", - "snowbridge-amcl", ] [[package]] name = "sp1-primitives" -version = "1.0.1" +version = "1.1.1" dependencies = [ "itertools 0.13.0", "lazy_static", @@ -4952,7 +5044,7 @@ dependencies = [ [[package]] name = "sp1-prover" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anyhow", "bincode", @@ -4988,7 +5080,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "1.0.1" +version = "1.1.1" dependencies = [ "bincode", "ff 0.13.0", @@ -5019,7 +5111,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit-v2" -version = "1.0.1" +version = "1.1.1" dependencies = [ "bincode", "ff 0.13.0", @@ -5057,7 +5149,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "1.0.1" +version = "1.1.1" dependencies = [ "backtrace", "itertools 0.13.0", @@ -5086,7 +5178,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "1.0.1" +version = "1.1.1" dependencies = [ "arrayref", "backtrace", @@ -5121,7 +5213,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core-v2" -version = "1.0.1" +version = "1.1.1" dependencies = [ "arrayref", "backtrace", @@ -5158,7 +5250,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "1.0.1" +version = "1.1.1" dependencies = [ "proc-macro2", "quote", @@ -5167,7 +5259,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-cli" -version = "1.0.1" +version = "1.1.1" dependencies = [ "bincode", "clap", @@ -5176,7 +5268,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "1.0.1" +version = "1.1.1" dependencies = [ "anyhow", "bincode", @@ -5200,7 +5292,7 @@ dependencies = [ [[package]] name = "sp1-recursion-program" -version = "1.0.1" +version = "1.1.1" dependencies = [ "itertools 0.13.0", "p3-air", @@ -5228,7 +5320,7 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "1.0.1" +version = "1.1.1" dependencies = [ "alloy-sol-types", "anyhow", @@ -5249,7 +5341,7 @@ dependencies = [ "p3-field", "p3-fri", "p3-matrix", - "prost 0.12.6", + "prost", "reqwest 0.12.5", "reqwest-middleware", "serde", @@ -5270,11 +5362,11 @@ dependencies = [ [[package]] name = "sp1-server" -version = "1.0.1" +version = "1.1.1" dependencies = [ "bincode", "ctrlc", - "prost 0.13.1", + "prost", "prost-build", "prost-types", "serde", @@ -5284,13 +5376,13 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "twirp", - "twirp-build", + "twirp-build-rs", + "twirp-rs", ] [[package]] name = "sp1-zkvm" -version = "1.0.1" +version = "1.1.1" dependencies = [ "bincode", "cfg-if", @@ -5487,16 +5579,39 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys 0.52.0", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.63" @@ -5843,30 +5958,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "twirp" -version = "0.5.0" -source = "git+https://github.com/github/twirp-rs.git#d99f5362200479842caef7de2fffda747812102e" -dependencies = [ - "async-trait", - "axum", - "futures", - "http 1.1.0", - "http-body-util", - "hyper 1.4.1", - "prost 0.13.1", - "reqwest 0.12.5", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "url", -] - -[[package]] -name = "twirp-build" -version = "0.6.0" -source = "git+https://github.com/github/twirp-rs.git#d99f5362200479842caef7de2fffda747812102e" +name = "twirp-build-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25019d8d3244a6a380f621129e4ed63a04bb91617effd46440405aad43588c40" dependencies = [ "prost-build", ] @@ -5884,7 +5979,7 @@ dependencies = [ "http 1.1.0", "http-body-util", "hyper 1.4.1", - "prost 0.12.6", + "prost", "reqwest 0.12.5", "serde", "serde_json", @@ -5936,6 +6031,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-normalization" version = "0.1.23" @@ -6205,11 +6306,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6255,6 +6356,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -6448,34 +6558,14 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -[[package]] -name = "zerocopy" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" -dependencies = [ - "byteorder", - "zerocopy-derive 0.6.6", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy-derive" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "byteorder", + "zerocopy-derive", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d4a32e4971..2da2095b96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ exclude = ["examples/target"] resolver = "2" [workspace.package] -version = "1.0.1" +version = "1.1.1" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/succinctlabs/sp1" @@ -44,25 +44,26 @@ debug = true debug-assertions = true [workspace.dependencies] -sp1-build = { path = "build", version = "1.0.1" } -sp1-derive = { path = "derive", version = "1.0.1" } -sp1-core = { path = "core", version = "1.0.1" } -sp1-cli = { path = "cli", version = "1.0.1", default-features = false } -sp1-eval = { path = "eval", version = "1.0.1", default-features = false } -sp1-helper = { path = "helper", version = "1.0.1", default-features = false } -sp1-primitives = { path = "primitives", version = "1.0.1" } -sp1-prover = { path = "prover", version = "1.0.1" } -sp1-recursion-compiler = { path = "recursion/compiler", version = "1.0.1" } -sp1-recursion-core = { path = "recursion/core", version = "1.0.1", default-features = false } -sp1-recursion-core-v2 = { path = "recursion/core-v2", version = "1.0.1", default-features = false } -sp1-recursion-derive = { path = "recursion/derive", version = "1.0.1", default-features = false } -sp1-recursion-gnark-ffi = { path = "recursion/gnark-ffi", version = "1.0.1", default-features = false } -sp1-recursion-program = { path = "recursion/program", version = "1.0.1", default-features = false } -sp1-recursion-circuit = { path = "recursion/circuit", version = "1.0.1", default-features = false } -sp1-recursion-circuit-v2 = { path = "recursion/circuit-v2", version = "1.0.1", default-features = false } -sp1-sdk = { path = "sdk", version = "1.0.1" } -sp1-lib = { path = "zkvm/lib", version = "1.0.1", default-features = false } -sp1-zkvm = { path = "zkvm/entrypoint", version = "1.0.1", default-features = false } +sp1-build = { path = "build", version = "1.1.1" } +sp1-derive = { path = "derive", version = "1.1.1" } +sp1-core = { path = "core", version = "1.1.1" } +sp1-cli = { path = "cli", version = "1.1.1", default-features = false } +sp1-eval = { path = "eval", version = "1.1.0", default-features = false } +sp1-helper = { path = "helper", version = "1.1.1", default-features = false } +sp1-primitives = { path = "primitives", version = "1.1.1" } +sp1-prover = { path = "prover", version = "1.1.1" } +sp1-recursion-compiler = { path = "recursion/compiler", version = "1.1.1" } +sp1-recursion-core = { path = "recursion/core", version = "1.1.1", default-features = false } +sp1-recursion-core-v2 = { path = "recursion/core-v2", version = "1.1.1", default-features = false } +sp1-recursion-derive = { path = "recursion/derive", version = "1.1.1", default-features = false } +sp1-recursion-gnark-ffi = { path = "recursion/gnark-ffi", version = "1.1.1", default-features = false } +sp1-recursion-program = { path = "recursion/program", version = "1.1.1", default-features = false } +sp1-recursion-circuit = { path = "recursion/circuit", version = "1.1.1", default-features = false } +sp1-recursion-circuit-v2 = { path = "recursion/circuit-v2", version = "1.1.1", default-features = false } +sp1-sdk = { path = "sdk", version = "1.1.1" } +sp1-server = { path = "server", version = "1.1.1" } +sp1-lib = { path = "zkvm/lib", version = "1.1.1", default-features = false } +sp1-zkvm = { path = "zkvm/entrypoint", version = "1.1.1", default-features = false } p3-air = "0.1.3-succinct" p3-field = "0.1.3-succinct" p3-commit = "0.1.3-succinct" diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b94340addd..77014462c3 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -11,12 +11,18 @@ cd core cargo test ``` +### Tips + +We recommend you install the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension. + +Note that if you use `cargo prove new` inside a monorepo, you will need to add the path to the Cargo.toml file to `rust-analyzer.linkedProjects` to get full IDE support. + **Debug Constraint Failure** -To debug constraint failures, you can use the `--features debug` feature alongside `--no-default-features` to eliminate the "perf" feature. For example: +To debug constraint failures, you can use the `--features debug` feature. For example: ``` -RUST_LOG=info RUST_BACKTRACE=1 cargo test syscall::precompiles::edwards::ed_add::tests::test_ed_add_simple --release --features debug --no-default-features -- --nocapture +RUST_LOG=info RUST_BACKTRACE=1 cargo test syscall::precompiles::edwards::ed_add::tests::test_ed_add_simple --release --features debug -- --nocapture ``` ## Contributing to Docs diff --git a/README.md b/README.md index 163fd5a4d3..d9f0b98e46 100644 --- a/README.md +++ b/README.md @@ -2,52 +2,28 @@ ![SP1](./assets/sp1.png) -SP1 is a performant, 100% open-source, contributor-friendly zero-knowledge virtual machine (zkVM) that can prove the execution of arbitrary Rust (or any LLVM-compiled language) programs. SP1 democratizes access to ZKPs by allowing developers to use programmable truth with popular programming languages. - -SP1 is inspired by the open-source software movement and takes a collaborative approach towards building the best zkVM for rollups, coprocessors and other ZKP applications. We envision a diversity of contributors integrating the latest ZK innovations, creating a zkVM that is _performant_, _customizable_ and will stand the _test of time_. +SP1 is the fastest, most-feature complete zero-knowledge virtual machine (zkVM) that can prove the execution of arbitrary Rust (or any LLVM-compiled language) programs. SP1 makes ZK accessible to *any developer*, by making it easy to write ZKP programs in normal Rust code. **[Install](https://succinctlabs.github.io/sp1/getting-started/install.html)** | [Docs](https://succinctlabs.github.io/sp1) | [Examples](https://github.com/succinctlabs/sp1/tree/main/examples) | [Telegram Chat](https://t.me/+AzG4ws-kD24yMGYx) -## For Developers: Build with SP1 +## Getting Started -Today, developers can write programs, including complex, large programs like a ZK Tendermint light client, in Rust (with std support), generate proofs and verify them. Most Rust crates should be supported and can be used seamlessly by your program. Example programs can be found in the [examples](https://github.com/succinctlabs/sp1/tree/main/examples) folder. +Today, developers can write programs, including complex, large programs like a ZK Tendermint light client or type-1 zkEVM using Reth, in Rust (with std support), generate proofs and verify them. Most Rust crates should be supported and can be used seamlessly by your program. Example programs can be found in the [examples](https://github.com/succinctlabs/sp1/tree/main/examples) folder. To get started, make sure you have [Rust](https://www.rust-lang.org/tools/install) installed. Then follow the [installation](https://succinctlabs.github.io/sp1/getting-started/install.html) guide in the SP1 book and read the [getting started](https://succinctlabs.github.io/sp1/getting-started/quickstart.html) section. -For developers looking for inspiration on what to build, check out the open issues with the [showcase](https://github.com/succinctlabs/sp1/issues?q=is%3Aopen+is%3Aissue+label%3Ashowcase) label to see what sorts of programs that showcase the capabilities of SP1 are interesting to hack on. - -## For Contributors - -Open-source is a core part of SP1's ethos and key to its advantages. We wish to cultivate a vibrant community of open-source contributors that span individuals, teams and geographies. If you want to contribute, or follow along with contributor discussion, you can use our main Telegram to chat with us. Our contributor guidelines can be found in [CONTRIBUTING.md](./CONTRIBUTING.md). - -Find a list of [good first issues](https://github.com/succinctlabs/sp1/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+) in the open issues of this repo. We are always looking for contributors interested in tasks big and small, including minor chores across the codebase, optimizing performance, adding precompiles for commonly used cryptographic operations, adding documentation, creating new example programs and more. Please reach out in the Telegram chat if interested! - -## Roadmap - -Today, SP1 can generate and verify proofs for Rust programs that have been compiled to RISC-V. SP1 supports proving of programs of arbitrary length by using a unique "shared challenges" argument that allows the prover to shard a long computation into small shards, and then generate a global proof that these shards are properly connected together. - -The main priorities in the next few months are performance optimizations, getting the core zkVM -constraint logic audited, as well as wrapping the SP1 STARK proof into a SNARK proof that is cheaply -verifiable in the EVM (by adapting similar [previous -work](https://github.com/succinctlabs/gnark-plonky2-verifier) done by the Succinct Team). - -## Acknowledgements +## Security -We would like to acknowledge the projects below whose previous work has been instrumental in making this project a reality: +SP1 has undergone audits from [Veridise](https://www.veridise.com/), [Cantina](https://cantina.xyz/), +and [KALOS](https://kalos.xyz/) and is recommended for production use. The audit reports are available [here](./audits). -- [Plonky3](https://github.com/Plonky3/Plonky3): The SP1's prover is powered by the Plonky3 toolkit. -- [Valida](https://github.com/valida-xyz/valida): The SP1 cross-table lookup architecture, prover, borrow macro, and chip design are inspired by Valida. -- [RISC0](https://github.com/risc0/risc0): The SP1 Rust toolchain and install/build scripts for the toolchain borrow code from RISC0. -## Security +## For Contributors -SP1 has undergone audits from [Veridise](https://www.veridise.com/), [Cantina](https://cantina.xyz/), -and [KALOS](https://kalos.xyz/). The audit reports are available [here](./audits). +Open-source is a core part of SP1's ethos and key to its advantages. We wish to cultivate a vibrant community of open-source contributors that span individuals, teams and geographies. If you want to contribute, or follow along with contributor discussion, you can use our main Telegram to chat with us. Our contributor guidelines can be found in [CONTRIBUTING.md](./CONTRIBUTING.md). A quick overview of development tips can be found in [DEVELOPMENT.md](./DEVELOPMENT.md). -## Tips +We are always looking for contributors interested in tasks big and small, including minor chores across the codebase, optimizing performance, adding precompiles for commonly used cryptographic operations, adding documentation, creating new example programs and more. Please reach out in the Telegram chat if interested! -We recommend you install the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension. -Note that if you use `cargo prove new` inside a monorepo, you will need to add the manifest file to `rust-analyzer.linkedProjects` to get full IDE support. diff --git a/assets/sp1.png b/assets/sp1.png index 86bf73e4a8..abe8a23b8e 100644 Binary files a/assets/sp1.png and b/assets/sp1.png differ diff --git a/book/SUMMARY.md b/book/SUMMARY.md index e1b6d0a19e..ba86732689 100644 --- a/book/SUMMARY.md +++ b/book/SUMMARY.md @@ -14,7 +14,7 @@ - [Project Template](./getting-started/project-template.md) -- [Hardware Requirements](./getting-started/hardware-requirements.md) +- [Proof Generation Requirements](./getting-started/hardware-requirements.md) # Writing Programs @@ -22,17 +22,18 @@ - [Basics](./writing-programs/basics.md) -- [Inputs & Outputs](./writing-programs/inputs-and-outputs.md) +- [Compiling Programs](./writing-programs/compiling.md) -- [Precompiles](./writing-programs/precompiles.md) +- [Inputs & Outputs](./writing-programs/inputs-and-outputs.md) - [Patched Crates](./writing-programs/patched-crates.md) +- [Precompiles](./writing-programs/precompiles.md) + - [Cycle Tracking](./writing-programs/cycle-tracking.md) - [Proof Aggregation](./writing-programs/proof-aggregation.md) -- [Build Script](./writing-programs/build-script.md) # Generating Proofs @@ -40,34 +41,34 @@ - [Basics](./generating-proofs/basics.md) -- [Prover Options](./generating-proofs/prover-options.md) +- [Proof Types](./generating-proofs/proof-types.md) + +- [Recommended Workflow](./generating-proofs/recommended-workflow.md) -- [Development Options](./generating-proofs/development-options.md) +- [Prover Network Beta](./generating-proofs/prover-network.md) + - [Usage](./generating-proofs/prover-network/usage.md) + - [Supported Versions](./generating-proofs/prover-network/versions.md) + +- [FAQ](./generating-proofs/sp1-sdk-faq.md) -- [Optimizing Performance](./generating-proofs/optimizing-performance.md) # Onchain Verification - [Setup](./onchain-verification/getting-started.md) -- [Solidity SDK](./onchain-verification/solidity-sdk.md) +- [Solidity Verifier](./onchain-verification/solidity-sdk.md) - [Contract Addresses](./onchain-verification/contract-addresses.md) -# Prover Network - -- [Setup](./prover-network/setup.md) - -- [Usage](./prover-network/usage.md) - -- [Supported Versions](./prover-network/versions.md) # Developers +- [Common Issues](./developers/common-issues.md) + - [Usage in CI](./developers/usage-in-ci.md) +- [RV32IM Specification](./developers/rv32im-specification.md) + - [Building PLONK Artifacts](./developers/building-plonk-artifacts.md) -- [Common Issues](./developers/common-issues.md) -- [RV32IM Specification](./developers/rv32im-specification.md) diff --git a/book/developers/common-issues.md b/book/developers/common-issues.md index ad65d124ac..e88d099483 100644 --- a/book/developers/common-issues.md +++ b/book/developers/common-issues.md @@ -1,5 +1,15 @@ # Common Issues +## Bus Error + +If you are running a executable that uses the `sp1-sdk` crate, you may encounter a bus error like this: + +```txt +zsh: bus error +``` + +This is fixed by running with the `--release` flag, as the `sp1-sdk` crate only supports release builds as of right now. + ## Alloy Errors If you are using a library that depends on `alloy_sol_types`, and encounter an error like this: @@ -12,25 +22,23 @@ This is likely due to two different versions of `alloy_sol_types` being used. To ```toml [dependencies] -sp1-sdk = { version = "1.0.1", default-features = false } +sp1-sdk = { version = "1.1.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`. ## Rust Version Errors -If you are using `alloy` or another library that has an MSRV (minimum support rust version) of 1.76.0 +If you are using `alloy` or another library that has an MSRV (minimum supported rust version) of 1.76.0 or higher, you may encounter an error like this when building your program. ```txt package `alloy v0.1.1 cannot be built because it requires rustc 1.76 or newer, while the currently active rustc version is 1.75.0-nightly` ``` -This is due to the fact that the Succinct Rust toolchain is built with version 1.75, which is older -than the MSRV of the `alloy` crate. Note: Once the Succinct Rust toolchain is updated, this error will -go away. +This is due to the fact that the Succinct Rust toolchain might be built with a lower version than the MSRV of the crates you are using. You can check the version of the Succinct Rust toolchain by running `cargo +succinct --version`. If we have released a more recent version of the Succinct Rust toolchain, you can update it by running `sp1up` again to update the toolchain and CLI to the latest version. -To fix this, you can: +You can also fix this issue with the following: - If using `cargo prove build` directly, pass the `--ignore-rust-version` flag: @@ -38,7 +46,7 @@ To fix this, you can: cargo prove build --ignore-rust-version ``` -- If using `build_program`, set `ignore_rust_version` to true inside the `BuildArgs` struct and use +- If using `build_program` in an `build.rs` file with the `sp1-build` crate, set `ignore_rust_version` to true inside the `BuildArgs` struct and use `build_program_with_args`: ```rust @@ -64,6 +72,8 @@ Segmentation fault (core dumped) Re-run your script with `--release`. +Note that the core `sp1-core` library and `sp1-recursion` require being compiled with the `release` profile. + ## C Binding Errors If you are building a program that uses C bindings or has dependencies that use C bindings, you may encounter the following errors: diff --git a/book/developers/rv32im-specification.md b/book/developers/rv32im-specification.md index eff0d8f665..84e8aa7584 100644 --- a/book/developers/rv32im-specification.md +++ b/book/developers/rv32im-specification.md @@ -4,5 +4,5 @@ SP1 implements the RISC-V RV32IM instruction set with some implementation detail - LW/SW memory access must be word aligned. - LH/LHU/SH memory access must be half-word aligned. -- Memory access is only valid for addresses [0x20, 0x78000000]. Accessing addresses outside of this range will result in undefined behavior. The global heap allocator in `sp1_zkvm` will panic if memory exceeds this range. -- The ECALL instruction is used for system calls and precompiles. Only valid syscall IDs should be called, and only using the specific convention of loading the ID into register T0 and arguments into registers A0 and A1. If the arguments are addresses, they must be word-aligned. Failure to follow this convention can result in UB. Correct usages can be found in the `sp1_zkvm` crate. +- Memory access is only valid for addresses `0x20, 0x78000000`. Accessing addresses outside of this range will result in undefined behavior. The global heap allocator in `sp1_zkvm` will panic if memory exceeds this range. +- The ECALL instruction is used for system calls and precompiles. Only valid syscall IDs should be called, and only using the specific convention of loading the ID into register T0 and arguments into registers A0 and A1. If the arguments are addresses, they must be word-aligned. Failure to follow this convention can result in undefined behavior. Correct usages can be found in the `sp1_zkvm` and `sp1_lib` crates. diff --git a/book/generating-proofs/advanced.md b/book/generating-proofs/advanced.md index cff65d9d85..2d17439012 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.0.1", features = ["neon"] } +sp1-sdk = { version = "1.1.0", features = ["neon"] } ``` ## Performance diff --git a/book/generating-proofs/basics.md b/book/generating-proofs/basics.md index ebae7128dd..06a3383ff0 100644 --- a/book/generating-proofs/basics.md +++ b/book/generating-proofs/basics.md @@ -1,6 +1,6 @@ # Generating Proofs: Basics -All the methods you'll need for generating proofs are included in the `sp1_sdk` crate. Most importantly, you'll need to use the `ProverClient` to setup a proving key and verifying key for your program and then use the `prove` and `verify` methods to generate and verify proofs. +All the methods you'll need for generating proofs are included in the `sp1_sdk` crate. Most importantly, you'll need to use the `ProverClient` to setup a proving key and verifying key for your program and then use the `execute`, `prove` and `verify` methods to execute your program, and generate and verify proofs. To make this more concrete, let's walk through a simple example of generating a proof for a Fiboancci program inside the zkVM. @@ -10,4 +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`. \ No newline at end of file +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. + +
{
+ /// Waits for a proof to be generated and returns the proof. If a timeout is supplied, the
+ /// function will return an error if the proof is not generated within the timeout.
+ pub async fn wait_proof {
let client = &self.client;
let mut is_claimed = false;
+ let start_time = Instant::now();
loop {
+ if let Some(timeout) = timeout {
+ if start_time.elapsed() > timeout {
+ return Err(anyhow::anyhow!("Proof generation timed out."));
+ }
+ }
+
let (status, maybe_proof) = client.get_proof_status:: (proof_id).await?;
match status.status() {
@@ -117,9 +130,10 @@ impl NetworkProver {
elf: &[u8],
stdin: SP1Stdin,
mode: ProofMode,
+ timeout: Option