@@ -146,16 +146,44 @@ impl Prover {
146146
147147 // Load or generate aggregation snark (layer-3).
148148 let batch_header = BatchHeader :: construct_from_chunks (
149- batch. version ,
150- batch. batch_index ,
151- batch. l1_message_popped ,
152- batch. total_l1_message_popped ,
153- batch. parent_batch_hash ,
154- batch. last_block_timestamp ,
149+ batch. batch_header . version ,
150+ batch. batch_header . batch_index ,
151+ batch. batch_header . l1_message_popped ,
152+ batch. batch_header . total_l1_message_popped ,
153+ batch. batch_header . parent_batch_hash ,
154+ batch. batch_header . last_block_timestamp ,
155155 & chunk_hashes,
156156 ) ;
157+
158+ // sanity check between:
159+ // - BatchHeader supplied from infra
160+ // - BatchHeader re-constructed by circuits
161+ //
162+ // for the fields data_hash, z, y, blob_versioned_hash.
163+ assert_eq ! (
164+ batch_header. data_hash, batch. batch_header. data_hash,
165+ "BatchHeader(sanity) mismatch data_hash expected={}, got={}" ,
166+ batch. batch_header. data_hash, batch_header. data_hash
167+ ) ;
168+ assert_eq ! (
169+ batch_header. blob_data_proof[ 0 ] , batch. batch_header. blob_data_proof[ 0 ] ,
170+ "BatchHeader(sanity) mismatch blob data proof (z) expected={}, got={}" ,
171+ batch. batch_header. blob_data_proof[ 0 ] , batch_header. blob_data_proof[ 0 ] ,
172+ ) ;
173+ assert_eq ! (
174+ batch_header. blob_data_proof[ 1 ] , batch. batch_header. blob_data_proof[ 1 ] ,
175+ "BatchHeader(sanity) mismatch blob data proof (y) expected={}, got={}" ,
176+ batch. batch_header. blob_data_proof[ 1 ] , batch_header. blob_data_proof[ 1 ] ,
177+ ) ;
178+ assert_eq ! (
179+ batch_header. blob_versioned_hash, batch. batch_header. blob_versioned_hash,
180+ "BatchHeader(sanity) mismatch blob versioned hash expected={}, got={}" ,
181+ batch. batch_header. blob_versioned_hash, batch_header. blob_versioned_hash,
182+ ) ;
183+
157184 let batch_hash = batch_header. batch_hash ( ) ;
158185 let batch_info: BatchHash < N_SNARKS > = BatchHash :: construct ( & chunk_hashes, batch_header) ;
186+
159187 let layer3_snark = self . prover_impl . load_or_gen_agg_snark (
160188 name,
161189 LayerId :: Layer3 . id ( ) ,
0 commit comments