Skip to content

Commit 6ecf144

Browse files
committed
feat(stark): shared FRI across all tables in batched mode
Replace per-table FRI with ONE shared FRI when all tables have the same LDE domain size (batched mode). Each table still computes its own DEEP composition polynomial (different z per table), then all DEEP polys are alpha-batched into a single evaluation vector for one FRI commit phase, one grinding step, and one query set. Prover changes: - Add compute_per_table_deep_evaluations: does Rounds 3-3.5 (OOD eval + DEEP poly computation) without running FRI - Batched Step 3 now: (a) per-table DEEP computation in parallel, (b) build shared FRI transcript with all OOD data, sample alpha, (c) alpha-batch DEEP polys with iFFT+FFT extension to LDE domain, (d) one FRI commit + grind + query, (e) shared openings from batched trees - Per-table StarkProofs get empty FRI fields in batched mode Verifier changes: - Add verify_composition_only: steps 1-2 without FRI (for shared FRI mode) - multi_verify detects shared FRI via MultiProof fields - Shared FRI path: per-table composition check, then reconstruct shared FRI transcript, sample alpha, alpha-batch per-table DEEP reconstructions at query points, verify one FRI fold chain + openings Proof format: - MultiProof gains optional shared FRI fields (fri_layers_merkle_roots, fri_last_value, query_list, deep_poly_openings, nonce) - Non-batched path unchanged (shared fields are None)
1 parent 436cb20 commit 6ecf144

4 files changed

Lines changed: 799 additions & 77 deletions

File tree

crypto/stark/src/proof/stark.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,22 @@ pub struct StarkProof<F: IsSubFieldOf<E>, E: IsField, PI> {
9696
#[serde(bound = "PI: serde::Serialize + serde::de::DeserializeOwned")]
9797
pub struct MultiProof<F: IsSubFieldOf<E>, E: IsField, PI> {
9898
pub proofs: Vec<StarkProof<F, E, PI>>,
99+
// --- Shared FRI data (batched mode only) ---
100+
// When present, per-table proofs have empty FRI fields;
101+
// the verifier uses these shared fields instead.
102+
/// FRI layer Merkle roots from the shared FRI commit phase.
103+
#[serde(default)]
104+
pub fri_layers_merkle_roots: Option<Vec<Commitment>>,
105+
/// Final FRI folding value from the shared FRI.
106+
#[serde(default)]
107+
pub fri_last_value: Option<FieldElement<E>>,
108+
/// FRI query decommitments from the shared FRI.
109+
#[serde(default)]
110+
pub query_list: Option<Vec<FriDecommitment<E>>>,
111+
/// Deep polynomial openings from the shared FRI (one per query).
112+
#[serde(default)]
113+
pub deep_poly_openings: Option<DeepPolynomialOpenings<F, E>>,
114+
/// Proof-of-work nonce from the shared FRI.
115+
#[serde(default)]
116+
pub nonce: Option<u64>,
99117
}

0 commit comments

Comments
 (0)