DO NOT MERGE: exercise the production ceremony with a 10-minute beacon lead - #5
Closed
mellowcroc wants to merge 2 commits into
Closed
DO NOT MERGE: exercise the production ceremony with a 10-minute beacon lead#5mellowcroc wants to merge 2 commits into
mellowcroc wants to merge 2 commits into
Conversation
The destination-v2 circuit has 1,789,750 constraints and forces a 2^21 domain, which makes every ceremony operation expensive: a single phase-1 contribution takes 56 minutes and moves 576 MiB, and a full lifecycle is a multi-day exercise. Testing the orchestration at that size is impractical, so in practice it was not tested at all. Register a second circuit that proves x^3 = pub at a small domain, so the same lifecycle runs in minutes. It carries exactly one Groth16 commitment, matching destination-v2, because finalization exports a Cardano verifying key whose BSB22 encoding assumes a single commitment; without it the rehearsal could not reach the finalize stage at all. Production must never see this circuit, and three independent things keep it out. CeremonyDefinition.validate rejects any key version other than destination-v2 when mode is production, and does so before any environment-dependent check. The CLI refuses --key-version rehearsal-tiny-v1 unless --mode rehearsal. The exact-k21-rehearsal gate in the production decision still demands domain 2^21, which a small run cannot satisfy. CircuitBinding.Validate now checks key version and circuit id as a pair rather than each against a single constant. Checking them independently would let a definition name one circuit's version with another's id and pass both checks while describing nothing that exists. The four executor sites that previously hardcoded CompileDestinationV2 now compile the circuit the signed definition names, so an operator cannot select a circuit the ceremony was not created with.
DO NOT MERGE. Any transcript produced from this branch is a test artifact and must never be presented as a ceremony. The released ProductionMinimumWitnessLeadSeconds is 24 hours. It is the window in which a public witness can observe a phase closure before the randomness that seals that phase exists, which is what stops a coordinator who already knows the beacon output from closing the phase around it. Two phase closes make it 48 hours of mandated waiting, and that is the point rather than an accident. That cost makes the production path effectively untestable: a run cannot finish in less than three days, so the finalize, audit, release, and decision stages have never been exercised. A rehearsal reaches none of them, because the production arm of CeremonyDefinition.validate is the only place several of those checks live. Reducing the constant to 10 minutes brings a full production run inside a single working session. The witness observation window introduced on the base branch is cut proportionally, from one hour to two minutes, so the reproduction still exercises the reserved-window check without restoring the multi-hour wait. Nothing else is relaxed: the clean-tree requirement, the pinned build profile, the destination-v2 circuit binding, and every other production gate remain exactly as released.
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.
DO NOT MERGE
This is a reproduction/test branch. It intentionally weakens a production security control so the complete production ceremony path can be exercised in a practical amount of time. Nothing in this PR should be merged or represented as production ceremony policy.
Stack
feature/mpc-relay-ops).What it changes
Two commits sit on top of #4.
Tiny rehearsal circuit
Adds
rehearsal-tiny-v1, a small circuit provingx^3 = pub, so the ceremony lifecycle can run in minutes instead of days. It carries one Groth16 commitment to exercise the same finalization/Cardano encoding shape as destination-v2.Production remains protected by three independent checks:
rehearsal-tiny-v1only in rehearsal mode.The ceremony executors compile the circuit named by the authenticated definition instead of hardcoding destination-v2.
Ten-minute production witness lead
Reduces
ProductionMinimumWitnessLeadSecondsfrom 24 hours to 10 minutes and proportionally reduces the reserved witness observation window from one hour to two minutes.This is intentionally unsafe for real use. It exists only to make a complete production-mode reproduction fit inside a working session while retaining the same close/witness timing checks. Boundary tests derive their expectations from the signed policy, including the public-witness receipt tests added by #4.
Why this exists
The released 24-hour lead is a real security boundary: witnesses must be able to observe closure before the sealing randomness exists. Across two phases it also imposes at least 48 hours of waiting.
That cost meant the real finalize, audit, release, and decision paths had not been exercised end to end. The prior K=21 reproduction surfaced blocking defects now addressed in #1, including stale beacon-round selection after long replay and incorrect finalization-evidence derivation.
The prior run completed both phases, finalization, two independent audits, and a signed release in 56h42m. Both audits reproduced the proving key, verifying key, and Cardano encoding byte for byte with zero findings. This demonstrates resource and artifact coherence only; it does not establish participant independence or production readiness.
Validation
go test ./internal/mpcceremonygo test ./cmd/mpc-ceremony -skip '^TestProductionCeremonySourceAndBinaryExcludeWalletSecretAPIs$'git diff --check feature/mpc-relay-ops...HEADThe skipped CLI boundary test remains blocked by the repository's existing inconsistent
vendor/modules.txt, which this branch does not modify.