diff --git a/Cargo.lock b/Cargo.lock index df4da890c..e9e38d693 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3493,6 +3493,15 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -4702,6 +4711,7 @@ dependencies = [ "sphinx-primitives", "sphinx-recursion-compiler", "sphinx-recursion-core", + "stacker", "tracing", ] @@ -4788,6 +4798,19 @@ dependencies = [ "der", ] +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index 1cb271b17..99186b844 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,6 +105,7 @@ serde_with = "3.9.0" serial_test = "3.1.1" sha2 = "0.10.8" size = "0.4.1" +stacker = "0.1.0" strum = "0.26.3" strum_macros = "0.26.4" syn = "1.0" diff --git a/recursion/program/Cargo.toml b/recursion/program/Cargo.toml index a3f38f1d3..87a9addaf 100644 --- a/recursion/program/Cargo.toml +++ b/recursion/program/Cargo.toml @@ -23,6 +23,7 @@ sphinx-primitives = { path = "../../primitives" } sphinx-recursion-core = { path = "../core" } sphinx-recursion-compiler = { path = "../compiler" } sphinx-core = { path = "../../core" } +stacker = { workspace = true } itertools = { workspace = true } serde = { workspace = true, features = ["derive"] } rand = { workspace = true } diff --git a/recursion/program/src/stark.rs b/recursion/program/src/stark.rs index a347b04d2..67916265c 100644 --- a/recursion/program/src/stark.rs +++ b/recursion/program/src/stark.rs @@ -334,17 +334,19 @@ where quotient_domain.split_domains_const(builder, log_quotient_degree); // Verify the constraints. - Self::verify_constraints( - builder, - chip, - &values, - &proof.public_values, - &trace_domain, - &qc_domains, - zeta, - alpha, - &permutation_challenges, - ); + stacker::maybe_grow(16 * 1024 * 1024, 16 * 1024 * 1024, || { + Self::verify_constraints( + builder, + chip, + &values, + &proof.public_values, + &trace_domain, + &qc_domains, + zeta, + alpha, + &permutation_challenges, + ); + }); // Increment the number of shard chips that are enabled. builder.assign(