Skip to content

Commit 5260396

Browse files
committed
fix: handle mock mode properly
1 parent 9b0229b commit 5260396

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

crates/chaintsn/src/transition.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,19 @@ fn process_l1_checkpoint(
193193
let ckpt = signed_ckpt.checkpoint(); // inner data
194194

195195
let receipt = ckpt.construct_receipt();
196-
if !params.proof_publish_mode.allow_empty() {
196+
197+
if receipt.proof().is_empty() {
198+
// If the proof is empty but empty proofs are not allowed, this will fail.
199+
assert!(
200+
params.proof_publish_mode.allow_empty(),
201+
"empty proof is not allowed"
202+
);
203+
} else {
204+
// Otherwise, verify the non-empty proof.
197205
assert!(
198206
verify_rollup_groth16_proof_receipt(&receipt, &params.rollup_vk).is_ok(),
199207
"posted checkpoint proof verification failed"
200-
)
208+
);
201209
}
202210

203211
// Copy the epoch commitment and make it finalized.

0 commit comments

Comments
 (0)