Skip to content

Commit

Permalink
issue/140: wip: un-batch the opening proofs to figure out which one i…
Browse files Browse the repository at this point in the history
…s the problem
morganthomas committed Apr 15, 2024
1 parent 6dc4511 commit c0a0abe
Showing 2 changed files with 31 additions and 7 deletions.
27 changes: 21 additions & 6 deletions basic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -625,12 +625,27 @@ impl<F: PrimeField32 + TwoAdicField> Machine<F> for BasicMachine<F> {
(&perm_data, zeta_and_next.as_slice()),
(&quotient_data, zeta_exp_quotient_degree.as_slice()),
];
let (openings, opening_proof) =
pcs.open_multi_batches(&prover_data_and_points, &mut challenger);

let [preprocessed_openings, main_openings, perm_openings, quotient_openings] = openings
.try_into()
.expect("Should have 4 rounds of openings");
// let (openings, opening_proof) =
// pcs.open_multi_batches(&prover_data_and_points, &mut challenger);

let (preprocessed_openings, preprocessed_opening_proof) =
pcs.open_multi_batches(&[(&preprocessed_data, zeta_and_next.as_slice())],
&mut challenger);
let [preprocessed_openings] = preprocessed_openings.try_into().expect("Should have 1 round opening");

let (main_openings, main_opening_proof) =
pcs.open_multi_batches(&[(&main_data, zeta_and_next.as_slice())],
&mut challenger);
let [main_openings] = main_openings.try_into().expect("Should have 1 round opening");

let (perm_openings, perm_opening_proof) =
pcs.open_multi_batches(&[(&perm_data, zeta_and_next.as_slice())],
&mut challenger);
let [perm_openings] = perm_openings.try_into().expect("Should have 1 round opening");

// let [preprocessed_openings, main_openings, perm_openings, quotient_openings] = openings
// .try_into()
// .expect("Should have 4 rounds of openings");

let commitments = Commitments {
preprocessed_trace: preprocessed_commit,
11 changes: 10 additions & 1 deletion machine/src/proof.rs
Original file line number Diff line number Diff line change
@@ -13,10 +13,19 @@ type PcsProof<SC> = <<SC as StarkConfig>::Pcs as Pcs<Val<SC>, ValMat<SC>>>::Proo
#[serde(bound = "SC::Challenge: Serialize + DeserializeOwned")]
pub struct MachineProof<SC: StarkConfig> {
pub commitments: Commitments<Com<SC>>,
pub opening_proof: PcsProof<SC>,
pub opening_proofs: OpeningProofs<SC>,
pub chip_proofs: Vec<ChipProof<SC::Challenge>>,
}

#[derive(Serialize, Deserialize)]
#[serde(bound = "SC::Challenge: Serialize + DeserializeOwned")]
pub struct OpeningProofs<SC: StarkConfig> {
pub preprocessed: PcsProof<SC>,
pub main: PcsProof<SC>,
pub perm: PcsProof<SC>,
pub quotient: PcsProof<SC>,
}

#[derive(Serialize, Deserialize)]
pub struct Commitments<Com> {
pub preprocessed_trace: Com,

0 comments on commit c0a0abe

Please sign in to comment.