Skip to content

Commit 62fe88a

Browse files
fix(sdk): aggregate_leaf_proofs should always generate an internal proof (#1866)
The `verify_e2e_stark_proof` exists a fixed log blowup factor set by the internal proof. Therefore we must always generate an internal proof even if there is only 1 leaf proof. Test run on a 1 segment proof: https://github.com/axiom-crypto/openvm-reth-benchmark/blob/gh-pages/benchmarks-dispatch/refs/heads/main/reth-c299bb2012ed6bf2aa289ee3decd45897c9ce574-59a742f87fe66d079554e6646f2a0fdabb1dc4d2e6afbf0f0b4f09376b854357.md
1 parent 9601125 commit 62fe88a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/sdk/src/prover/agg.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ impl<E: StarkFriEngine<SC>> AggStarkProver<E> {
108108
let mut internal_node_idx = -1;
109109
let mut internal_node_height = 0;
110110
let mut proofs = leaf_proofs;
111-
while proofs.len() > 1 {
111+
// We will always generate at least one internal proof, even if there is only one leaf
112+
// proof, in order to shrink the proof size
113+
while proofs.len() > 1 || internal_node_height == 0 {
112114
let internal_inputs = InternalVmVerifierInput::chunk_leaf_or_internal_proofs(
113115
self.internal_prover
114116
.committed_exe

0 commit comments

Comments
 (0)