Skip to content

Commit feeb6aa

Browse files
committed
Add state size check in batcher
1 parent fed2ad4 commit feeb6aa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • batcher/aligned-batcher/src/mina

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const STATE_HASH_SIZE: usize = 32;
66
const PROTOCOL_STATE_SIZE: usize = 2056;
77

88
pub fn verify_protocol_state_proof_integrity(proof: &[u8], public_input: &[u8]) -> bool {
9+
if public_input.len() != (STATE_HASH_SIZE + PROTOCOL_STATE_SIZE) * 2 {
10+
return false;
11+
}
12+
913
debug!("Checking Mina protocol state proof");
1014
if let Err(err) = check_protocol_state_proof(proof) {
1115
warn!("Protocol state proof check failed: {}", err);

0 commit comments

Comments
 (0)