diff --git a/trace_decoder/src/lib.rs b/trace_decoder/src/lib.rs index 3e0ba29f8..ba3552fcd 100644 --- a/trace_decoder/src/lib.rs +++ b/trace_decoder/src/lib.rs @@ -287,7 +287,7 @@ pub struct BlockLevelData { pub fn entrypoint( trace: BlockTrace, other: OtherBlockData, - batch_size: usize, + mut batch_size: usize, use_burn_addr: bool, ) -> anyhow::Result> { use anyhow::Context as _; @@ -398,6 +398,12 @@ pub fn entrypoint( ) .collect::(); + // Make sure the batch size is smaller than the total number of transactions, + // or we would need to generate dummy proofs for the aggregation layers. + if batch_size > txn_info.len() { + batch_size = txn_info.len() / 2 + 1; + } + let last_tx_idx = txn_info.len().saturating_sub(1) / batch_size; let mut txn_info = txn_info