@@ -89,13 +89,21 @@ pub fn stark_to_succinct(
8989 println ! ( "Succinct control root a0 dec: {:?}" , a0_dec) ;
9090 println ! ( "Succinct control root a1 dec: {:?}" , a1_dec) ;
9191 println ! ( "CONTROL_ID: {:?}" , ident_receipt. control_id) ;
92- let id_bn254_fr_bits: Vec < String > = ident_receipt
92+ let mut id_bn254_fr_bits: Vec < String > = ident_receipt
9393 . control_id
9494 . as_bytes ( )
9595 . iter ( )
9696 . flat_map ( |& byte| ( 0 ..8 ) . rev ( ) . map ( move |i| ( ( byte >> i) & 1 ) . to_string ( ) ) )
9797 . collect ( ) ;
9898 println ! ( "id_bn254_fr_bits: {:?}" , id_bn254_fr_bits) ;
99+ // remove 248th and 249th bits
100+ id_bn254_fr_bits. remove ( 248 ) ;
101+ id_bn254_fr_bits. remove ( 248 ) ;
102+
103+ println ! (
104+ "id_bn254_fr_bits after removing 2 extra bits: {:?}" ,
105+ id_bn254_fr_bits
106+ ) ;
99107
100108 let mut seal_json: Value = {
101109 let file_content = fs:: read_to_string ( & seal_path) . unwrap ( ) ;
@@ -112,13 +120,15 @@ pub fn stark_to_succinct(
112120 let output = Command :: new ( "docker" )
113121 . arg ( "run" )
114122 . arg ( "--rm" )
123+ . arg ( "--platform=linux/amd64" ) // Force linux/amd64 platform
115124 . arg ( "-v" )
116125 . arg ( format ! ( "{}:/mnt" , work_dir. to_string_lossy( ) ) )
117126 . arg ( "ozancw/risc0-to-bitvm2-groth16-prover:latest" )
118127 . stdout ( Stdio :: piped ( ) )
119128 . stderr ( Stdio :: piped ( ) )
120129 . output ( )
121130 . unwrap ( ) ;
131+
122132 println ! ( "Output: {:?}" , output) ;
123133
124134 if !output. status . success ( ) {
@@ -130,6 +140,7 @@ pub fn stark_to_succinct(
130140 println ! ( "proof_path: {:?}" , proof_path) ;
131141 let proof_content = std:: fs:: read_to_string ( proof_path) . unwrap ( ) ;
132142 let output_content_dec = std:: fs:: read_to_string ( output_path) . unwrap ( ) ;
143+ println ! ( "output content: {:?}" , output_content_dec) ;
133144 let proof_json: ProofJson = serde_json:: from_str ( & proof_content) . unwrap ( ) ;
134145 // let output_json: Value = serde_json::from_str(&output_content).unwrap();
135146 // Convert output_content_dec from decimal to hex
@@ -149,8 +160,7 @@ pub fn stark_to_succinct(
149160 } ;
150161
151162 // Step 3: Decode the hexadecimal string to a byte vector
152- let output_byte_vec = Vec :: < u8 > :: from_hex ( & output_content_hex) . unwrap ( ) ;
153- // let output_byte_vec = Vec::<u8>::from_hex(output_hex).unwrap();
163+ let output_byte_vec = Vec :: from_hex ( & output_content_hex) . unwrap ( ) ;
154164 let output_bytes: [ u8 ; 31 ] = output_byte_vec. as_slice ( ) . try_into ( ) . unwrap ( ) ;
155165 ( proof_json. try_into ( ) . unwrap ( ) , output_bytes)
156166}
0 commit comments