diff --git a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4.json b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4.json index ba62eb38..972979ca 100644 --- a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4.json +++ b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4.json @@ -2,11 +2,11 @@ { "name": "tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4", "benchmark_result": { - "clock_cycle_count": 195204, - "hash_table_height": 143119, - "u32_table_height": 26331, - "op_stack_table_height": 177162, - "ram_table_height": 289257 + "clock_cycle_count": 195215, + "hash_table_height": 143125, + "u32_table_height": 26065, + "op_stack_table_height": 177172, + "ram_table_height": 289262 }, "case": "CommonCase" } diff --git a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4.json b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4.json index c71c74f4..ce0ec938 100644 --- a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4.json +++ b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4.json @@ -2,11 +2,11 @@ { "name": "tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4", "benchmark_result": { - "clock_cycle_count": 203274, - "hash_table_height": 150811, - "u32_table_height": 34225, - "op_stack_table_height": 182344, - "ram_table_height": 290444 + "clock_cycle_count": 203285, + "hash_table_height": 150817, + "u32_table_height": 33925, + "op_stack_table_height": 182354, + "ram_table_height": 290449 }, "case": "CommonCase" } diff --git a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4.json b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4.json index 98413ce3..3743db8c 100644 --- a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4.json +++ b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4.json @@ -2,11 +2,11 @@ { "name": "tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4", "benchmark_result": { - "clock_cycle_count": 183501, - "hash_table_height": 129073, - "u32_table_height": 24910, - "op_stack_table_height": 169356, - "ram_table_height": 285358 + "clock_cycle_count": 183512, + "hash_table_height": 129085, + "u32_table_height": 25825, + "op_stack_table_height": 169366, + "ram_table_height": 285363 }, "case": "CommonCase" } diff --git a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4.json b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4.json index c663e88a..d1b5a3cb 100644 --- a/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4.json +++ b/tasm-lib/benchmarks/tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4.json @@ -2,11 +2,11 @@ { "name": "tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4", "benchmark_result": { - "clock_cycle_count": 191571, - "hash_table_height": 136765, - "u32_table_height": 34281, - "op_stack_table_height": 174538, - "ram_table_height": 286545 + "clock_cycle_count": 191582, + "hash_table_height": 136777, + "u32_table_height": 34566, + "op_stack_table_height": 174548, + "ram_table_height": 286550 }, "case": "CommonCase" } diff --git a/tasm-lib/src/verifier/stark_verify.rs b/tasm-lib/src/verifier/stark_verify.rs index db9f3585..31443d4a 100644 --- a/tasm-lib/src/verifier/stark_verify.rs +++ b/tasm-lib/src/verifier/stark_verify.rs @@ -36,6 +36,7 @@ use crate::verifier::master_table::verify_table_rows::VerifyTableRows; use crate::verifier::out_of_domain_points::OodPoint; use crate::verifier::out_of_domain_points::OutOfDomainPoints; use crate::verifier::vm_proof_iter::dequeue_next_as::DequeueNextAs; +use crate::verifier::vm_proof_iter::drop::Drop; use crate::verifier::vm_proof_iter::new::New; /// Verify a STARK proof. @@ -302,6 +303,7 @@ impl BasicSnippet for StarkVerify { let entrypoint = self.entrypoint(); let proof_to_vm_proof_iter = library.import(Box::new(New)); + let drop_vm_proof_iter = library.import(Box::new(Drop)); let ood_curr_row_main_and_aux_value_pointer_alloc = library.kmalloc(EXTENSION_DEGREE.try_into().unwrap()); @@ -1039,10 +1041,10 @@ impl BasicSnippet for StarkVerify { assert // _ *beqd_ws *p_iter *oodpnts *fri *btrows *odd_brow_next *etrows *ood_erow_nxt *ood_brow_curr *ood_erow_curr *fri_revealed *qseg_elems num_colli - /* Clean up stack */ + /* Clean up stack and drop p_iter, ensuring that it ends up in a consistent state */ swap 12 swap 11 - pop 1 + call {drop_vm_proof_iter} // _ num_colli *beqd_ws *oodpnts *fri *btrows *odd_brow_next *etrows *ood_erow_nxt *ood_brow_curr *ood_erow_curr *fri_revealed *qseg_elems /* Sum out-of-domain values */