diff --git a/Cargo.lock b/Cargo.lock index a4935708..1588faaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6185,17 +6185,8 @@ dependencies = [ [[package]] name = "sp1-core-executor" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "bincode", "bytemuck", @@ -6227,17 +6218,8 @@ dependencies = [ [[package]] name = "sp1-core-machine" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "bincode", "cfg-if", @@ -6283,17 +6265,8 @@ dependencies = [ [[package]] name = "sp1-curves" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "cfg-if", "dashu", @@ -6312,17 +6285,8 @@ dependencies = [ [[package]] name = "sp1-derive" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "quote", "syn 1.0.109", @@ -6331,11 +6295,7 @@ dependencies = [ [[package]] name = "sp1-lib" version = "3.4.0" -<<<<<<< HEAD source = "git+https://github.com/succinctlabs/sp1.git?rev=16431e6b979a617fa08994ccdaf866b22ba4b7a1#16431e6b979a617fa08994ccdaf866b22ba4b7a1" -======= -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" ->>>>>>> ea27c43 (feat: allocator works) dependencies = [ "bincode", "serde", @@ -6343,17 +6303,8 @@ dependencies = [ [[package]] name = "sp1-primitives" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=16431e6b979a617fa08994ccdaf866b22ba4b7a1#16431e6b979a617fa08994ccdaf866b22ba4b7a1" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "bincode", "hex", @@ -6370,11 +6321,7 @@ dependencies = [ [[package]] name = "sp1-primitives" version = "3.4.0" -<<<<<<< HEAD source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" ->>>>>>> ea27c43 (feat: allocator works) dependencies = [ "bincode", "hex", @@ -6390,17 +6337,8 @@ dependencies = [ [[package]] name = "sp1-prover" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "anyhow", "bincode", @@ -6440,17 +6378,8 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "hashbrown 0.14.5", "itertools 0.13.0", @@ -6482,17 +6411,8 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "backtrace", "itertools 0.13.0", @@ -6512,17 +6432,8 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "backtrace", "ff 0.13.0", @@ -6556,17 +6467,8 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "quote", "syn 1.0.109", @@ -6574,17 +6476,8 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "anyhow", "bincode", @@ -6608,17 +6501,8 @@ dependencies = [ [[package]] name = "sp1-sdk" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "alloy-primitives", "alloy-signer 0.5.4", @@ -6663,17 +6547,8 @@ dependencies = [ [[package]] name = "sp1-stark" -<<<<<<< HEAD version = "3.4.0" source = "git+https://github.com/succinctlabs/sp1.git?rev=f0b61cf262388c1be7edfcf984c8e070064e980f#f0b61cf262388c1be7edfcf984c8e070064e980f" -======= -version = "3.3.0" -<<<<<<< HEAD -source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" ->>>>>>> ea27c43 (feat: allocator works) -======= -source = "git+https://github.com/succinctlabs/sp1.git?rev=bb1fade9f0b3aa66637dd5af3657fd007d5f72d1#bb1fade9f0b3aa66637dd5af3657fd007d5f72d1" ->>>>>>> 7f489c9 (feat: new alloc works) dependencies = [ "arrayref", "getrandom", @@ -6708,11 +6583,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" version = "3.4.0" -<<<<<<< HEAD source = "git+https://github.com/succinctlabs/sp1.git?rev=16431e6b979a617fa08994ccdaf866b22ba4b7a1#16431e6b979a617fa08994ccdaf866b22ba4b7a1" -======= -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" ->>>>>>> ea27c43 (feat: allocator works) dependencies = [ "cfg-if", "critical-section", diff --git a/Cargo.toml b/Cargo.toml index 219eba71..2b2765b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,9 +94,15 @@ sp1-lib = { version = "3.4.0", features = ["verify"] } sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "f0b61cf262388c1be7edfcf984c8e070064e980f", features = [ "network-v2", ] } +sp1-core-executor = { git = "https://github.com/succinctlabs/sp1.git", rev = "f0b61cf262388c1be7edfcf984c8e070064e980f" } +sp1-stark = { git = "https://github.com/succinctlabs/sp1.git", rev = "f0b61cf262388c1be7edfcf984c8e070064e980f" } sp1-zkvm = { git = "https://github.com/succinctlabs/sp1.git", rev = "16431e6b979a617fa08994ccdaf866b22ba4b7a1", features = ["verify", "lib", "libm", "embedded"], default-features = false } sp1-build = { version = "3.4.0" } +p3-baby-bear = { version = "0.1.4-succinct" } +p3-fri = { version = "0.1.4-succinct" } +p3-field = { version = "0.1.4-succinct" } + [profile.release-client-lto] inherits = "release" panic = "abort" diff --git a/elf/aggregation-elf b/elf/aggregation-elf index 727836d1..50d52c32 100755 Binary files a/elf/aggregation-elf and b/elf/aggregation-elf differ diff --git a/elf/range-elf b/elf/range-elf index a2fba5b7..c7c901c9 100755 Binary files a/elf/range-elf and b/elf/range-elf differ diff --git a/proposer/succinct/bin/server.rs b/proposer/succinct/bin/server.rs index 3a51bb60..7962da00 100644 --- a/proposer/succinct/bin/server.rs +++ b/proposer/succinct/bin/server.rs @@ -485,7 +485,7 @@ async fn request_mock_span_proof( }; let start_prove = Instant::now(); - let res = generate_mock_compressed_proof(MULTI_BLOCK_ELF, sp1_stdin); + let res = generate_mock_compressed_proof(RANGE_ELF, sp1_stdin); let (proof, report) = if let Ok(result) = res { result } else { diff --git a/scripts/prove/bin/multi.rs b/scripts/prove/bin/multi.rs index 91ba257f..ae228924 100644 --- a/scripts/prove/bin/multi.rs +++ b/scripts/prove/bin/multi.rs @@ -7,9 +7,12 @@ use op_succinct_host_utils::{ stats::ExecutionStats, HostExecutorArgs, ProgramType, }; -use op_succinct_prove::{execute_multi, generate_witness, DEFAULT_RANGE, RANGE_ELF}; -use sp1_sdk::{utils, ProverClient}; -use std::{fs, time::Duration}; +use op_succinct_prove::{execute_multi, generate_witness, RANGE_ELF}; +use sp1_sdk::{ + network_v2::proto::network::{FulfillmentStrategy, ProofMode}, + utils, NetworkProverV2, Prover, +}; +use std::{env, fs, time::Duration}; /// Execute the OP Succinct program for multiple blocks. #[tokio::main] @@ -45,14 +48,19 @@ async fn main() -> Result<()> { // Get the stdin for the block. let sp1_stdin = get_proof_stdin(&host_cli)?; - let prover = ProverClient::new(); + let private_key = env::var("SP1_PRIVATE_KEY").unwrap(); + let sp1_rpc_url = env::var("PROVER_NETWORK_RPC").unwrap(); + let mut prover = NetworkProverV2::new(&private_key, Some(sp1_rpc_url), false); + prover.with_strategy(FulfillmentStrategy::Reserved); if args.prove { // If the prove flag is set, generate a proof. let (pk, _) = prover.setup(RANGE_ELF); // Generate proofs in compressed mode for aggregation verification. - let proof = prover.prove(&pk, sp1_stdin).compressed().run().unwrap(); + let proof = prover + .prove(&pk, sp1_stdin, ProofMode::Compressed, None) + .await?; // Create a proof directory for the chain ID if it doesn't exist. let proof_dir = format!( @@ -72,14 +80,8 @@ async fn main() -> Result<()> { } else { let l2_chain_id = data_fetcher.get_l2_chain_id().await?; - let (block_data, report, execution_duration) = execute_multi( - &prover, - &data_fetcher, - sp1_stdin, - l2_start_block, - l2_end_block, - ) - .await?; + let (block_data, report, execution_duration) = + execute_multi(&data_fetcher, sp1_stdin, l2_start_block, l2_end_block).await?; let stats = ExecutionStats::new( &block_data, diff --git a/scripts/prove/src/lib.rs b/scripts/prove/src/lib.rs index ad5c62b8..9a1ca9ec 100644 --- a/scripts/prove/src/lib.rs +++ b/scripts/prove/src/lib.rs @@ -33,13 +33,13 @@ pub async fn generate_witness(host_cli: &HostCli) -> Result { } pub async fn execute_multi( - prover: &ProverClient, data_fetcher: &OPSuccinctDataFetcher, sp1_stdin: SP1Stdin, l2_start_block: u64, l2_end_block: u64, ) -> Result<(Vec, ExecutionReport, Duration)> { let start_time = Instant::now(); + let prover = ProverClient::new(); let (_, report) = prover.execute(RANGE_ELF, sp1_stdin.clone()).run().unwrap(); let execution_duration = start_time.elapsed(); diff --git a/scripts/prove/tests/multi.rs b/scripts/prove/tests/multi.rs index 20949c7c..5bf95e15 100644 --- a/scripts/prove/tests/multi.rs +++ b/scripts/prove/tests/multi.rs @@ -8,7 +8,6 @@ use op_succinct_host_utils::{ ProgramType, }; use op_succinct_prove::{execute_multi, generate_witness, DEFAULT_RANGE, ONE_HOUR}; -use sp1_sdk::ProverClient; mod common; @@ -36,16 +35,8 @@ async fn execute_batch() -> Result<()> { // Get the stdin for the block. let sp1_stdin = get_proof_stdin(&host_cli)?; - let prover = ProverClient::new(); - - let (block_data, report, execution_duration) = execute_multi( - &prover, - &data_fetcher, - sp1_stdin, - l2_start_block, - l2_end_block, - ) - .await?; + let (block_data, report, execution_duration) = + execute_multi(&data_fetcher, sp1_stdin, l2_start_block, l2_end_block).await?; let stats = ExecutionStats::new( &block_data, diff --git a/scripts/utils/bin/cost_estimator.rs b/scripts/utils/bin/cost_estimator.rs index 92ed1288..ab8f4810 100644 --- a/scripts/utils/bin/cost_estimator.rs +++ b/scripts/utils/bin/cost_estimator.rs @@ -5,8 +5,7 @@ use kona_host::HostCli; use log::info; use op_succinct_host_utils::{ block_range::{ - get_rolling_block_range, get_validated_block_range, split_range_based_on_safe_heads, - split_range_basic, SpanBatchRange, + get_rolling_block_range, get_validated_block_range, split_range_basic, SpanBatchRange, }, fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, get_proof_stdin,