diff --git a/Cargo.lock b/Cargo.lock index b5dfebcd0..ce09f1d0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4891,13 +4891,13 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", - "p3-matrix", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", ] [[package]] name = "p3-baby-bear" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "num-bigint 0.4.6", "p3-field", @@ -4934,12 +4934,14 @@ dependencies = [ [[package]] name = "p3-challenger" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "p3-field", - "p3-maybe-rayon", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "serde", + "serde_with 3.8.3", "tracing", ] @@ -4951,32 +4953,44 @@ dependencies = [ "itertools 0.12.1", "p3-challenger", "p3-field", - "p3-matrix", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", ] +[[package]] +name = "p3-dft" +version = "0.1.0" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" +dependencies = [ + "p3-field", + "p3-matrix 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "p3-util 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "tracing", +] + [[package]] name = "p3-dft" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "tracing", ] [[package]] name = "p3-field" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", "num-traits", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", "rand 0.8.5", "serde", ] @@ -4989,12 +5003,12 @@ dependencies = [ "itertools 0.12.1", "p3-challenger", "p3-commit", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-field", "p3-interpolation", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "tracing", ] @@ -5005,8 +5019,8 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" dependencies = [ "p3-field", - "p3-matrix", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", ] [[package]] @@ -5025,9 +5039,23 @@ source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761 dependencies = [ "p3-air", "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "tracing", +] + +[[package]] +name = "p3-matrix" +version = "0.1.0" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "p3-util 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", + "rand 0.8.5", + "serde", "tracing", ] @@ -5038,13 +5066,18 @@ source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761 dependencies = [ "itertools 0.12.1", "p3-field", - "p3-maybe-rayon", - "p3-util", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "rand 0.8.5", "serde", "tracing", ] +[[package]] +name = "p3-maybe-rayon" +version = "0.1.0" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" + [[package]] name = "p3-maybe-rayon" version = "0.1.0" @@ -5056,14 +5089,14 @@ dependencies = [ [[package]] name = "p3-mds" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "itertools 0.12.1", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", "p3-field", - "p3-matrix", + "p3-matrix 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Champii/Plonky3.git?branch=serde_patch)", "rand 0.8.5", ] @@ -5075,10 +5108,10 @@ dependencies = [ "itertools 0.12.1", "p3-commit", "p3-field", - "p3-matrix", - "p3-maybe-rayon", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "tracing", ] @@ -5086,19 +5119,21 @@ dependencies = [ [[package]] name = "p3-poseidon2" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "gcd", "p3-field", "p3-mds", "p3-symmetric", "rand 0.8.5", + "serde", + "serde_with 3.8.3", ] [[package]] name = "p3-symmetric" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07#88ea2b866e41329817e4761429b4a5a2a9751c07" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" dependencies = [ "itertools 0.12.1", "p3-field", @@ -5114,15 +5149,23 @@ dependencies = [ "p3-air", "p3-challenger", "p3-commit", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "tracing", ] +[[package]] +name = "p3-util" +version = "0.1.0" +source = "git+https://github.com/Champii/Plonky3.git?branch=serde_patch#786cc3cb1c4dc22a08463abe88f1e68e5119ee54" +dependencies = [ + "serde", +] + [[package]] name = "p3-util" version = "0.1.0" @@ -8237,7 +8280,6 @@ dependencies = [ [[package]] name = "sp1-core" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "arrayref", @@ -8262,18 +8304,18 @@ dependencies = [ "p3-blake3", "p3-challenger", "p3-commit", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-field", "p3-fri", "p3-keccak", "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-merkle-tree", "p3-poseidon2", "p3-symmetric", "p3-uni-stark", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "rand 0.8.5", "rayon-scan", "rrs-lib 0.1.0 (git+https://github.com/GregAC/rrs.git)", @@ -8297,7 +8339,6 @@ dependencies = [ [[package]] name = "sp1-derive" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "proc-macro2", "quote", @@ -8323,7 +8364,6 @@ dependencies = [ [[package]] name = "sp1-primitives" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "itertools 0.13.0", "lazy_static", @@ -8336,7 +8376,6 @@ dependencies = [ [[package]] name = "sp1-prover" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "backtrace", @@ -8354,7 +8393,7 @@ dependencies = [ "p3-challenger", "p3-commit", "p3-field", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "rand 0.8.5", "rayon", "reqwest 0.12.5", @@ -8381,7 +8420,6 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "bincode", "itertools 0.13.0", @@ -8391,8 +8429,8 @@ dependencies = [ "p3-commit", "p3-field", "p3-fri", - "p3-matrix", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "sp1-core", "sp1-recursion-compiler", @@ -8404,7 +8442,6 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "backtrace", "itertools 0.13.0", @@ -8414,10 +8451,10 @@ dependencies = [ "p3-commit", "p3-field", "p3-fri", - "p3-matrix", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-poseidon2", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "sp1-core", "sp1-recursion-core", @@ -8428,7 +8465,6 @@ dependencies = [ [[package]] name = "sp1-recursion-core" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "arrayref", "backtrace", @@ -8440,15 +8476,15 @@ dependencies = [ "p3-bn254-fr", "p3-challenger", "p3-commit", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-field", "p3-fri", - "p3-matrix", - "p3-maybe-rayon", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-merkle-tree", "p3-poseidon2", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "serde", "serde_with 3.8.3", "sp1-core", @@ -8462,7 +8498,6 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "proc-macro2", "quote", @@ -8472,7 +8507,6 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "anyhow", "bincode", @@ -8497,22 +8531,21 @@ dependencies = [ [[package]] name = "sp1-recursion-program" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "itertools 0.13.0", "p3-air", "p3-baby-bear", "p3-challenger", "p3-commit", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-field", "p3-fri", - "p3-matrix", - "p3-maybe-rayon", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "p3-merkle-tree", "p3-poseidon2", "p3-symmetric", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "rand 0.8.5", "serde", "sp1-core", @@ -8524,7 +8557,6 @@ dependencies = [ [[package]] name = "sp1-sdk" version = "0.1.0" -source = "git+https://github.com/succinctlabs/sp1.git?branch=main#14eb569d41d24721ffbd407d6060e202482d659c" dependencies = [ "alloy-sol-types", "anyhow", @@ -8541,7 +8573,7 @@ dependencies = [ "num-bigint 0.4.6", "p3-commit", "p3-field", - "p3-matrix", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=88ea2b866e41329817e4761429b4a5a2a9751c07)", "prost", "reqwest 0.12.5", "reqwest-middleware", diff --git a/Cargo.toml b/Cargo.toml index 4d31db36d..9fc338426 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,9 +57,10 @@ risc0-build = { version = "1.0.1" } risc0-binfmt = { version = "1.0.1" } # SP1 -sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } -sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } -sp1-helper = { git = "https://github.com/succinctlabs/sp1.git", branch = "main" } +sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "14eb569d41d24721ffbd407d6060e202482d659c" } +sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", rev = "14eb569d41d24721ffbd407d6060e202482d659c" } +sp1-helper = { git = "https://github.com/succinctlabs/sp1.git", rev = "14eb569d41d24721ffbd407d6060e202482d659c" } + # alloy alloy-rlp = { version = "0.3.4", default-features = false } @@ -189,3 +190,15 @@ revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36- revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" } secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" } blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" } + +# Patch Plonky3 for Serialize and Deserialize of DuplexChallenger +[patch."https://github.com/succinctlabs/sp1.git"] +sp1-sdk = { path = "../sp1/sdk" } + +# Patch Plonky3 for Serialize and Deserialize of DuplexChallenger +[patch."https://github.com/Plonky3/Plonky3.git"] +p3-field = { git = "https://github.com/Champii/Plonky3.git", branch = "serde_patch" } +p3-challenger = { git = "https://github.com/Champii/Plonky3.git", branch = "serde_patch" } +p3-poseidon2 = { git = "https://github.com/Champii/Plonky3.git", branch = "serde_patch" } +p3-baby-bear = { git = "https://github.com/Champii/Plonky3.git", branch = "serde_patch" } +p3-symmetric = { git = "https://github.com/Champii/Plonky3.git", branch = "serde_patch" } diff --git a/host/Cargo.toml b/host/Cargo.toml index 6222369e6..2011a7ef6 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -82,7 +82,7 @@ ethers-core = { workspace = true } [features] default = [] -sp1 = ["raiko-core/sp1"] +sp1 = ["raiko-core/sp1", "sp1-driver"] risc0 = ["raiko-core/risc0"] sgx = ["raiko-core/sgx"] diff --git a/host/src/lib.rs b/host/src/lib.rs index d46a4849a..281ff8e9b 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -35,6 +35,21 @@ pub struct Opts { /// [default: 0.0.0.0:8080] address: String, + #[arg(long, require_equals = true, default_value = "0.0.0.0:8081")] + #[serde(default = "Opts::default_sp1_worker_address")] + /// Distributed SP1 worker listening address + /// [default: 0.0.0.0:8081] + sp1_worker_address: String, + + #[arg(long, default_value = None)] + /// Distributed SP1 worker orchestrator address + /// + /// Setting this will enable the worker and restrict it to only accept requests from + /// this orchestrator + /// + /// [default: None] + sp1_orchestrator_address: Option, + #[arg(long, require_equals = true, default_value = "16")] #[serde(default = "Opts::default_concurrency_limit")] /// Limit the max number of in-flight requests @@ -88,6 +103,10 @@ impl Opts { "0.0.0.0:8080".to_string() } + fn default_sp1_worker_address() -> String { + "0.0.0.0:8081".to_string() + } + fn default_concurrency_limit() -> usize { 16 } diff --git a/host/src/server/mod.rs b/host/src/server/mod.rs index bec5e6914..a8763aa5b 100644 --- a/host/src/server/mod.rs +++ b/host/src/server/mod.rs @@ -8,6 +8,15 @@ pub mod api; /// Starts the proverd server. pub async fn serve(state: ProverState) -> anyhow::Result<()> { + #[cfg(feature = "sp1")] + if let Some(orchestrator_addr) = state.opts.sp1_orchestrator_address.as_ref() { + sp1_driver::serve( + state.opts.sp1_worker_address.clone(), + orchestrator_addr.clone(), + ) + .await; + } + let addr = SocketAddr::from_str(&state.opts.address) .map_err(|_| HostError::InvalidAddress(state.opts.address.clone()))?; let listener = TcpListener::bind(addr).await?; diff --git a/provers/sp1/driver/Cargo.toml b/provers/sp1/driver/Cargo.toml index 848bfcc40..ebcd96478 100644 --- a/provers/sp1/driver/Cargo.toml +++ b/provers/sp1/driver/Cargo.toml @@ -21,7 +21,6 @@ once_cell = { workspace = true, optional = true } sha3 = { workspace = true, optional = true, default-features = false } tracing = { workspace = true, optional = true } - [features] enable = [ "serde", diff --git a/provers/sp1/driver/src/lib.rs b/provers/sp1/driver/src/lib.rs index a8dc96f39..d4ee813e4 100644 --- a/provers/sp1/driver/src/lib.rs +++ b/provers/sp1/driver/src/lib.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use sp1_sdk::{ network::client::NetworkClient, proto::network::{ProofMode, ProofStatus, UnclaimReason}, - ProverClient, SP1Stdin, + serve, ProverClient, SP1Stdin, }; use std::{env, thread::sleep, time::Duration}; use tracing::info as tracing_info; diff --git a/provers/sp1/guest/elf/sp1-guest b/provers/sp1/guest/elf/sp1-guest old mode 100755 new mode 100644 diff --git a/script/build.sh b/script/build.sh index 69eaafe56..4ecf0f931 100755 --- a/script/build.sh +++ b/script/build.sh @@ -150,8 +150,13 @@ if [ -z "$1" ] || [ "$1" == "sp1" ]; then cargo ${TOOLCHAIN_SP1} build ${FLAGS} --features sp1 else if [ -z "${TEST}" ]; then + if [ -n "$ORCHESTRATOR" ]; then + export ARGS="--sp1-orchestrator-address $ORCHESTRATOR" + echo "Running in worker mode with orchestrator address $ORCHESTRATOR" + fi + echo "Running Sp1 prover" - cargo ${TOOLCHAIN_SP1} run ${FLAGS} --features sp1 + cargo ${TOOLCHAIN_SP1} run ${FLAGS} --features sp1 -- ${ARGS} else echo "Running Sp1 tests" cargo ${TOOLCHAIN_SP1} test ${FLAGS} --lib sp1-driver --features sp1 -- run_unittest_elf