diff --git a/Cargo.lock b/Cargo.lock index 799c29c4..a4966d11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7568,7 +7568,7 @@ dependencies = [ [[package]] name = "sp1-core-executor" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "bincode", "bytemuck", @@ -7601,7 +7601,7 @@ dependencies = [ [[package]] name = "sp1-core-machine" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "bincode", "cfg-if", @@ -7648,7 +7648,7 @@ dependencies = [ [[package]] name = "sp1-curves" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "cfg-if", "curve25519-dalek", @@ -7669,7 +7669,7 @@ dependencies = [ [[package]] name = "sp1-derive" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "quote", "syn 1.0.109", @@ -7678,7 +7678,7 @@ dependencies = [ [[package]] name = "sp1-lib" version = "3.4.0" -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#a847a398ec1317deac6e6a746f1626507ceff0dc" +source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" dependencies = [ "bincode", "serde", @@ -7687,7 +7687,7 @@ dependencies = [ [[package]] name = "sp1-primitives" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "bincode", "hex", @@ -7704,7 +7704,7 @@ dependencies = [ [[package]] name = "sp1-primitives" version = "3.4.0" -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#a847a398ec1317deac6e6a746f1626507ceff0dc" +source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" dependencies = [ "bincode", "hex", @@ -7721,7 +7721,7 @@ dependencies = [ [[package]] name = "sp1-prover" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "anyhow", "bincode", @@ -7762,7 +7762,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "hashbrown 0.14.5", "itertools 0.13.0", @@ -7795,7 +7795,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "backtrace", "itertools 0.13.0", @@ -7816,7 +7816,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "backtrace", "ff 0.13.0", @@ -7851,7 +7851,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "quote", "syn 1.0.109", @@ -7860,7 +7860,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "anyhow", "bincode", @@ -7885,7 +7885,7 @@ dependencies = [ [[package]] name = "sp1-sdk" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "alloy-primitives 0.8.14", "alloy-signer 0.3.6", @@ -7932,7 +7932,7 @@ dependencies = [ [[package]] name = "sp1-stark" version = "3.3.0" -source = "git+https://github.com/succinctlabs/sp1.git?rev=cd23301f627370eace27a6cb28450d65151cbed4#cd23301f627370eace27a6cb28450d65151cbed4" +source = "git+https://github.com/succinctlabs/sp1.git?rev=3ef33280f638d080a1ceda6de597867e720df660#3ef33280f638d080a1ceda6de597867e720df660" dependencies = [ "arrayref", "getrandom", @@ -7967,7 +7967,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" version = "3.4.0" -source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#a847a398ec1317deac6e6a746f1626507ceff0dc" +source = "git+https://github.com/succinctlabs/sp1-wip.git?branch=ratan%2Fallocators#64e1abd078982facc4fd1716bdb1c3a12bd10196" dependencies = [ "cfg-if", "critical-section", diff --git a/Cargo.toml b/Cargo.toml index a443e489..523681b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,9 +90,9 @@ op-alloy-network = { version = "0.6.8", default-features = false } # sp1 sp1-lib = { version = "3.3.0", features = ["verify"] } sp1-zkvm = { git = "https://github.com/succinctlabs/sp1-wip.git", branch = "ratan/allocators", features = ["verify", "embedded", "libm", "lib"], default-features = false } -# Note: This rev includes the SP1 mock groth16 bytes fix, skipping deferred verification, executor opts and network-v2 changes. +# Note: This rev includes the SP1 mock groth16 bytes fix, skipping deferred verification, executor opts and network-v2 changes. Also turn off debug assertions on the executor. # ratan/v3.3.0-network-v2-with-features branch includes the network-v2 changes from `19ae3e1`. -sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "cd23301f627370eace27a6cb28450d65151cbed4", features = [ +sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "3ef33280f638d080a1ceda6de597867e720df660", features = [ "network-v2", ] } sp1-build = { version = "3.3.0" } diff --git a/programs/range/src/main.rs b/programs/range/src/main.rs index 637bf5b4..8befbdc8 100644 --- a/programs/range/src/main.rs +++ b/programs/range/src/main.rs @@ -203,6 +203,16 @@ fn main() { number = number, output_root = output_root ); + + // Manually forget large objects to avoid allocator overhead + std::mem::forget(pipeline); + std::mem::forget(executor); + std::mem::forget(l2_provider); + std::mem::forget(l1_provider); + std::mem::forget(oracle); + std::mem::forget(cfg); + std::mem::forget(cursor); + std::mem::forget(boot); }); } @@ -337,6 +347,11 @@ where .map_err(DriverError::Executor)?, ); cursor.advance(origin, tip_cursor); + + // Reduce the amount of de-allocation by forgetting the block. + // Manually forget objects before loop continues + std::mem::forget(block); + println!("cycle-tracker-report-end: output-root"); } } diff --git a/scripts/utils/bin/cost_estimator.rs b/scripts/utils/bin/cost_estimator.rs index 91e7b85b..c2529df0 100644 --- a/scripts/utils/bin/cost_estimator.rs +++ b/scripts/utils/bin/cost_estimator.rs @@ -7,9 +7,13 @@ 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, - }, fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, get_proof_stdin, stats::ExecutionStats, witnessgen::run_native_data_generation, HostExecutorArgs, ProgramType + }, + fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, + get_proof_stdin, + stats::ExecutionStats, + witnessgen::run_native_data_generation, + HostExecutorArgs, ProgramType, }; -use op_succinct_scripts::HostExecutorArgs; use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; use sp1_sdk::{utils, ProverClient}; use std::{ diff --git a/scripts/utils/bin/gen_sp1_test_artifacts.rs b/scripts/utils/bin/gen_sp1_test_artifacts.rs index 0e9825f1..052c00ba 100644 --- a/scripts/utils/bin/gen_sp1_test_artifacts.rs +++ b/scripts/utils/bin/gen_sp1_test_artifacts.rs @@ -4,11 +4,7 @@ use futures::StreamExt; use kona_host::HostCli; use log::info; use op_succinct_host_utils::{ - block_range::{get_validated_block_range, split_range_basic, SpanBatchRange}, - fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, - get_proof_stdin, - witnessgen::run_native_data_generation, - ProgramType, + block_range::{get_validated_block_range, split_range_basic, SpanBatchRange}, fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, get_proof_stdin, witnessgen::run_native_data_generation, HostExecutorArgs, ProgramType }; use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; use sp1_sdk::{utils, ProverClient, SP1Stdin};