Skip to content

Instantly share code, notes, and snippets.

@huitseeker
Created February 20, 2026 06:31
Show Gist options
  • Select an option

  • Save huitseeker/c2621a12901bffb6cc485f1ef1ab60af to your computer and use it in GitHub Desktop.

Select an option

Save huitseeker/c2621a12901bffb6cc485f1ef1ab60af to your computer and use it in GitHub Desktop.
commit b32cd775a91d346a5381b84c870aac30ec5377fb
Author: François Garillot <francois@garillot.net>
Date: Fri Feb 20 01:26:32 2026 -0500
Fix transaction proving benchmarks
- Change prove_transaction from sync to async to use prove_async()
- This avoids Tokio runtime nesting issues with miden-vm 0.22.0
- Fix bug where prove_transaction wasn't being awaited in benchmarks
- Proving now correctly runs and generates ~218KB proofs
diff --git a/bin/bench-transaction/src/time_counting_benchmarks/prove.rs b/bin/bench-transaction/src/time_counting_benchmarks/prove.rs
index 5dafb460..3b62feac 100644
--- a/bin/bench-transaction/src/time_counting_benchmarks/prove.rs
+++ b/bin/bench-transaction/src/time_counting_benchmarks/prove.rs
@@ -89,12 +89,11 @@ fn core_benchmarks(c: &mut Criterion) {
},
|tx_context| async move {
// benchmark the transaction execution and proving
- black_box(prove_transaction(
- tx_context
- .execute()
- .await
- .expect("execution of the single P2ID note consumption tx failed"),
- ))
+ let executed_tx = tx_context
+ .execute()
+ .await
+ .expect("execution of the single P2ID note consumption tx failed");
+ black_box(prove_transaction(executed_tx).await)
},
BatchSize::SmallInput,
);
@@ -110,12 +109,11 @@ fn core_benchmarks(c: &mut Criterion) {
},
|tx_context| async move {
// benchmark the transaction execution and proving
- black_box(prove_transaction(
- tx_context
- .execute()
- .await
- .expect("execution of the two P2ID note consumption tx failed"),
- ))
+ let executed_tx = tx_context
+ .execute()
+ .await
+ .expect("execution of the two P2ID note consumption tx failed");
+ black_box(prove_transaction(executed_tx).await)
},
BatchSize::SmallInput,
);
@@ -124,10 +122,14 @@ fn core_benchmarks(c: &mut Criterion) {
execute_and_prove_group.finish();
}
-fn prove_transaction(executed_transaction: ExecutedTransaction) -> Result<()> {
+async fn prove_transaction(executed_transaction: ExecutedTransaction) -> Result<()> {
+ use miden_protocol::transaction::TransactionInputs;
+
let executed_transaction_id = executed_transaction.id();
- let proven_transaction: ProvenTransaction =
- LocalTransactionProver::default().prove(executed_transaction)?;
+ let tx_inputs: TransactionInputs = executed_transaction.into();
+
+ let prover = LocalTransactionProver::default();
+ let proven_transaction: ProvenTransaction = prover.prove_async(tx_inputs).await?;
assert_eq!(proven_transaction.id(), executed_transaction_id);
Ok(())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment