fix(crypto): use leanVM's setup_prover and prove one at a time - #540
Closed
TomWambsgans wants to merge 1 commit into
Closed
fix(crypto): use leanVM's setup_prover and prove one at a time#540TomWambsgans wants to merge 1 commit into
setup_prover and prove one at a time#540TomWambsgans wants to merge 1 commit into
Conversation
`ensure_prover_ready` only called `init_aggregation_bytecode`, so the arena was never engaged and every prover buffer used the system allocator. `setup_prover` lives in the `lean-multisig` facade, not in `rec_aggregation`, so importing crate by crate hid it. Engaging the arena arms a panic: only one proof may run at a time. Take a permit around each proving entry point; without it 5 of the 7 crypto tests panic. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Greptile SummaryThe PR updates the leanVM dependency and serializes proof-producing operations around leanVM's arena-backed prover.
Confidence Score: 5/5The PR appears safe to merge, with all existing proof-producing entry points serialized behind the process-wide permit. The changed crypto wrapper consistently initializes the appropriate leanVM mode and acquires the same mutex before invoking each proof-producing aggregation, merge, or split operation; no concrete blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/common/crypto/src/lib.rs | Switches aggregation APIs to lean-multisig, separates prover/verifier setup, and serializes all existing proof-producing entry points. |
| crates/common/crypto/Cargo.toml | Replaces direct leanVM subcrate dependencies with lean-multisig and adds the tracing dependency used for poison recovery diagnostics. |
| Cargo.toml | Pins xmss and the new lean-multisig workspace dependency to leanVM revision 380da82c. |
| Cargo.lock | Resolves the updated leanVM revision and the new lean-multisig dependency graph without an accepted changed-code defect. |
Sequence Diagram
sequenceDiagram
participant CallerA as Proving caller A
participant CallerB as Proving caller B
participant Setup as leanVM setup_prover
participant Permit as PROVER_PERMIT
participant Prover as leanVM prover
CallerA->>Setup: ensure_prover_ready()
CallerA->>Permit: lock()
CallerA->>Prover: produce proof
CallerB->>Setup: ensure_prover_ready()
CallerB->>Permit: lock()
Permit-->>CallerB: wait while A proves
Prover-->>CallerA: proof
CallerA->>Permit: unlock on guard drop
Permit-->>CallerB: acquire
CallerB->>Prover: produce proof
Reviews (1): Last reviewed commit: "fix(crypto): use leanVM's facade and pro..." | Re-trigger Greptile
MegaRedHand
approved these changes
Jul 27, 2026
Collaborator
|
The repo config doesn't allow merging unsigned commits, so I manually cherry-picked it into the base PR: db7bc13 Thanks again for the help! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ensure_prover_readyonly calledinit_aggregation_bytecode, one of four steps insetup_prover, so leanVM's arena was never engaged and every prover buffer used the system allocator.