Skip to content

Commit b8edf9e

Browse files
authored
Merge pull request #52 from lambdaclass/handle_verify_internal_errors
Handle Mina public input errors
2 parents 7e0b2ff + 2ed9faa commit b8edf9e

File tree

1 file changed

+8
-8
lines changed
  • batcher/aligned-batcher/src/zk_utils

1 file changed

+8
-8
lines changed

batcher/aligned-batcher/src/zk_utils/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ fn verify_internal(verification_data: &VerificationData) -> bool {
6262
is_valid
6363
}
6464
ProvingSystemId::Mina => {
65-
let pub_input = verification_data
66-
.pub_input
67-
.as_ref()
68-
.expect("Public input is required");
65+
let Some(pub_input) = verification_data.pub_input.as_ref() else {
66+
warn!("Mina public input is missing");
67+
return false;
68+
};
6969

7070
const MAX_PROOF_SIZE: usize = 48 * 1024;
7171
const MAX_PUB_INPUT_SIZE: usize = 6 * 1024;
@@ -85,10 +85,10 @@ fn verify_internal(verification_data: &VerificationData) -> bool {
8585
verify_mina_state_ffi(&proof_buffer, proof_len, &pub_input_buffer, pub_input_len)
8686
}
8787
ProvingSystemId::MinaAccount => {
88-
let pub_input = verification_data
89-
.pub_input
90-
.as_ref()
91-
.expect("Public input is required");
88+
let Some(pub_input) = verification_data.pub_input.as_ref() else {
89+
warn!("Mina Account public input is missing");
90+
return false;
91+
};
9292

9393
const MAX_PROOF_SIZE: usize = 16 * 1024;
9494
const MAX_PUB_INPUT_SIZE: usize = 6 * 1024;

0 commit comments

Comments
 (0)