Skip to content

Commit

Permalink
remove: mozak_memory_init_trace_cap (#1606)
Browse files Browse the repository at this point in the history
The trace cap was supposed to be used in one of the entities to be
hashed together, to compute `self_prog_id`. This is not relevant anymore
since we are moving away from pre initialized memory.
  • Loading branch information
codeblooded1729 authored Apr 23, 2024
1 parent 6983eb7 commit 8ce7d00
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion circuits/src/stark/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ pub struct AllProof<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, co
pub proofs: TableKindArray<StarkProof<F, C, D>>,
pub program_rom_trace_cap: MerkleCap<F, C::Hasher>,
pub elf_memory_init_trace_cap: MerkleCap<F, C::Hasher>,
pub mozak_memory_init_trace_cap: MerkleCap<F, C::Hasher>,
pub public_inputs: PublicInputs<F>,
pub public_sub_table_values: TableKindArray<Vec<PublicSubTableValues<F>>>,
}
Expand Down
2 changes: 0 additions & 2 deletions circuits/src/stark/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ where

let program_rom_trace_cap = trace_caps[TableKind::Program].clone();
let elf_memory_init_trace_cap = trace_caps[TableKind::ElfMemoryInit].clone();
let mozak_memory_init_trace_cap = trace_caps[TableKind::MozakMemoryInit].clone();
if log_enabled!(Debug) {
timing.print();
}
Ok(AllProof {
proofs,
program_rom_trace_cap,
elf_memory_init_trace_cap,
mozak_memory_init_trace_cap,
public_inputs,
public_sub_table_values,
})
Expand Down
10 changes: 1 addition & 9 deletions circuits/src/stark/recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub const VM_RECURSION_THRESHOLD_DEGREE_BITS: usize = 12;
/// `Program trace cap`: 16 (hash count with `cap_height` = 4) * 4 (size of a
/// hash) = 64
/// `ElfMemoryInit trace cap`: 64
/// `MozakMemoryInit trace cap`: 64
/// `event commitment_tape`: 32
/// `castlist_commitment_tape`: 32
pub const VM_PUBLIC_INPUT_SIZE: usize = VMRecursiveProofPublicInputs::<()>::NUMBER_OF_COLUMNS;
Expand All @@ -64,7 +63,6 @@ pub struct VMRecursiveProofPublicInputs<T> {
pub entry_point: T,
pub program_trace_cap: [[T; NUM_HASH_OUT_ELTS]; VM_RECURSION_CONFIG_NUM_CAPS],
pub elf_memory_init_trace_cap: [[T; NUM_HASH_OUT_ELTS]; VM_RECURSION_CONFIG_NUM_CAPS],
pub mozak_memory_init_trace_cap: [[T; NUM_HASH_OUT_ELTS]; VM_RECURSION_CONFIG_NUM_CAPS],
pub event_commitment_tape: [T; COMMITMENT_SIZE],
pub castlist_commitment_tape: [T; COMMITMENT_SIZE],
}
Expand All @@ -76,8 +74,6 @@ impl<T: Default + Copy> Default for VMRecursiveProofPublicInputs<T> {
program_trace_cap: [[T::default(); NUM_HASH_OUT_ELTS]; VM_RECURSION_CONFIG_NUM_CAPS],
elf_memory_init_trace_cap: [[T::default(); NUM_HASH_OUT_ELTS];
VM_RECURSION_CONFIG_NUM_CAPS],
mozak_memory_init_trace_cap: [[T::default(); NUM_HASH_OUT_ELTS];
VM_RECURSION_CONFIG_NUM_CAPS],
event_commitment_tape: Default::default(),
castlist_commitment_tape: Default::default(),
}
Expand Down Expand Up @@ -259,11 +255,7 @@ where
});

// Register program ROM and memory init trace cap as public inputs.
for kind in [
TableKind::Program,
TableKind::ElfMemoryInit,
TableKind::MozakMemoryInit,
] {
for kind in [TableKind::Program, TableKind::ElfMemoryInit] {
builder.register_public_inputs(
&targets[kind]
.stark_proof_with_pis_target
Expand Down
6 changes: 0 additions & 6 deletions circuits/src/stark/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ where
"Mismatch between ElfMemoryInit trace caps"
);

ensure!(
all_proof.proofs[TableKind::MozakMemoryInit].trace_cap
== all_proof.mozak_memory_init_trace_cap,
"Mismatch between MozakMemoryInit trace caps"
);

let ctl_vars_per_table = CtlCheckVars::from_proofs(
&all_proof.proofs,
&mozak_stark.cross_table_lookups,
Expand Down

0 comments on commit 8ce7d00

Please sign in to comment.