Skip to content

Fix: Make Transcript Constant Length#195

Merged
WizardOfMenlo merged 8 commits into
worldfnd:mainfrom
shreyas-londhe:sl/recursive-support
Sep 17, 2025
Merged

Fix: Make Transcript Constant Length#195
WizardOfMenlo merged 8 commits into
worldfnd:mainfrom
shreyas-londhe:sl/recursive-support

Conversation

@shreyas-londhe

@shreyas-londhe shreyas-londhe commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

This PR fixes the recursive-verification flow by making the transcript length constant.

Problem

  • Sorting/deduping Merkle challenge indices altered order/multiplicity, breaking recursive verification.
  • ark_crypto_primitives::MultiPath compresses paths, producing variable-length serialization unsuitable for recursive circuits/witnessing.

Solution

  • Added recursive Cargo feature to disable index sort/dedup (preserve order and multiplicity).
  • Introduced FullMultiPath<P> (Vec<Path<P>>) with deterministic, fixed-size serialization.
  • Prover/Verifier switch to FullMultiPath under recursive; default remains MultiPath.

@shreyas-londhe
shreyas-londhe marked this pull request as ready for review September 11, 2025 10:42
@codspeed-hq

codspeed-hq Bot commented Sep 11, 2025

Copy link
Copy Markdown

CodSpeed Instrumentation Performance Report

Merging #195 will not alter performance

Comparing shreyas-londhe:sl/recursive-support (995ba96) with main (530ccad)

Summary

✅ 10 untouched

@WizardOfMenlo

Copy link
Copy Markdown
Collaborator

Will do a more careful pass, but before merging let's do the following:

  • I don't think we need recursive to be a feature flag. We would need to actively test it in CI, and the code becomes uglier as a result. Instead, let's add two new fields to WhirConfig: an enum of type MerkleConfig which specifies whether to do path pruning or not (and in the future Merkle capping) and an enum of type DeduplicationStrategy which specifies which deduplication of the queries should occur.
  • Once we have this, we can write a nice wrapper for a Merkle tree that takes MerkleConfig as an argument and either dispatches to the path pruning impl or the other one.
  • Likewise, we can pass this to compute_stir_queries.

I think this should modularize the code a bit better, and be better for when @recmo 's refactoring goes live.

@WizardOfMenlo WizardOfMenlo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, let's just move the parameters into whir_params and add some comments for future refactors.

Comment thread src/bin/benchmark.rs Outdated
Comment thread src/whir/prover.rs Outdated
Comment thread src/whir/verifier.rs Outdated
@WizardOfMenlo
WizardOfMenlo merged commit 48fc090 into worldfnd:main Sep 17, 2025
7 checks passed
@shreyas-londhe
shreyas-londhe deleted the sl/recursive-support branch September 17, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants