From 8ce7d0000da080a7ac7cc9e17650e8c3c984bdab Mon Sep 17 00:00:00 2001 From: Kapil <39694928+codeblooded1729@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:57:26 +0530 Subject: [PATCH] remove: mozak_memory_init_trace_cap (#1606) 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. --- circuits/src/stark/proof.rs | 1 - circuits/src/stark/prover.rs | 2 -- circuits/src/stark/recursive_verifier.rs | 10 +--------- circuits/src/stark/verifier.rs | 6 ------ 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/circuits/src/stark/proof.rs b/circuits/src/stark/proof.rs index 7adfefd96..52a503f96 100644 --- a/circuits/src/stark/proof.rs +++ b/circuits/src/stark/proof.rs @@ -322,7 +322,6 @@ pub struct AllProof, C: GenericConfig, co pub proofs: TableKindArray>, pub program_rom_trace_cap: MerkleCap, pub elf_memory_init_trace_cap: MerkleCap, - pub mozak_memory_init_trace_cap: MerkleCap, pub public_inputs: PublicInputs, pub public_sub_table_values: TableKindArray>>, } diff --git a/circuits/src/stark/prover.rs b/circuits/src/stark/prover.rs index 35110cca1..5dc017636 100644 --- a/circuits/src/stark/prover.rs +++ b/circuits/src/stark/prover.rs @@ -153,7 +153,6 @@ 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(); } @@ -161,7 +160,6 @@ where proofs, program_rom_trace_cap, elf_memory_init_trace_cap, - mozak_memory_init_trace_cap, public_inputs, public_sub_table_values, }) diff --git a/circuits/src/stark/recursive_verifier.rs b/circuits/src/stark/recursive_verifier.rs index 2681bca7d..40ddb9703 100644 --- a/circuits/src/stark/recursive_verifier.rs +++ b/circuits/src/stark/recursive_verifier.rs @@ -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; @@ -64,7 +63,6 @@ pub struct VMRecursiveProofPublicInputs { 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], } @@ -76,8 +74,6 @@ impl Default for VMRecursiveProofPublicInputs { 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(), } @@ -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 diff --git a/circuits/src/stark/verifier.rs b/circuits/src/stark/verifier.rs index 5c3feea8b..5e70365cc 100644 --- a/circuits/src/stark/verifier.rs +++ b/circuits/src/stark/verifier.rs @@ -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,