From a591c062fc4da5db4f517bb60db3fd89e945ff70 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 27 Nov 2023 12:07:38 +0100 Subject: [PATCH] Fix(proof_data_handler): Feature flag state_diff_hash check This work is needed only on boojum capable deployments. Outside that, check `.expect("No state diff hash key")` will always fail. Discussion [here](https://matter-labs-workspace.slack.com/archives/C05EB746E8G/p1701080840186819). --- .../proof_data_handler/request_processor.rs | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/core/lib/zksync_core/src/proof_data_handler/request_processor.rs b/core/lib/zksync_core/src/proof_data_handler/request_processor.rs index d82e66f0cf5c..f091993812b9 100644 --- a/core/lib/zksync_core/src/proof_data_handler/request_processor.rs +++ b/core/lib/zksync_core/src/proof_data_handler/request_processor.rs @@ -192,24 +192,26 @@ impl RequestProcessor { let system_logs = serialize_commitments(&l1_batch.header.system_logs); let system_logs_hash = H256(keccak256(&system_logs)); - let state_diff_hash = l1_batch - .header - .system_logs - .into_iter() - .find(|elem| elem.0.key == u256_to_h256(2.into())) - .expect("No state diff hash key") - .0 - .value; - - if state_diff_hash != state_diff_hash_from_prover - || system_logs_hash != system_logs_hash_from_prover - { - let server_values = format!("system_logs_hash = {system_logs_hash}, state_diff_hash = {state_diff_hash}"); - let prover_values = format!("system_logs_hash = {system_logs_hash_from_prover}, state_diff_hash = {state_diff_hash_from_prover}"); - panic!( - "Auxilary output doesn't match, server values: {} prover values: {}", - server_values, prover_values - ); + if !is_pre_boojum { + let state_diff_hash = l1_batch + .header + .system_logs + .into_iter() + .find(|elem| elem.0.key == u256_to_h256(2.into())) + .expect("No state diff hash key") + .0 + .value; + + if state_diff_hash != state_diff_hash_from_prover + || system_logs_hash != system_logs_hash_from_prover + { + let server_values = format!("system_logs_hash = {system_logs_hash}, state_diff_hash = {state_diff_hash}"); + let prover_values = format!("system_logs_hash = {system_logs_hash_from_prover}, state_diff_hash = {state_diff_hash_from_prover}"); + panic!( + "Auxilary output doesn't match, server values: {} prover values: {}", + server_values, prover_values + ); + } } storage .proof_generation_dal()