fix(mpc): pin the canonical production circuit at init - #13
Merged
Conversation
A build made without the patched vendor tree resolves upstream gnark from the module cache and compiles a slightly different destination-v2 circuit (observed: 1,791,413 constraints instead of the canonical 1,789,750), because reviewed vendor patches such as the uints constant folding change the constraint system. Nothing fails on its own: init signs the wrong circuit into the ceremony definition and every later stage coherently verifies against it, so the fork is only discovered when the transcript is compared against the canonical circuit hours later, if at all. Pin the reviewed R1CS identity (sha256, blake2b256, size, constraint count) and reject it at production init with an error that names scripts/bootstrap-vendor.sh. Rehearsal mode and the rehearsal circuit are deliberately not pinned. Also record the measured exact-K=21 contribution and verification timings from the 2026-08-20 Relay-driven production-mode first-head test in the parallel-optimizations note.
mellowcroc
force-pushed
the
fix/pin-canonical-production-circuit
branch
from
August 20, 2026 17:09
965ca90 to
619660c
Compare
11 tasks
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.
A build made without the patched vendor tree resolves upstream gnark from the module cache and compiles a slightly different destination-v2 circuit (observed: 1,791,413 constraints instead of the canonical 1,789,750 — the reviewed vendor patches such as
uints-constant-foldchange the constraint system). Nothing fails on its own:initsigns the wrong circuit into the ceremony definition, and every later stage coherently verifies against it. The fork surfaces only when the transcript is compared against the canonical circuit — hours later, if at all. (Found by making exactly this mistake during the 2026-08-20 production-mode Relay test.)Change: pin the reviewed R1CS identity (sha256, blake2b256, size, constraint count) in
internal/mpcceremony/canonical.goand reject a mismatch at productioninitwith an error that namesscripts/bootstrap-vendor.sh. Rehearsal mode and the rehearsal circuit are deliberately not pinned. Unit-tested with the observed unvendored fork as the negative case.Also extends
docs/mpc-ceremony-parallel-optimizations.mdwith the measured exact-K=21 numbers from the same test: contribution 56m54s → 7m02s (16 vCPU) / 8m01s (8 vCPU viarelay participate), candidate verification 50m27s → 5m46s.The pinned digests come from the canonical vendored build's signed ceremony definition; the existing reproducible-build CI compiles the same circuit, so any intentional circuit change will fail this check loudly and require updating the constants alongside the vendor patches.