@@ -5,7 +5,7 @@ use std::sync::Arc;
55use apollo_sizeof:: SizeOf ;
66use privacy_circuit_verify:: { verify_recursive_circuit, PrivacyProofOutput } ;
77use serde:: { Deserialize , Serialize } ;
8- use starknet_api:: transaction:: fields:: { Proof , ProofFacts , PROOF_VERSION } ;
8+ use starknet_api:: transaction:: fields:: { Proof , ProofFacts , PROOF_VERSION_V0 } ;
99use starknet_types_core:: felt:: Felt ;
1010use thiserror:: Error ;
1111
@@ -68,7 +68,7 @@ impl ProgramOutput {
6868 /// The bootloader output for a single task is:
6969 /// `[num_tasks, output_size, program_hash, ...task_output...]`
7070 ///
71- /// We replace `num_tasks` with `[PROOF_VERSION , program_variant]` and skip `output_size`,
71+ /// We replace `num_tasks` with `[PROOF_VERSION_V0 , program_variant]` and skip `output_size`,
7272 /// which is a bootloader-internal field not part of the proof facts.
7373 pub fn try_into_proof_facts (
7474 & self ,
@@ -83,7 +83,7 @@ impl ProgramOutput {
8383 return Err ( ProgramOutputError :: TooShort ( self . 0 . len ( ) ) ) ;
8484 }
8585 // Add the proof version and variant markers in place of num_tasks.
86- let mut facts = vec ! [ PROOF_VERSION ] ;
86+ let mut facts = vec ! [ PROOF_VERSION_V0 ] ;
8787 facts. push ( program_variant) ;
8888 // Skip num_tasks (index 0) and output_size (index 1); add the task output
8989 // (program_hash followed by the virtual OS output).
@@ -100,17 +100,17 @@ impl From<Vec<Felt>> for ProgramOutput {
100100
101101/// Reconstructs the output preimage from proof facts for circuit verification.
102102///
103- /// Proof facts layout: `[PROOF_VERSION , variant, program_hash, ...task_output]`
103+ /// Proof facts layout: `[PROOF_VERSION_V0 , variant, program_hash, ...task_output]`
104104/// Output preimage layout: `[num_tasks=1, output_size, program_hash, ...task_output]`
105105/// where `output_size = task_content.len() + 1` (includes itself).
106106pub fn reconstruct_output_preimage (
107107 proof_facts : & ProofFacts ,
108108) -> Result < Vec < Felt > , VerifyProofError > {
109- // Proof facts must contain at least [PROOF_VERSION , variant, program_hash].
109+ // Proof facts must contain at least [PROOF_VERSION_V0 , variant, program_hash].
110110 if proof_facts. 0 . len ( ) < 3 {
111111 return Err ( VerifyProofError :: ProofFactsTooShort { length : proof_facts. 0 . len ( ) } ) ;
112112 }
113- // Skip PROOF_VERSION (index 0) and variant (index 1).
113+ // Skip PROOF_VERSION_V0 (index 0) and variant (index 1).
114114 let task_content = & proof_facts. 0 [ 2 ..] ;
115115 let output_size = Felt :: from (
116116 u64:: try_from ( task_content. len ( ) + 1 ) . expect ( "task content length exceeds u64::MAX" ) ,
@@ -125,8 +125,8 @@ pub fn verify_proof(proof_facts: ProofFacts, proof: Proof) -> Result<(), VerifyP
125125 return Err ( VerifyProofError :: EmptyProof ) ;
126126 }
127127
128- // Validate that the first element of proof facts is PROOF_VERSION .
129- let expected_proof_version = PROOF_VERSION ;
128+ // Validate that the first element of proof facts is PROOF_VERSION_V0 .
129+ let expected_proof_version = PROOF_VERSION_V0 ;
130130 let actual_first = proof_facts. 0 . first ( ) . copied ( ) . unwrap_or_default ( ) ;
131131 if actual_first != expected_proof_version {
132132 return Err ( VerifyProofError :: InvalidProofVersion {
0 commit comments