diff --git a/Cargo.lock b/Cargo.lock
index 4ab1ead07f..88688ab42e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -119,7 +119,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -131,11 +131,11 @@ dependencies = [
"alloy-sol-macro-input",
"const-hex",
"heck",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"syn-solidity",
"tiny-keccak",
]
@@ -151,7 +151,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"syn-solidity",
]
@@ -399,7 +399,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -427,7 +427,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -571,7 +571,7 @@ dependencies = [
"regex",
"rustc-hash 1.1.0",
"shlex",
- "syn 2.0.72",
+ "syn 2.0.74",
"which",
]
@@ -715,9 +715,9 @@ dependencies = [
[[package]]
name = "camino"
-version = "1.1.7"
+version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
+checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb"
dependencies = [
"serde",
]
@@ -773,12 +773,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.1.7"
+version = "1.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
+checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7"
dependencies = [
"jobserver",
"libc",
+ "shlex",
]
[[package]]
@@ -798,9 +799,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cfg_aliases"
-version = "0.1.1"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
+checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
@@ -865,9 +866,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.13"
+version = "4.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
+checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019"
dependencies = [
"clap_builder",
"clap_derive",
@@ -875,9 +876,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.13"
+version = "4.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
+checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6"
dependencies = [
"anstream",
"anstyle",
@@ -894,7 +895,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1023,15 +1024,15 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.8.6"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpufeatures"
-version = "0.2.12"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
+checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad"
dependencies = [
"libc",
]
@@ -1157,12 +1158,12 @@ dependencies = [
[[package]]
name = "ctrlc"
-version = "3.4.4"
+version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345"
+checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3"
dependencies = [
"nix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -1188,7 +1189,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1212,7 +1213,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1223,7 +1224,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1267,7 +1268,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc_version 0.4.0",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1596,7 +1597,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
- "syn 2.0.72",
+ "syn 2.0.74",
"toml",
"walkdir",
]
@@ -1614,7 +1615,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde_json",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1640,7 +1641,7 @@ dependencies = [
"serde",
"serde_json",
"strum",
- "syn 2.0.72",
+ "syn 2.0.74",
"tempfile",
"thiserror",
"tiny-keccak",
@@ -1921,7 +1922,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -2094,7 +2095,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http 0.2.12",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"slab",
"tokio",
"tokio-util",
@@ -2113,7 +2114,7 @@ dependencies = [
"futures-core",
"futures-sink",
"http 1.1.0",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"slab",
"tokio",
"tokio-util",
@@ -2191,6 +2192,12 @@ version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+[[package]]
+name = "hermit-abi"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
+
[[package]]
name = "hex"
version = "0.4.3"
@@ -2384,9 +2391,9 @@ dependencies = [
[[package]]
name = "hyper-util"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
+checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9"
dependencies = [
"bytes",
"futures-channel",
@@ -2498,9 +2505,9 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.3.0"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
+checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c"
dependencies = [
"equivalent",
"hashbrown 0.14.5",
@@ -2546,11 +2553,11 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
[[package]]
name = "is-terminal"
-version = "0.4.12"
+version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
+checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b"
dependencies = [
- "hermit-abi",
+ "hermit-abi 0.4.0",
"libc",
"windows-sys 0.52.0",
]
@@ -2605,9 +2612,9 @@ dependencies = [
[[package]]
name = "js-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
dependencies = [
"wasm-bindgen",
]
@@ -2690,9 +2697,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.155"
+version = "0.2.156"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a"
[[package]]
name = "libgit2-sys"
@@ -2734,9 +2741,9 @@ dependencies = [
[[package]]
name = "libz-sys"
-version = "1.1.18"
+version = "1.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e"
+checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647"
dependencies = [
"cc",
"libc",
@@ -2816,11 +2823,11 @@ dependencies = [
[[package]]
name = "mio"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
+checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
dependencies = [
- "hermit-abi",
+ "hermit-abi 0.3.9",
"libc",
"wasi",
"windows-sys 0.52.0",
@@ -2851,9 +2858,9 @@ dependencies = [
[[package]]
name = "nix"
-version = "0.28.0"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
"bitflags 2.6.0",
"cfg-if",
@@ -2995,7 +3002,7 @@ version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
- "hermit-abi",
+ "hermit-abi 0.3.9",
"libc",
]
@@ -3038,7 +3045,7 @@ dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3058,9 +3065,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "object"
-version = "0.36.2"
+version = "0.36.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
+checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
dependencies = [
"memchr",
]
@@ -3131,7 +3138,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3581,7 +3588,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
]
[[package]]
@@ -3611,7 +3618,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3715,7 +3722,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e"
dependencies = [
"proc-macro2",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3845,7 +3852,7 @@ dependencies = [
"prost",
"prost-types",
"regex",
- "syn 2.0.72",
+ "syn 2.0.74",
"tempfile",
]
@@ -3859,7 +3866,7 @@ dependencies = [
"itertools 0.12.1",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4174,9 +4181,9 @@ dependencies = [
[[package]]
name = "reqwest-middleware"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39346a33ddfe6be00cbc17a34ce996818b97b230b87229f10114693becca1268"
+checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04"
dependencies = [
"anyhow",
"async-trait",
@@ -4401,9 +4408,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
-version = "1.7.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
+checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0"
[[package]]
name = "rustls-webpki"
@@ -4494,9 +4501,9 @@ dependencies = [
[[package]]
name = "scc"
-version = "2.1.8"
+version = "2.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d777f59627453628a9a5be1ee8d948745b94b1dfc2d0c3099cbd9e08ab89e7c"
+checksum = "c478f373151538826ed50feaceeef7095ad435065a48153af789005fd5e44c0d"
dependencies = [
"sdd",
]
@@ -4533,7 +4540,7 @@ checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4560,9 +4567,9 @@ dependencies = [
[[package]]
name = "sdd"
-version = "2.1.0"
+version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "177258b64c0faaa9ffd3c65cd3262c2bc7e2588dbbd9c1641d0346145c1bbda8"
+checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f"
[[package]]
name = "sec1"
@@ -4642,29 +4649,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
-version = "1.0.207"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2"
+checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.207"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e"
+checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
name = "serde_json"
-version = "1.0.122"
+version = "1.0.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
+checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed"
dependencies = [
"itoa",
"memchr",
@@ -4713,7 +4720,7 @@ dependencies = [
"chrono",
"hex",
"indexmap 1.9.3",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"serde",
"serde_derive",
"serde_json",
@@ -4730,7 +4737,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4755,7 +4762,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5028,6 +5035,27 @@ dependencies = [
"web-time",
]
+[[package]]
+name = "sp1-cuda"
+version = "1.1.1"
+dependencies = [
+ "bincode",
+ "ctrlc",
+ "prost",
+ "prost-build",
+ "prost-types",
+ "serde",
+ "serde_json",
+ "sp1-core-machine",
+ "sp1-prover",
+ "sp1-stark",
+ "tokio",
+ "tracing",
+ "tracing-subscriber",
+ "twirp-build-rs",
+ "twirp-rs",
+]
+
[[package]]
name = "sp1-curves"
version = "1.1.1"
@@ -5327,6 +5355,7 @@ dependencies = [
"sha2",
"sp1-core-executor",
"sp1-core-machine",
+ "sp1-cuda",
"sp1-prover",
"sp1-stark",
"strum",
@@ -5340,27 +5369,6 @@ dependencies = [
"vergen",
]
-[[package]]
-name = "sp1-server"
-version = "1.1.1"
-dependencies = [
- "bincode",
- "ctrlc",
- "prost",
- "prost-build",
- "prost-types",
- "serde",
- "serde_json",
- "sp1-core-machine",
- "sp1-prover",
- "sp1-stark",
- "tokio",
- "tracing",
- "tracing-subscriber",
- "twirp-build-rs",
- "twirp-rs",
-]
-
[[package]]
name = "sp1-stark"
version = "1.1.1"
@@ -5475,7 +5483,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5506,9 +5514,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.72"
+version = "2.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
+checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7"
dependencies = [
"proc-macro2",
"quote",
@@ -5524,7 +5532,7 @@ dependencies = [
"paste",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5589,15 +5597,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tempfile"
-version = "3.11.0"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53"
+checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64"
dependencies = [
"cfg-if",
"fastrand",
"once_cell",
"rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -5639,7 +5647,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5745,7 +5753,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5819,7 +5827,7 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"toml_datetime",
"winnow 0.5.40",
]
@@ -5830,7 +5838,7 @@ version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"toml_datetime",
"winnow 0.5.40",
]
@@ -5841,7 +5849,7 @@ version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"serde",
"serde_spanned",
"toml_datetime",
@@ -5866,15 +5874,15 @@ dependencies = [
[[package]]
name = "tower-layer"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-service"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
@@ -5896,7 +5904,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -6174,34 +6182,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
dependencies = [
"cfg-if",
+ "once_cell",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.42"
+version = "0.4.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0"
+checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
dependencies = [
"cfg-if",
"js-sys",
@@ -6211,9 +6220,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -6221,22 +6230,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]]
name = "wasm-streams"
@@ -6253,9 +6262,9 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
+checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -6586,7 +6595,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -6606,7 +6615,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index f35836e651..d67e00f3a3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,6 +12,7 @@ members = [
"crates/cli",
"crates/core/executor",
"crates/core/machine",
+ "crates/cuda",
"crates/curves",
"crates/derive",
"crates/helper",
@@ -25,7 +26,6 @@ members = [
"crates/recursion/gnark-ffi",
"crates/recursion/program",
"crates/sdk",
- "crates/server",
"crates/stark",
"crates/zkvm/*",
]
@@ -50,6 +50,7 @@ sp1-core-machine = { path = "crates/core/machine", version = "1.1.1" }
sp1-core-executor = { path = "crates/core/executor", version = "1.1.1" }
sp1-derive = { path = "crates/derive", version = "1.1.1" }
sp1-cli = { path = "crates/cli", version = "1.1.1", default-features = false }
+sp1-cuda = { path = "crates/cuda", version = "1.1.1" }
sp1-curves = { path = "crates/curves", version = "1.1.1" }
sp1-helper = { path = "crates/helper", version = "1.1.1", default-features = false }
sp1-primitives = { path = "crates/primitives", version = "1.1.1" }
@@ -61,7 +62,6 @@ sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "1.1.
sp1-recursion-program = { path = "crates/recursion/program", version = "1.1.1", default-features = false }
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "1.1.1", default-features = false }
sp1-sdk = { path = "crates/sdk", version = "1.1.1" }
-sp1-server = { path = "crates/server", version = "1.1.1" }
sp1-stark = { path = "crates/stark", version = "1.1.1" }
sp1-lib = { path = "crates/zkvm/lib", version = "1.1.1", default-features = false }
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "1.1.1", default-features = false }
diff --git a/book/SUMMARY.md b/book/SUMMARY.md
index ba86732689..270016e8f1 100644
--- a/book/SUMMARY.md
+++ b/book/SUMMARY.md
@@ -49,8 +49,11 @@
- [Usage](./generating-proofs/prover-network/usage.md)
- [Supported Versions](./generating-proofs/prover-network/versions.md)
-- [FAQ](./generating-proofs/sp1-sdk-faq.md)
+- [Hardware Acceleration](./generating-proofs/hardware-acceleration.md)
+ - [AVX](./generating-proofs/hardware-acceleration/avx.md)
+ - [CUDA](./generating-proofs/hardware-acceleration/cuda.md)
+- [FAQ](./generating-proofs/sp1-sdk-faq.md)
# Onchain Verification
diff --git a/book/generating-proofs/hardware-acceleration.md b/book/generating-proofs/hardware-acceleration.md
new file mode 100644
index 0000000000..766c9db4ed
--- /dev/null
+++ b/book/generating-proofs/hardware-acceleration.md
@@ -0,0 +1,7 @@
+# Hardware Acceleration
+
+SP1 supports hardware acceleration on the following platforms:
+- [AVX256/AVX512](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) on x86 CPUs
+- [CUDA](https://en.wikipedia.org/wiki/CUDA) on Nvidia GPUs
+
+To enable hardware acceleration, please refer to the platform specific instructions available in this section.
\ No newline at end of file
diff --git a/book/generating-proofs/hardware-acceleration/avx.md b/book/generating-proofs/hardware-acceleration/avx.md
new file mode 100644
index 0000000000..e9fe8007bf
--- /dev/null
+++ b/book/generating-proofs/hardware-acceleration/avx.md
@@ -0,0 +1,30 @@
+# AVX
+
+SP1 supports both AVX256 and AVX512 acceleration on x86 CPUs due to support in [Plonky3](https://github.com/Plonky3/Plonky3).
+Whenever possible, we recommend using AVX512 acceleration as it provides better performance.
+
+## Checking for AVX
+
+To check if your CPU supports AVX, you can run the following command:
+
+`grep avx /proc/cpuinfo`
+
+Look for the flags `avx2` and `avx512`.
+
+## Enabling AVX256
+
+To enable AVX256 acceleration, you can set the `RUSTFLAGS` environment variable to include the following flags:
+
+```bash
+RUSTFLAGS="-C target-cpu=native" cargo run --release
+```
+
+## Enabling AVX512
+
+To enable AVX512 acceleration, you can set the `RUSTFLAGS` environment variable to include the following flags:
+
+```bash
+RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo run --release
+```
+
+Note that the `+avx512f` flag is required to enable AVX512 acceleration.
\ No newline at end of file
diff --git a/book/generating-proofs/hardware-acceleration/cuda.md b/book/generating-proofs/hardware-acceleration/cuda.md
new file mode 100644
index 0000000000..e27d0ce9ac
--- /dev/null
+++ b/book/generating-proofs/hardware-acceleration/cuda.md
@@ -0,0 +1,26 @@
+# CUDA
+
+
+WARNING: CUDA proving is still an experimental feature and may be buggy.
+
+
+
+SP1 supports CUDA acceleration, which can provide dramatically better latency and cost performance
+compared to using the CPU prover, even with AVX acceleration.
+
+## Software Requirements
+
+Please make sure you have the following installed before using the CUDA prover:
+
+- [CUDA 12](https://developer.nvidia.com/cuda-12-0-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local)
+- [CUDA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
+
+## Hardware Requirements
+
+- **CPU**: We recommend having at least 8 CPU cores with 32GB of RAM available to fully utilize the GPU.
+- **GPU**: 24GB or more for core/compressed proofs, 40GB or more for shrink/wrap proofs
+
+## Usage
+
+To use the CUDA prover, you can compile the `sp1-sdk` crate with the `cuda` feature enabled. You
+can use the normal methods on the `ProverClient` to generate proofs.
\ No newline at end of file
diff --git a/book/generating-proofs/sp1-sdk-faq.md b/book/generating-proofs/sp1-sdk-faq.md
index fcfdfe678e..76e62d81e4 100644
--- a/book/generating-proofs/sp1-sdk-faq.md
+++ b/book/generating-proofs/sp1-sdk-faq.md
@@ -12,23 +12,4 @@ Example of setting the logging level to `info` (other options are `debug`, `trac
```bash
RUST_LOG=info cargo run --release
-```
-
-
-## Optimize Local Proving with CPU Acceleration
-
-SP1 supports CPU hardware acceleration using AVX256/512 and NEON SIMD instructions. To enable the acceleration, you can use the `RUSTFLAGS` environment variable to generate code that is optimized for your CPU.
-
-**AVX2 / NEON**:
-```bash
-RUSTFLAGS='-C target-cpu=native' cargo run --release
-```
-
-**AVX512**:
-```bash
-RUSTFLAGS='-C target-cpu=native -C target_feature=+avx512ifma,+avx512vl' cargo run --release
-```
-
-## GPU Proving
-
-Note that SP1 has a GPU prover that is currently in beta, but it is not yet supported in the `sp1-sdk` crate and has experimental support in the `sp1-prover` crate. Our prover network currently runs the SP1 GPU prover, so the recommended way to generate proofs with GPU is via the prover network.
\ No newline at end of file
+```
\ No newline at end of file
diff --git a/crates/core/machine/src/utils/logger.rs b/crates/core/machine/src/utils/logger.rs
index da546443c6..c460a31628 100644
--- a/crates/core/machine/src/utils/logger.rs
+++ b/crates/core/machine/src/utils/logger.rs
@@ -15,6 +15,7 @@ pub fn setup_logger() {
let default_filter = "off";
let env_filter = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| EnvFilter::new(default_filter))
+ .add_directive("hyper=off".parse().unwrap())
.add_directive("p3_keccak_air=off".parse().unwrap())
.add_directive("p3_fri=off".parse().unwrap())
.add_directive("p3_dft=off".parse().unwrap())
diff --git a/crates/server/CHANGELOG.md b/crates/cuda/CHANGELOG.md
similarity index 100%
rename from crates/server/CHANGELOG.md
rename to crates/cuda/CHANGELOG.md
diff --git a/crates/server/Cargo.toml b/crates/cuda/Cargo.toml
similarity index 98%
rename from crates/server/Cargo.toml
rename to crates/cuda/Cargo.toml
index c8ae0dbc51..de5ba16d46 100644
--- a/crates/server/Cargo.toml
+++ b/crates/cuda/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "sp1-server"
+name = "sp1-cuda"
description = "SP1 is a performant, 100% open-source, contributor-friendly zkVM."
readme = "../README.md"
version = { workspace = true }
diff --git a/crates/server/build.rs b/crates/cuda/build.rs
similarity index 100%
rename from crates/server/build.rs
rename to crates/cuda/build.rs
diff --git a/crates/cuda/proto/api.proto b/crates/cuda/proto/api.proto
new file mode 100644
index 0000000000..c5e078676b
--- /dev/null
+++ b/crates/cuda/proto/api.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+
+package api;
+
+service ProverService {
+ rpc Ready(ReadyRequest) returns (ReadyResponse) {}
+ rpc ProveCore(ProveCoreRequest) returns (ProveCoreResponse) {}
+ rpc Compress(CompressRequest) returns (CompressResponse) {}
+ rpc Shrink(ShrinkRequest) returns (ShrinkResponse) {}
+ rpc Wrap(WrapRequest) returns (WrapResponse) {}
+}
+
+message ReadyRequest {}
+
+message ReadyResponse {
+ bool ready = 1;
+}
+
+message ProveCoreRequest {
+ bytes data = 1;
+}
+
+message ProveCoreResponse {
+ bytes result = 1;
+}
+
+message CompressRequest {
+ bytes data = 1;
+}
+
+message CompressResponse {
+ bytes result = 1;
+}
+
+message ShrinkRequest {
+ bytes data = 1;
+}
+
+message ShrinkResponse {
+ bytes result = 1;
+}
+
+message WrapRequest {
+ bytes data = 1;
+}
+
+message WrapResponse {
+ bytes result = 1;
+}
\ No newline at end of file
diff --git a/crates/server/src/lib.rs b/crates/cuda/src/lib.rs
similarity index 51%
rename from crates/server/src/lib.rs
rename to crates/cuda/src/lib.rs
index 733867b32c..beff130dd3 100644
--- a/crates/server/src/lib.rs
+++ b/crates/cuda/src/lib.rs
@@ -4,22 +4,26 @@ pub mod proto {
}
use core::time::Duration;
-use std::{
- process::{Command, Stdio},
- sync::{
- atomic::{AtomicBool, Ordering},
- Arc,
- },
-};
+use std::io::BufReader;
+use std::io::Read;
+use std::io::Write;
+use std::process::Command;
+use std::process::Stdio;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
use crate::proto::api::ProverServiceClient;
+use proto::api::ReadyRequest;
use serde::{Deserialize, Serialize};
use sp1_core_machine::{io::SP1Stdin, utils::SP1CoreProverError};
-use sp1_prover::{
- types::SP1ProvingKey, InnerSC, SP1CoreProof, SP1RecursionProverError, SP1ReduceProof,
- SP1VerifyingKey,
-};
+use sp1_prover::types::SP1ProvingKey;
+use sp1_prover::InnerSC;
+use sp1_prover::OuterSC;
+use sp1_prover::SP1CoreProof;
+use sp1_prover::SP1RecursionProverError;
+use sp1_prover::SP1ReduceProof;
+use sp1_prover::SP1VerifyingKey;
use sp1_stark::ShardProof;
use tokio::runtime::Runtime;
use twirp::{url::Url, Client};
@@ -29,7 +33,7 @@ use twirp::{url::Url, Client};
/// This is currently used to provide experimental support for GPU hardware acceleration.
///
/// **WARNING**: This is an experimental feature and may not work as expected.
-pub struct SP1ProverServer {
+pub struct SP1CudaProver {
/// The gRPC client to communicate with the container.
client: Client,
/// The name of the container.
@@ -62,42 +66,78 @@ pub struct CompressRequestPayload {
pub deferred_proofs: Vec>,
}
-impl SP1ProverServer {
+/// The payload for the [sp1_prover::SP1Prover::shrink] method.
+///
+/// We use this object to serialize and deserialize the payload from the client to the server.
+#[derive(Serialize, Deserialize)]
+pub struct ShrinkRequestPayload {
+ pub reduced_proof: SP1ReduceProof,
+}
+
+/// The payload for the [sp1_prover::SP1Prover::wrap_bn254] method.
+///
+/// We use this object to serialize and deserialize the payload from the client to the server.
+#[derive(Serialize, Deserialize)]
+pub struct WrapRequestPayload {
+ pub reduced_proof: SP1ReduceProof,
+}
+
+impl SP1CudaProver {
/// Creates a new [SP1Prover] that runs inside a Docker container and returns a
/// [SP1ProverClient] that can be used to communicate with the container.
pub fn new() -> Self {
let container_name = "sp1-gpu";
- let image_name = "jtguibas/sp1-gpu:v1.1.5";
+ let image_name = "jtguibas/sp1-gpu:v1.2.0";
let cleaned_up = Arc::new(AtomicBool::new(false));
let cleanup_name = container_name;
let cleanup_flag = cleaned_up.clone();
- // Spawn a new thread to start the Docker container.
+ // Pull the docker image if it's not present.
+ Command::new("sudo")
+ .args(["docker", "pull", image_name])
+ .output()
+ .expect("failed to pull docker image");
+
+ // Start the docker container.
+ let rust_log_level = std::env::var("RUST_LOG").unwrap_or("none".to_string());
+ let mut child = Command::new("sudo")
+ .args([
+ "docker",
+ "run",
+ "-e",
+ format!("RUST_LOG={}", rust_log_level).as_str(),
+ "-p",
+ "3000:3000",
+ "--rm",
+ "--runtime=nvidia",
+ "--gpus",
+ "all",
+ "--name",
+ container_name,
+ image_name,
+ ])
+ .stdout(Stdio::piped())
+ .spawn()
+ .expect("failed to start Docker container");
+
+ let stdout = child.stdout.take().unwrap();
std::thread::spawn(move || {
- Command::new("sudo")
- .args([
- "docker",
- "run",
- "-e",
- "RUST_LOG=debug",
- "-p",
- "3000:3000",
- "--rm",
- "--runtime=nvidia",
- "--gpus",
- "all",
- "--name",
- container_name,
- image_name,
- ])
- .stdin(Stdio::inherit())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .status()
- .expect("failed to start Docker container");
+ let mut reader = BufReader::new(stdout);
+ let mut buffer = [0; 1024];
+ loop {
+ match reader.read(&mut buffer) {
+ Ok(0) => break,
+ Ok(n) => {
+ std::io::stdout().write_all(&buffer[..n]).unwrap();
+ std::io::stdout().flush().unwrap();
+ }
+ Err(_) => break,
+ }
+ }
});
+ // Kill the container on control-c.
ctrlc::set_handler(move || {
tracing::debug!("received Ctrl+C, cleaning up...");
if !cleanup_flag.load(Ordering::SeqCst) {
@@ -108,10 +148,32 @@ impl SP1ProverServer {
})
.unwrap();
- tracing::debug!("sleeping for 20 seconds to allow server to start");
- std::thread::sleep(Duration::from_secs(20));
+ // Wait a few seconds for the container to start.
+ std::thread::sleep(Duration::from_secs(2));
+
+ // Check if the container is ready.
+ let client = Client::from_base_url(
+ Url::parse("http://localhost:3000/twirp/").expect("failed to parse url"),
+ )
+ .expect("failed to create client");
+ let rt = Runtime::new().unwrap();
+ rt.block_on(async {
+ tracing::info!("waiting for proving server to be ready");
+ loop {
+ let request = ReadyRequest {};
+ let response = client.ready(request).await;
+ if let Ok(response) = response {
+ if response.ready {
+ tracing::info!("proving server is ready");
+ break;
+ }
+ }
+ tracing::info!("proving server is not ready, retrying...");
+ std::thread::sleep(Duration::from_secs(2));
+ }
+ });
- SP1ProverServer {
+ SP1CudaProver {
client: Client::from_base_url(
Url::parse("http://localhost:3000/twirp/").expect("failed to parse url"),
)
@@ -123,7 +185,7 @@ impl SP1ProverServer {
/// Executes the [sp1_prover::SP1Prover::prove_core] method inside the container.
///
- /// TODO: We can probably create a trait to unify [sp1_prover::SP1Prover] and [SP1ProverClient].
+ /// You will need at least 24GB of VRAM to run this method.
///
/// **WARNING**: This is an experimental feature and may not work as expected.
pub fn prove_core(
@@ -142,7 +204,7 @@ impl SP1ProverServer {
/// Executes the [sp1_prover::SP1Prover::compress] method inside the container.
///
- /// TODO: We can probably create a trait to unify [sp1_prover::SP1Prover] and [SP1ProverClient].
+ /// You will need at least 24GB of VRAM to run this method.
///
/// **WARNING**: This is an experimental feature and may not work as expected.
pub fn compress(
@@ -160,15 +222,53 @@ impl SP1ProverServer {
let proof: SP1ReduceProof = bincode::deserialize(&response.result).unwrap();
Ok(proof)
}
+
+ /// Executes the [sp1_prover::SP1Prover::shrink] method inside the container.
+ ///
+ /// You will need at least 40GB of VRAM to run this method.
+ ///
+ /// **WARNING**: This is an experimental feature and may not work as expected.
+ pub fn shrink(
+ &self,
+ reduced_proof: SP1ReduceProof,
+ ) -> Result, SP1RecursionProverError> {
+ let payload = ShrinkRequestPayload { reduced_proof: reduced_proof.clone() };
+ let request =
+ crate::proto::api::ShrinkRequest { data: bincode::serialize(&payload).unwrap() };
+
+ let rt = Runtime::new().unwrap();
+ let response = rt.block_on(async { self.client.shrink(request).await }).unwrap();
+ let proof: SP1ReduceProof = bincode::deserialize(&response.result).unwrap();
+ Ok(proof)
+ }
+
+ /// Executes the [sp1_prover::SP1Prover::wrap_bn254] method inside the container.
+ ///
+ /// You will need at least 40GB of VRAM to run this method.
+ ///
+ /// **WARNING**: This is an experimental feature and may not work as expected.
+ pub fn wrap_bn254(
+ &self,
+ reduced_proof: SP1ReduceProof,
+ ) -> Result, SP1RecursionProverError> {
+ let payload = WrapRequestPayload { reduced_proof: reduced_proof.clone() };
+ let request =
+ crate::proto::api::WrapRequest { data: bincode::serialize(&payload).unwrap() };
+
+ let rt = Runtime::new().unwrap();
+ let response = rt.block_on(async { self.client.wrap(request).await }).unwrap();
+ let proof: SP1ReduceProof = bincode::deserialize(&response.result).unwrap();
+ Ok(proof)
+ }
}
-impl Default for SP1ProverServer {
+impl Default for SP1CudaProver {
fn default() -> Self {
Self::new()
}
}
-impl Drop for SP1ProverServer {
+impl Drop for SP1CudaProver {
fn drop(&mut self) {
if !self.cleaned_up.load(Ordering::SeqCst) {
tracing::debug!("dropping SP1ProverClient, cleaning up...");
@@ -180,33 +280,31 @@ impl Drop for SP1ProverServer {
/// Cleans up the a docker container with the given name.
fn cleanup_container(container_name: &str) {
- tracing::debug!("cleaning up container: {}", container_name);
- if let Err(e) = Command::new("sudo").args(["docker", "rm", "-f", container_name]).status() {
+ if let Err(e) = Command::new("sudo").args(["docker", "rm", "-f", container_name]).output() {
eprintln!("failed to remove container: {}", e);
}
}
+#[allow(unused_imports)]
+#[cfg(feature = "protobuf")]
#[cfg(test)]
mod tests {
- use sp1_core_machine::{utils, utils::tests::FIBONACCI_ELF};
- use sp1_prover::{
- components::DefaultProverComponents, InnerSC, SP1CoreProof, SP1Prover, SP1ReduceProof,
- };
- use twirp::{url::Url, Client};
+ use sp1_prover::components::DefaultProverComponents;
+ use sp1_prover::{InnerSC, SP1CoreProof, SP1Prover, SP1ReduceProof};
+ use twirp::url::Url;
+ use twirp::Client;
- use crate::{
- proto::api::ProverServiceClient, CompressRequestPayload, ProveCoreRequestPayload,
- SP1ProverServer, SP1Stdin,
- };
+ use crate::SP1Stdin;
+ use crate::{proto::api::ProverServiceClient, ProveCoreRequestPayload};
+ use crate::{CompressRequestPayload, SP1CudaProver};
+ use sp1_core_machine::{utils, utils::tests::FIBONACCI_ELF};
- #[ignore]
#[test]
fn test_client() {
utils::setup_logger();
- let client = SP1ProverServer::new();
-
let prover = SP1Prover::::new();
+ let client = SP1CudaProver::new();
let (pk, vk) = prover.setup(FIBONACCI_ELF);
println!("proving core");
@@ -220,9 +318,20 @@ mod tests {
println!("verifying compress");
prover.verify_compressed(&proof, &vk).unwrap();
+
+ println!("proving shrink");
+ let proof = client.shrink(proof).unwrap();
+
+ println!("verifying shrink");
+ prover.verify_shrink(&proof, &vk).unwrap();
+
+ println!("proving wrap_bn254");
+ let proof = client.wrap_bn254(proof).unwrap();
+
+ println!("verifying wrap_bn254");
+ prover.verify_wrap_bn254(&proof, &vk).unwrap();
}
- #[ignore]
#[tokio::test]
async fn test_prove_core() {
let client =
diff --git a/crates/cuda/src/proto/api.rs b/crates/cuda/src/proto/api.rs
new file mode 100644
index 0000000000..f36b4e4da5
--- /dev/null
+++ b/crates/cuda/src/proto/api.rs
@@ -0,0 +1,190 @@
+// This file is @generated by prost-build.
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ReadyRequest {}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ReadyResponse {
+ #[prost(bool, tag = "1")]
+ pub ready: bool,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ProveCoreRequest {
+ #[prost(bytes = "vec", tag = "1")]
+ pub data: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ProveCoreResponse {
+ #[prost(bytes = "vec", tag = "1")]
+ pub result: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct CompressRequest {
+ #[prost(bytes = "vec", tag = "1")]
+ pub data: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct CompressResponse {
+ #[prost(bytes = "vec", tag = "1")]
+ pub result: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ShrinkRequest {
+ #[prost(bytes = "vec", tag = "1")]
+ pub data: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ShrinkResponse {
+ #[prost(bytes = "vec", tag = "1")]
+ pub result: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct WrapRequest {
+ #[prost(bytes = "vec", tag = "1")]
+ pub data: ::prost::alloc::vec::Vec,
+}
+#[derive(serde::Serialize, serde::Deserialize)]
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct WrapResponse {
+ #[prost(bytes = "vec", tag = "1")]
+ pub result: ::prost::alloc::vec::Vec,
+}
+pub use twirp;
+pub const SERVICE_FQN: &str = "/api.ProverService";
+#[twirp::async_trait::async_trait]
+pub trait ProverService {
+ async fn ready(
+ &self,
+ ctx: twirp::Context,
+ req: ReadyRequest,
+ ) -> Result;
+ async fn prove_core(
+ &self,
+ ctx: twirp::Context,
+ req: ProveCoreRequest,
+ ) -> Result;
+ async fn compress(
+ &self,
+ ctx: twirp::Context,
+ req: CompressRequest,
+ ) -> Result;
+ async fn shrink(
+ &self,
+ ctx: twirp::Context,
+ req: ShrinkRequest,
+ ) -> Result;
+ async fn wrap(
+ &self,
+ ctx: twirp::Context,
+ req: WrapRequest,
+ ) -> Result;
+}
+pub fn router(api: std::sync::Arc) -> twirp::Router
+where
+ T: ProverService + Send + Sync + 'static,
+{
+ twirp::details::TwirpRouterBuilder::new(api)
+ .route(
+ "/Ready",
+ |api: std::sync::Arc, ctx: twirp::Context, req: ReadyRequest| async move {
+ api.ready(ctx, req).await
+ },
+ )
+ .route(
+ "/ProveCore",
+ |api: std::sync::Arc, ctx: twirp::Context, req: ProveCoreRequest| async move {
+ api.prove_core(ctx, req).await
+ },
+ )
+ .route(
+ "/Compress",
+ |api: std::sync::Arc, ctx: twirp::Context, req: CompressRequest| async move {
+ api.compress(ctx, req).await
+ },
+ )
+ .route(
+ "/Shrink",
+ |api: std::sync::Arc, ctx: twirp::Context, req: ShrinkRequest| async move {
+ api.shrink(ctx, req).await
+ },
+ )
+ .route(
+ "/Wrap",
+ |api: std::sync::Arc, ctx: twirp::Context, req: WrapRequest| async move {
+ api.wrap(ctx, req).await
+ },
+ )
+ .build()
+}
+#[twirp::async_trait::async_trait]
+pub trait ProverServiceClient: Send + Sync + std::fmt::Debug {
+ async fn ready(
+ &self,
+ req: ReadyRequest,
+ ) -> Result;
+ async fn prove_core(
+ &self,
+ req: ProveCoreRequest,
+ ) -> Result;
+ async fn compress(
+ &self,
+ req: CompressRequest,
+ ) -> Result;
+ async fn shrink(
+ &self,
+ req: ShrinkRequest,
+ ) -> Result;
+ async fn wrap(&self, req: WrapRequest) -> Result;
+}
+#[twirp::async_trait::async_trait]
+impl ProverServiceClient for twirp::client::Client {
+ async fn ready(
+ &self,
+ req: ReadyRequest,
+ ) -> Result {
+ let url = self.base_url.join("api.ProverService/Ready")?;
+ self.request(url, req).await
+ }
+ async fn prove_core(
+ &self,
+ req: ProveCoreRequest,
+ ) -> Result {
+ let url = self.base_url.join("api.ProverService/ProveCore")?;
+ self.request(url, req).await
+ }
+ async fn compress(
+ &self,
+ req: CompressRequest,
+ ) -> Result {
+ let url = self.base_url.join("api.ProverService/Compress")?;
+ self.request(url, req).await
+ }
+ async fn shrink(
+ &self,
+ req: ShrinkRequest,
+ ) -> Result {
+ let url = self.base_url.join("api.ProverService/Shrink")?;
+ self.request(url, req).await
+ }
+ async fn wrap(&self, req: WrapRequest) -> Result {
+ let url = self.base_url.join("api.ProverService/Wrap")?;
+ self.request(url, req).await
+ }
+}
diff --git a/crates/prover/src/lib.rs b/crates/prover/src/lib.rs
index d719a7cd63..15ae1d7a9f 100644
--- a/crates/prover/src/lib.rs
+++ b/crates/prover/src/lib.rs
@@ -32,8 +32,8 @@ use p3_challenger::CanObserve;
use p3_field::{AbstractField, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use sp1_core_executor::{ExecutionError, ExecutionReport, Executor, Program, SP1Context};
+pub use sp1_core_machine::io::SP1Stdin;
use sp1_core_machine::{
- io::SP1Stdin,
riscv::RiscvAir,
utils::{concurrency::TurnBasedSync, SP1CoreProverError},
};
diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml
index d13f7a3b9d..fe35f505cc 100644
--- a/crates/sdk/Cargo.toml
+++ b/crates/sdk/Cargo.toml
@@ -24,6 +24,7 @@ reqwest = { version = "0.12.4", features = [
anyhow = "1.0.83"
sp1-prover = { workspace = true }
sp1-core-machine = { workspace = true }
+sp1-cuda = { workspace = true, optional = true }
futures = "0.3.30"
bincode = "1.3.3"
tokio = { version = "1.39.2", features = ["full"] }
@@ -59,6 +60,7 @@ native-gnark = ["sp1-prover/native-gnark"]
# TODO: Once alloy has a 1.* release, we can likely remove this feature flag, as there will be less
# dependency resolution issues.
network = ["dep:alloy-sol-types"]
+cuda = ["dep:sp1-cuda"]
[build-dependencies]
vergen = { version = "8", default-features = false, features = [
diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs
index 943108a9e8..d91b67e2a9 100644
--- a/crates/sdk/src/lib.rs
+++ b/crates/sdk/src/lib.rs
@@ -16,6 +16,8 @@ pub mod install;
pub mod network;
#[cfg(feature = "network")]
pub use crate::network::prover::NetworkProver;
+#[cfg(feature = "cuda")]
+pub use crate::provers::CudaProver;
pub mod proof;
pub mod provers;
@@ -29,7 +31,7 @@ pub use provers::SP1VerificationError;
use sp1_prover::components::DefaultProverComponents;
use std::env;
-pub use provers::{LocalProver, MockProver, Prover};
+pub use provers::{CpuProver, MockProver, Prover};
pub use sp1_core_executor::{ExecutionReport, SP1Context, SP1ContextBuilder};
pub use sp1_core_machine::{io::SP1Stdin, SP1_CIRCUIT_VERSION};
@@ -48,7 +50,8 @@ impl ProverClient {
/// Creates a new [ProverClient].
///
/// Setting the `SP1_PROVER` enviroment variable can change the prover used under the hood.
- /// - `local` (default): Uses [LocalProver]. Recommended for proving end-to-end locally.
+ /// - `local` (default): Uses [CpuProver] or [CudaProver] if the `cuda` feature is enabled.
+ /// Recommended for proving end-to-end locally.
/// - `mock`: Uses [MockProver]. Recommended for testing and development.
/// - `network`: Uses [NetworkProver]. Recommended for outsourcing proof generation to an RPC.
///
@@ -63,7 +66,12 @@ impl ProverClient {
pub fn new() -> Self {
match env::var("SP1_PROVER").unwrap_or("local".to_string()).to_lowercase().as_str() {
"mock" => Self { prover: Box::new(MockProver::new()) },
- "local" => Self { prover: Box::new(LocalProver::new()) },
+ "local" => Self {
+ #[cfg(not(feature = "cuda"))]
+ prover: Box::new(CpuProver::new()),
+ #[cfg(feature = "cuda")]
+ prover: Box::new(CudaProver::new()),
+ },
"network" => {
cfg_if! {
if #[cfg(feature = "network")] {
@@ -110,7 +118,7 @@ impl ProverClient {
/// let client = ProverClient::local();
/// ```
pub fn local() -> Self {
- Self { prover: Box::new(LocalProver::new()) }
+ Self { prover: Box::new(CpuProver::new()) }
}
/// Creates a new [ProverClient] with the network prover.
diff --git a/crates/sdk/src/network/prover.rs b/crates/sdk/src/network/prover.rs
index b512b48cf8..f3e342368e 100644
--- a/crates/sdk/src/network/prover.rs
+++ b/crates/sdk/src/network/prover.rs
@@ -16,12 +16,12 @@ use sp1_prover::{components::DefaultProverComponents, SP1Prover, SP1_CIRCUIT_VER
use sp1_stark::SP1ProverOpts;
use tokio::time::sleep;
-use crate::provers::{LocalProver, ProofOpts, ProverType};
+use crate::provers::{CpuProver, ProofOpts, ProverType};
/// An implementation of [crate::ProverClient] that can generate proofs on a remote RPC server.
pub struct NetworkProver {
client: NetworkClient,
- local_prover: LocalProver,
+ local_prover: CpuProver,
}
impl NetworkProver {
@@ -37,7 +37,7 @@ impl NetworkProver {
let version = SP1_CIRCUIT_VERSION;
log::info!("Client circuit version: {}", version);
- let local_prover = LocalProver::new();
+ let local_prover = CpuProver::new();
Self { client: NetworkClient::new(private_key), local_prover }
}
diff --git a/crates/sdk/src/provers/local.rs b/crates/sdk/src/provers/cpu.rs
similarity index 79%
rename from crates/sdk/src/provers/local.rs
rename to crates/sdk/src/provers/cpu.rs
index f891c565b1..55a8290ecd 100644
--- a/crates/sdk/src/provers/local.rs
+++ b/crates/sdk/src/provers/cpu.rs
@@ -1,8 +1,8 @@
use anyhow::Result;
use sp1_core_executor::SP1Context;
use sp1_core_machine::io::SP1Stdin;
-use sp1_prover::{components::SP1ProverComponents, SP1Prover};
-use sysinfo::System;
+use sp1_prover::components::DefaultProverComponents;
+use sp1_prover::SP1Prover;
use crate::{
install::try_install_plonk_bn254_artifacts, provers::ProofOpts, Prover, SP1Proof, SP1ProofKind,
@@ -12,11 +12,11 @@ use crate::{
use super::ProverType;
/// An implementation of [crate::ProverClient] that can generate end-to-end proofs locally.
-pub struct LocalProver {
- prover: SP1Prover,
+pub struct CpuProver {
+ prover: SP1Prover,
}
-impl LocalProver {
+impl CpuProver {
/// Creates a new [LocalProver].
pub fn new() -> Self {
let prover = SP1Prover::new();
@@ -24,21 +24,21 @@ impl LocalProver {
}
/// Creates a new [LocalProver] from an existing [SP1Prover].
- pub fn from_prover(prover: SP1Prover) -> Self {
+ pub fn from_prover(prover: SP1Prover) -> Self {
Self { prover }
}
}
-impl Prover for LocalProver {
+impl Prover for CpuProver {
fn id(&self) -> ProverType {
- ProverType::Local
+ ProverType::Cpu
}
fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) {
self.prover.setup(elf)
}
- fn sp1_prover(&self) -> &SP1Prover {
+ fn sp1_prover(&self) -> &SP1Prover {
&self.prover
}
@@ -50,13 +50,7 @@ impl Prover for LocalProver {
context: SP1Context<'a>,
kind: SP1ProofKind,
) -> Result {
- let total_ram_gb = System::new_all().total_memory() / 1_000_000_000;
- if kind == SP1ProofKind::Plonk && total_ram_gb <= 120 {
- return Err(anyhow::anyhow!(
- "not enough memory to generate plonk proof. at least 128GB is required."
- ));
- }
-
+ // Generate the core proof.
let proof = self.prover.prove_core(pk, &stdin, opts.sp1_prover_opts, context)?;
if kind == SP1ProofKind::Core {
return Ok(SP1ProofWithPublicValues {
@@ -66,8 +60,11 @@ impl Prover for LocalProver {
sp1_version: self.version().to_string(),
});
}
+
let deferred_proofs = stdin.proofs.iter().map(|p| p.0.clone()).collect();
let public_values = proof.public_values.clone();
+
+ // Generate the compressed proof.
let reduce_proof =
self.prover.compress(&pk.vk, proof, deferred_proofs, opts.sp1_prover_opts)?;
if kind == SP1ProofKind::Compressed {
@@ -78,7 +75,11 @@ impl Prover for LocalProver {
sp1_version: self.version().to_string(),
});
}
+
+ // Generate the shrink proof.
let compress_proof = self.prover.shrink(reduce_proof, opts.sp1_prover_opts)?;
+
+ // Genenerate the wrap proof.
let outer_proof = self.prover.wrap_bn254(compress_proof, opts.sp1_prover_opts)?;
let plonk_bn254_aritfacts = if sp1_prover::build::sp1_dev_mode() {
@@ -98,11 +99,12 @@ impl Prover for LocalProver {
sp1_version: self.version().to_string(),
});
}
+
unreachable!()
}
}
-impl Default for LocalProver {
+impl Default for CpuProver {
fn default() -> Self {
Self::new()
}
diff --git a/crates/sdk/src/provers/cuda.rs b/crates/sdk/src/provers/cuda.rs
new file mode 100644
index 0000000000..d3efaa7502
--- /dev/null
+++ b/crates/sdk/src/provers/cuda.rs
@@ -0,0 +1,107 @@
+use anyhow::Result;
+use sp1_core_executor::SP1Context;
+use sp1_cuda::SP1CudaProver;
+use sp1_prover::{components::DefaultProverComponents, SP1Prover, SP1Stdin};
+
+use super::ProverType;
+use crate::{
+ install::try_install_plonk_bn254_artifacts, provers::ProofOpts, Prover, SP1Proof, SP1ProofKind,
+ SP1ProofWithPublicValues, SP1ProvingKey, SP1VerifyingKey,
+};
+
+/// An implementation of [crate::ProverClient] that can generate proofs locally using CUDA.
+pub struct CudaProver {
+ prover: SP1Prover,
+ cuda_prover: SP1CudaProver,
+}
+
+impl CudaProver {
+ /// Creates a new [CudaProver].
+ pub fn new() -> Self {
+ let prover = SP1Prover::new();
+ let cuda_prover = SP1CudaProver::new();
+ Self { prover, cuda_prover }
+ }
+}
+
+impl Prover for CudaProver {
+ fn id(&self) -> ProverType {
+ ProverType::Cuda
+ }
+
+ fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) {
+ self.prover.setup(elf)
+ }
+
+ fn sp1_prover(&self) -> &SP1Prover {
+ &self.prover
+ }
+
+ fn prove<'a>(
+ &'a self,
+ pk: &SP1ProvingKey,
+ stdin: SP1Stdin,
+ _opts: ProofOpts,
+ _context: SP1Context<'a>,
+ kind: SP1ProofKind,
+ ) -> Result {
+ tracing::warn!("opts and context are ignored for the cuda prover");
+
+ // Generate the core proof.
+ let proof = self.cuda_prover.prove_core(pk, &stdin)?;
+ if kind == SP1ProofKind::Core {
+ return Ok(SP1ProofWithPublicValues {
+ proof: SP1Proof::Core(proof.proof.0),
+ stdin: proof.stdin,
+ public_values: proof.public_values,
+ sp1_version: self.version().to_string(),
+ });
+ }
+
+ let deferred_proofs = stdin.proofs.iter().map(|p| p.0.clone()).collect();
+ let public_values = proof.public_values.clone();
+
+ // Generate the compressed proof.
+ let reduce_proof = self.cuda_prover.compress(&pk.vk, proof, deferred_proofs)?;
+ if kind == SP1ProofKind::Compressed {
+ return Ok(SP1ProofWithPublicValues {
+ proof: SP1Proof::Compressed(reduce_proof.proof),
+ stdin,
+ public_values,
+ sp1_version: self.version().to_string(),
+ });
+ }
+
+ // Generate the shrink proof.
+ let compress_proof = self.cuda_prover.shrink(reduce_proof)?;
+
+ // Genenerate the wrap proof.
+ let outer_proof = self.cuda_prover.wrap_bn254(compress_proof)?;
+
+ let plonk_bn254_aritfacts = if sp1_prover::build::sp1_dev_mode() {
+ sp1_prover::build::try_build_plonk_bn254_artifacts_dev(
+ self.prover.wrap_vk(),
+ &outer_proof.proof,
+ )
+ } else {
+ try_install_plonk_bn254_artifacts()
+ };
+ let proof = self.prover.wrap_plonk_bn254(outer_proof, &plonk_bn254_aritfacts);
+ if kind == SP1ProofKind::Plonk {
+ return Ok(SP1ProofWithPublicValues {
+ proof: SP1Proof::Plonk(proof),
+ stdin,
+ public_values,
+ sp1_version: self.version().to_string(),
+ });
+ }
+
+ unreachable!()
+ }
+}
+
+impl Default for CudaProver {
+ fn default() -> Self {
+ Self::new()
+ }
+}
diff --git a/crates/sdk/src/provers/mod.rs b/crates/sdk/src/provers/mod.rs
index e2d999b9b3..f0266a835e 100644
--- a/crates/sdk/src/provers/mod.rs
+++ b/crates/sdk/src/provers/mod.rs
@@ -1,10 +1,15 @@
-mod local;
+mod cpu;
+#[cfg(feature = "cuda")]
+mod cuda;
mod mock;
-use anyhow::Result;
-pub use local::LocalProver;
+pub use cpu::CpuProver;
+#[cfg(feature = "cuda")]
+pub use cuda::CudaProver;
pub use mock::MockProver;
+use anyhow::Result;
+
use sp1_core_executor::SP1Context;
use sp1_core_machine::{io::SP1Stdin, SP1_CIRCUIT_VERSION};
use sp1_prover::{
@@ -23,7 +28,8 @@ use crate::{
/// The type of prover.
#[derive(Debug, PartialEq, EnumString)]
pub enum ProverType {
- Local,
+ Cpu,
+ Cuda,
Mock,
Network,
}
diff --git a/crates/server/proto/api.proto b/crates/server/proto/api.proto
deleted file mode 100644
index 220818beb4..0000000000
--- a/crates/server/proto/api.proto
+++ /dev/null
@@ -1,24 +0,0 @@
-syntax = "proto3";
-
-package api;
-
-service ProverService {
- rpc ProveCore(ProveCoreRequest) returns (ProveCoreResponse) {}
- rpc Compress(CompressRequest) returns (CompressResponse) {}
-}
-
-message ProveCoreRequest {
- bytes data = 1;
-}
-
-message ProveCoreResponse {
- bytes result = 1;
-}
-
-message CompressRequest {
- bytes data = 1;
-}
-
-message CompressResponse {
- bytes result = 1;
-}
\ No newline at end of file
diff --git a/crates/server/src/proto/api.rs b/crates/server/src/proto/api.rs
deleted file mode 100644
index 28390e38e0..0000000000
--- a/crates/server/src/proto/api.rs
+++ /dev/null
@@ -1,91 +0,0 @@
-// This file is @generated by prost-build.
-#[derive(serde::Serialize, serde::Deserialize)]
-#[allow(clippy::derive_partial_eq_without_eq)]
-#[derive(Clone, PartialEq, ::prost::Message)]
-pub struct ProveCoreRequest {
- #[prost(bytes = "vec", tag = "1")]
- pub data: ::prost::alloc::vec::Vec,
-}
-#[derive(serde::Serialize, serde::Deserialize)]
-#[allow(clippy::derive_partial_eq_without_eq)]
-#[derive(Clone, PartialEq, ::prost::Message)]
-pub struct ProveCoreResponse {
- #[prost(bytes = "vec", tag = "1")]
- pub result: ::prost::alloc::vec::Vec,
-}
-#[derive(serde::Serialize, serde::Deserialize)]
-#[allow(clippy::derive_partial_eq_without_eq)]
-#[derive(Clone, PartialEq, ::prost::Message)]
-pub struct CompressRequest {
- #[prost(bytes = "vec", tag = "1")]
- pub data: ::prost::alloc::vec::Vec,
-}
-#[derive(serde::Serialize, serde::Deserialize)]
-#[allow(clippy::derive_partial_eq_without_eq)]
-#[derive(Clone, PartialEq, ::prost::Message)]
-pub struct CompressResponse {
- #[prost(bytes = "vec", tag = "1")]
- pub result: ::prost::alloc::vec::Vec,
-}
-pub use twirp;
-pub const SERVICE_FQN: &str = "/api.ProverService";
-#[twirp::async_trait::async_trait]
-pub trait ProverService {
- async fn prove_core(
- &self,
- ctx: twirp::Context,
- req: ProveCoreRequest,
- ) -> Result;
- async fn compress(
- &self,
- ctx: twirp::Context,
- req: CompressRequest,
- ) -> Result;
-}
-pub fn router(api: std::sync::Arc) -> twirp::Router
-where
- T: ProverService + Send + Sync + 'static,
-{
- twirp::details::TwirpRouterBuilder::new(api)
- .route(
- "/ProveCore",
- |api: std::sync::Arc, ctx: twirp::Context, req: ProveCoreRequest| async move {
- api.prove_core(ctx, req).await
- },
- )
- .route(
- "/Compress",
- |api: std::sync::Arc, ctx: twirp::Context, req: CompressRequest| async move {
- api.compress(ctx, req).await
- },
- )
- .build()
-}
-#[twirp::async_trait::async_trait]
-pub trait ProverServiceClient: Send + Sync + std::fmt::Debug {
- async fn prove_core(
- &self,
- req: ProveCoreRequest,
- ) -> Result;
- async fn compress(
- &self,
- req: CompressRequest,
- ) -> Result;
-}
-#[twirp::async_trait::async_trait]
-impl ProverServiceClient for twirp::client::Client {
- async fn prove_core(
- &self,
- req: ProveCoreRequest,
- ) -> Result {
- let url = self.base_url.join("api.ProverService/ProveCore")?;
- self.request(url, req).await
- }
- async fn compress(
- &self,
- req: CompressRequest,
- ) -> Result {
- let url = self.base_url.join("api.ProverService/Compress")?;
- self.request(url, req).await
- }
-}
diff --git a/examples/Cargo.lock b/examples/Cargo.lock
index a34314ad92..c5752e158d 100644
--- a/examples/Cargo.lock
+++ b/examples/Cargo.lock
@@ -68,7 +68,7 @@ dependencies = [
"cfg-if",
"once_cell",
"version_check",
- "zerocopy 0.7.35",
+ "zerocopy",
]
[[package]]
@@ -110,9 +110,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",
@@ -129,7 +129,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -141,11 +141,11 @@ dependencies = [
"alloy-sol-macro-input",
"const-hex",
"heck",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"syn-solidity",
"tiny-keccak",
]
@@ -161,7 +161,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"syn-solidity",
]
@@ -400,7 +400,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -428,7 +428,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -570,9 +570,9 @@ dependencies = [
"proc-macro2",
"quote",
"regex",
- "rustc-hash",
+ "rustc-hash 1.1.0",
"shlex",
- "syn 2.0.72",
+ "syn 2.0.74",
"which",
]
@@ -725,9 +725,9 @@ dependencies = [
[[package]]
name = "camino"
-version = "1.1.7"
+version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
+checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb"
dependencies = [
"serde",
]
@@ -757,12 +757,13 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.1.7"
+version = "1.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
+checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7"
dependencies = [
"jobserver",
"libc",
+ "shlex",
]
[[package]]
@@ -780,6 +781,12 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+[[package]]
+name = "cfg_aliases"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
+
[[package]]
name = "chess-script"
version = "1.1.0"
@@ -824,9 +831,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.13"
+version = "4.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
+checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019"
dependencies = [
"clap_builder",
"clap_derive",
@@ -834,9 +841,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.13"
+version = "4.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
+checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6"
dependencies = [
"anstream",
"anstyle",
@@ -853,7 +860,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -988,15 +995,15 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.8.6"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpufeatures"
-version = "0.2.12"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
+checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad"
dependencies = [
"libc",
]
@@ -1073,6 +1080,16 @@ dependencies = [
"cipher",
]
+[[package]]
+name = "ctrlc"
+version = "3.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3"
+dependencies = [
+ "nix",
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "curve25519-dalek"
version = "4.1.3"
@@ -1096,7 +1113,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1141,7 +1158,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1152,7 +1169,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1207,7 +1224,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc_version 0.4.0",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1260,9 +1277,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
[[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"
@@ -1519,7 +1536,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
- "syn 2.0.72",
+ "syn 2.0.74",
"toml",
"walkdir",
]
@@ -1537,7 +1554,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde_json",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -1563,7 +1580,7 @@ dependencies = [
"serde",
"serde_json",
"strum",
- "syn 2.0.72",
+ "syn 2.0.74",
"tempfile",
"thiserror",
"tiny-keccak",
@@ -1857,7 +1874,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -2019,7 +2036,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http 0.2.12",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"slab",
"tokio",
"tokio-util",
@@ -2038,7 +2055,7 @@ dependencies = [
"futures-core",
"futures-sink",
"http 1.1.0",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"slab",
"tokio",
"tokio-util",
@@ -2304,9 +2321,9 @@ dependencies = [
[[package]]
name = "hyper-util"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
+checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9"
dependencies = [
"bytes",
"futures-channel",
@@ -2418,9 +2435,9 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.3.0"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
+checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c"
dependencies = [
"equivalent",
"hashbrown 0.14.5",
@@ -2530,9 +2547,9 @@ dependencies = [
[[package]]
name = "js-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
dependencies = [
"wasm-bindgen",
]
@@ -2601,9 +2618,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",
@@ -2633,9 +2650,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.155"
+version = "0.2.156"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a"
[[package]]
name = "libgit2-sys"
@@ -2677,9 +2694,9 @@ dependencies = [
[[package]]
name = "libz-sys"
-version = "1.1.18"
+version = "1.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e"
+checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647"
dependencies = [
"cc",
"libc",
@@ -2759,9 +2776,9 @@ dependencies = [
[[package]]
name = "mio"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
+checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
dependencies = [
"hermit-abi",
"libc",
@@ -2786,6 +2803,18 @@ dependencies = [
"tempfile",
]
+[[package]]
+name = "nix"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
+dependencies = [
+ "bitflags 2.6.0",
+ "cfg-if",
+ "cfg_aliases",
+ "libc",
+]
+
[[package]]
name = "nohash-hasher"
version = "0.2.0"
@@ -2896,7 +2925,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -2989,7 +3018,7 @@ dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3009,9 +3038,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "object"
-version = "0.36.2"
+version = "0.36.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
+checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
dependencies = [
"memchr",
]
@@ -3082,7 +3111,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3571,7 +3600,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3649,11 +3678,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]]
@@ -3663,7 +3692,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e"
dependencies = [
"proc-macro2",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3772,7 +3801,7 @@ dependencies = [
"itertools 0.12.1",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -3801,16 +3830,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",
+ "socket2",
"thiserror",
"tokio",
"tracing",
@@ -3818,14 +3848,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",
"slab",
"thiserror",
@@ -3842,6 +3872,7 @@ dependencies = [
"libc",
"once_cell",
"socket2",
+ "tracing",
"windows-sys 0.52.0",
]
@@ -4069,7 +4100,7 @@ dependencies = [
"pin-project-lite",
"quinn",
"rustls",
- "rustls-pemfile 2.1.2",
+ "rustls-pemfile 2.1.3",
"rustls-pki-types",
"serde",
"serde_json",
@@ -4092,9 +4123,9 @@ dependencies = [
[[package]]
name = "reqwest-middleware"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39346a33ddfe6be00cbc17a34ce996818b97b230b87229f10114693becca1268"
+checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04"
dependencies = [
"anyhow",
"async-trait",
@@ -4258,6 +4289,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"
@@ -4320,9 +4357,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",
@@ -4330,9 +4367,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
-version = "1.7.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
+checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0"
[[package]]
name = "rustls-webpki"
@@ -4413,9 +4450,9 @@ dependencies = [
[[package]]
name = "scc"
-version = "2.1.6"
+version = "2.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05ccfb12511cdb770157ace92d7dda771e498445b78f9886e8cdbc5140a4eced"
+checksum = "c478f373151538826ed50feaceeef7095ad435065a48153af789005fd5e44c0d"
dependencies = [
"sdd",
]
@@ -4449,9 +4486,9 @@ dependencies = [
[[package]]
name = "sdd"
-version = "2.1.0"
+version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "177258b64c0faaa9ffd3c65cd3262c2bc7e2588dbbd9c1641d0346145c1bbda8"
+checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f"
[[package]]
name = "sec1"
@@ -4531,9 +4568,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
-version = "1.0.207"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2"
+checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
dependencies = [
"serde_derive",
]
@@ -4559,20 +4596,20 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.207"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e"
+checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
name = "serde_json"
-version = "1.0.122"
+version = "1.0.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
+checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed"
dependencies = [
"itoa",
"memchr",
@@ -4598,7 +4635,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4632,7 +4669,7 @@ dependencies = [
"chrono",
"hex",
"indexmap 1.9.3",
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"serde",
"serde_derive",
"serde_json",
@@ -4649,7 +4686,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4674,7 +4711,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -4713,9 +4750,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",
@@ -4915,6 +4952,25 @@ dependencies = [
"web-time",
]
+[[package]]
+name = "sp1-cuda"
+version = "1.1.1"
+dependencies = [
+ "bincode",
+ "ctrlc",
+ "prost",
+ "prost-types",
+ "serde",
+ "serde_json",
+ "sp1-core-machine",
+ "sp1-prover",
+ "sp1-stark",
+ "tokio",
+ "tracing",
+ "tracing-subscriber",
+ "twirp-rs",
+]
+
[[package]]
name = "sp1-curves"
version = "1.1.1"
@@ -5180,6 +5236,7 @@ dependencies = [
"sha2 0.10.8",
"sp1-core-executor",
"sp1-core-machine",
+ "sp1-cuda",
"sp1-prover",
"sp1-stark",
"strum",
@@ -5305,7 +5362,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5342,9 +5399,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.72"
+version = "2.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
+checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7"
dependencies = [
"proc-macro2",
"quote",
@@ -5360,7 +5417,7 @@ dependencies = [
"paste",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5419,15 +5476,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
-version = "3.11.0"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53"
+checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64"
dependencies = [
"cfg-if",
"fastrand",
"once_cell",
"rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -5526,7 +5583,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5622,7 +5679,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -5686,7 +5743,7 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"toml_datetime",
"winnow 0.5.40",
]
@@ -5697,7 +5754,7 @@ version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"toml_datetime",
"winnow 0.5.40",
]
@@ -5708,7 +5765,7 @@ version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
- "indexmap 2.3.0",
+ "indexmap 2.4.0",
"serde",
"serde_spanned",
"toml_datetime",
@@ -5733,15 +5790,15 @@ dependencies = [
[[package]]
name = "tower-layer"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-service"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
@@ -5763,7 +5820,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -6026,34 +6083,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
dependencies = [
"cfg-if",
+ "once_cell",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.42"
+version = "0.4.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0"
+checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
dependencies = [
"cfg-if",
"js-sys",
@@ -6063,9 +6121,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -6073,22 +6131,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]]
name = "wasm-streams"
@@ -6105,9 +6163,9 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
+checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -6408,34 +6466,14 @@ dependencies = [
"tap",
]
-[[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]]
@@ -6446,7 +6484,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
@@ -6466,7 +6504,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.72",
+ "syn 2.0.74",
]
[[package]]
diff --git a/examples/aggregation/program/elf/riscv32im-succinct-zkvm-elf b/examples/aggregation/program/elf/riscv32im-succinct-zkvm-elf
index b2f1709a71..794ba72ee9 100755
Binary files a/examples/aggregation/program/elf/riscv32im-succinct-zkvm-elf and b/examples/aggregation/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/chess/program/elf/riscv32im-succinct-zkvm-elf b/examples/chess/program/elf/riscv32im-succinct-zkvm-elf
index c7aec26536..1aeeb7b8c0 100755
Binary files a/examples/chess/program/elf/riscv32im-succinct-zkvm-elf and b/examples/chess/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf b/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf
index cd8d475c0c..71ecfb553d 100755
Binary files a/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf and b/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf b/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf
index 59d33cc456..f2e48383e2 100755
Binary files a/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf and b/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/fibonacci/script/Cargo.toml b/examples/fibonacci/script/Cargo.toml
index 6054ede538..d33cef2a32 100644
--- a/examples/fibonacci/script/Cargo.toml
+++ b/examples/fibonacci/script/Cargo.toml
@@ -28,3 +28,6 @@ path = "bin/execute.rs"
[[bin]]
name = "fibonacci-script"
path = "src/main.rs"
+
+[features]
+cuda = ["sp1-sdk/cuda"]
diff --git a/examples/fibonacci/script/src/main.rs b/examples/fibonacci/script/src/main.rs
index 9f5a81f256..c61f93e366 100644
--- a/examples/fibonacci/script/src/main.rs
+++ b/examples/fibonacci/script/src/main.rs
@@ -19,22 +19,22 @@ fn main() {
let client = ProverClient::new();
// Execute the program using the `ProverClient.execute` method, without generating a proof.
- let (_public_values, report) = client.execute(ELF, stdin.clone()).run().unwrap();
+ let (_, report) = client.execute(ELF, stdin.clone()).run().unwrap();
println!(
- "Executed program with {} cycles",
+ "executed program with {} cycles",
report.total_instruction_count()
);
// Generate the proof for the given program and input.
- let client = ProverClient::new();
let (pk, vk) = client.setup(ELF);
let mut proof = client.prove(&pk, stdin).run().unwrap();
println!("generated proof");
// Read and verify the output.
- // Note that this output is read from values commited to in the program
- // using `sp1_zkvm::io::commit`.
+ //
+ // Note that this output is read from values commited to in the program using
+ // `sp1_zkvm::io::commit`.
let _ = proof.public_values.read::();
let a = proof.public_values.read::();
let b = proof.public_values.read::();
diff --git a/examples/io/program/elf/riscv32im-succinct-zkvm-elf b/examples/io/program/elf/riscv32im-succinct-zkvm-elf
index 4e4e2b2f89..a0104bf95e 100755
Binary files a/examples/io/program/elf/riscv32im-succinct-zkvm-elf and b/examples/io/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/json/program/elf/riscv32im-succinct-zkvm-elf b/examples/json/program/elf/riscv32im-succinct-zkvm-elf
index 4084e5cfaf..5b52ad4cd4 100755
Binary files a/examples/json/program/elf/riscv32im-succinct-zkvm-elf and b/examples/json/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/patch-testing/program/elf/riscv32im-succinct-zkvm-elf b/examples/patch-testing/program/elf/riscv32im-succinct-zkvm-elf
index 32f180470e..bb190e6507 100755
Binary files a/examples/patch-testing/program/elf/riscv32im-succinct-zkvm-elf and b/examples/patch-testing/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/regex/program/elf/riscv32im-succinct-zkvm-elf b/examples/regex/program/elf/riscv32im-succinct-zkvm-elf
index ff0f6f15f9..a863b9784b 100755
Binary files a/examples/regex/program/elf/riscv32im-succinct-zkvm-elf and b/examples/regex/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf b/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf
index 8ed2c3ad9e..042388d5b7 100755
Binary files a/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf and b/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf b/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf
index 3d19ed81ed..fe4037222d 100755
Binary files a/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf and b/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf b/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf
index 571dd4c8dd..2e9f5f2fc5 100755
Binary files a/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf and b/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf differ
diff --git a/examples/tendermint/script/Cargo.toml b/examples/tendermint/script/Cargo.toml
index 41b6bac6ff..9b291e92c0 100644
--- a/examples/tendermint/script/Cargo.toml
+++ b/examples/tendermint/script/Cargo.toml
@@ -22,3 +22,6 @@ sha2 = "0.10.8"
[build-dependencies]
sp1-helper = { workspace = true }
+
+[features]
+cuda = ["sp1-sdk/cuda"]
\ No newline at end of file
diff --git a/examples/tendermint/script/src/main.rs b/examples/tendermint/script/src/main.rs
index aaef6ed1d8..510b32d472 100644
--- a/examples/tendermint/script/src/main.rs
+++ b/examples/tendermint/script/src/main.rs
@@ -23,16 +23,16 @@ async fn get_light_blocks() -> (LightBlock, LightBlock) {
0x72, 0x6b, 0xc8, 0xd2, 0x60, 0x38, 0x7c, 0xf5, 0x6e, 0xcf, 0xad, 0x3a, 0x6b, 0xf6, 0xfe,
0xcd, 0x90, 0x3e, 0x18, 0xa2,
];
- const BASE_URL: &str = "https://celestia-mocha-rpc.publicnode.com:443";
+ const BASE_URL: &str = "https://public-celestia-rpc.numia.xyz/";
let client = Client::new();
let url = format!("{}/commit", BASE_URL);
let latest_commit = fetch_latest_commit(&client, &url).await.unwrap();
let block: u64 = latest_commit.result.signed_header.header.height.into();
println!("Latest block: {}", block);
- let light_block_1 = fetch_light_block(2279100, peer_id, BASE_URL)
+ let light_block_1 = fetch_light_block(2095390, peer_id, BASE_URL)
.await
.expect("Failed to generate light block 1");
- let light_block_2 = fetch_light_block(2279130, peer_id, BASE_URL)
+ let light_block_2 = fetch_light_block(2095392, peer_id, BASE_URL)
.await
.expect("Failed to generate light block 2");
(light_block_1, light_block_2)