Repository navigation
test(threshold): verify DKG omission, reconstruction-floor and activation-budget vectors - #773
Merged
Merged
Conversation
…tivation budget; check dkg-omission.json - dkgVerifyTranscript: ExcessiveReconstruction when |QUAL| - reconstructed < t (after R5, before the round count); OwnMessageOmitted for an R6 sender without exactly one R4 and one R5 envelope, before interpolation - verifyActivation: WithOutageBudget(b) for a genesis or re-key candidate needs b >= f (1 for 3-of-4, otherwise t - 1), else InvalidReadiness - transcripts.ts/cli.ts: schema and replay of dkg-omission.json (DKG transcripts and verify_activation cases); added to the default document list and README - omission.test.ts: new tests for each rule and the 3-of-5 chosen-key cases Details: TC-2226
… rule - dkg.test.ts:164: ` const out = run(s, [...faulted, r6(s, [3])]);` -> ` const out = run(s, [...faulted, r6(s, [3], [1, 2])]);` - dkg.test.ts:190: ` const faulted = replace(s, 4, 3);` -> ` const faulted = replace(s, 4, 3, msg(3, feldman(s.dealers[2]!.A.slice(0, 1))));` No assertion changes. A member whose own R4 is missing or conflicting sends no R6; dealer 3's R4 in the second test is present with the wrong coefficient count, so it stays an extraction fault. Details: TC-2226
…and R5 - dkgVerifyTranscript: R6 values count only from senders with a unique envelope (after byte-identical deduplication) in both closed R4 and R5; InsufficientRecovery only when fewer than t eligible Pedersen-valid values remain. Replaces the OwnMessageOmitted rejection; QUAL, envelope checks and the post-R5 floor are unchanged - omission.test.ts: R6-sender tests expect the ineligible R6 to be ignored, with InsufficientRecovery when the eligible values fall below t Details: TC-2226
- dkgVerifyTranscript: R6 is authenticated only when R5 requires it (missing: InvalidRound), after the floor and before the eligibility filter; an R6 record R5 does not require is not read (InvalidRound); a record after R6 is refused (InvalidRound) only after reconstruction - verifyActivation: receipts (count <= n, membership, signature length, duplicates, then every signature), then quorum and budget (b > 0, t + b <= n, b >= f), then the ready count, then the activation statement - omission.test.ts: one test per check order and the ignored-R6 vector pair; CLI edit test names the InsufficientRecovery case Check order: SPEC S0.3 appendix (R4-R6) and S0.2 activation appendix. Details: TC-2226
…alified ends the transcript after R3 - dkgVerifyTranscript: each closed round is authenticated just before it is applied (a missing record is InvalidRound); with |QUAL| < t after R3 the result is InsufficientQualified and no record after R3 is read, authenticated or counted - omission.test.ts: |QUAL| < t with a valid R4, an R4 with a bad closure signature, and a trailing record after R5 all give InsufficientQualified; a bad R3 decides first Record order: SPEC S0.3 appendix (DkgTranscript). Details: TC-2226
… record order
- dkg.test.ts:126: ` test('fewer than t qualified dealers aborts only as the last record', () => {` -> ` test('fewer than t qualified dealers aborts after R3; later records are not read', () => {`
- dkg.test.ts:129: ` expect(code(() => run(s, alone))).toBe('InvalidRound');` -> ` expect(code(() => run(s, alone))).toBe('InsufficientQualified');`
Lines 128 and 130 are unchanged. SPEC S0.3 appendix (DkgTranscript): with |QUAL| < t after closed R3 no record after R3 is authenticated or applied; the dkg-omission.json cases *_insufficient_qualified_with_trailing_r4 pin the same order.
Details: TC-2226
- omission.test.ts: with |QUAL| >= t, four records give InvalidRound, and four records with a bad R4 closure signature give InvalidSignature Details: TC-2226
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.
Updates the independent TypeScript vector and transcript checker under
tinycloud-threshold/vectors/check/to verify the DKG omission, reconstruction-floor, R6-eligibility, record-ordering and genesis/re-key activation-budget rules intinycloud-threshold/SPEC.md, and checksvectors/v1/dkg-omission.json(20 cases) alongside the six existing vector documents.What it changes
dkg.ts): Authenticates round records in order just before each is applied, stops after R3 onInsufficientQualified(after the full-transcript size bound), enforces the R6 reconstruction floor (|QUAL| - |reconstructed| >= t→ExcessiveReconstruction) before reading R6 or checking trailing rounds, authenticates R6 before filtering out R6 values from senders lacking a unique envelope in both closed R4 and closed R5 and rejects a trailing round after R6 only after reconstruction.ceremony.ts,certificates.ts): AddsfaultBudget(t, n)(1for 3-of-4, otherwiset - 1) and requiresb >= ffor genesis and re-key candidates (no predecessor or a previous master key present) after receipt validation and signature checks and beforeNotEnoughReady.transcript-common.ts,transcripts.ts,cli.ts,README.md): Adds strict schema validation and verification forvectors/v1/dkg-omission.json(checkOmission) and wires it intobun run vectors/bun run check.omission.test.ts): Adds unit and CLI tests covering the floor, R6 eligibility filter, check ordering and activation outage budget across genesis, re-key and reshare.Clean-room provenance
Implemented from
tinycloud-threshold/SPEC.mdand the committed JSON vector files without consulting the Rust implementation.Not changed
tinycloud-threshold/vectors/check/**(9 files).SPEC.mdedit, no vector file edit, noCargo.tomlor lockfile change.Test edits
Four lines in
tinycloud-threshold/vectors/check/dkg.test.tsupdate two existing tests to match the updatedSPEC.mdS0.3 rules:InsufficientQualifiedends the transcript after R3 without reading trailing rounds (lines 126 and 129), and R6 senders must have unique envelopes in closed R4 and closed R5 (lines 164 and 190). No other existing test file changes.Non-blocking review notes
transcripts.ts:165-171(activateCandidate) checks the owner signature insideverifyActivationbefore comparingactivation.bodywith the recomputed preimage, whereaschain.ts:69-70compares the body first (InvalidReadinessvsInvalidSignature); every omission activation vector rejects before reaching either check.dkg.test.ts:164narrows the test's R6 senders to[1, 2](explicitly excluding the faulted sender whose R4 is absent);omission.test.tscovers ignored ineligible R6 senders directly.activateCandidate(transcripts.ts:165) is exported though used only insidetranscripts.ts.Verification
bun install --frozen-lockfile && bun run check: 417/417 tests passed across 22 files,tsc --noEmitclean, all 7 vector documents passed (primitives 18/18, certificate 18/18, DKG 7/7, reshare 5/5, re-key 14/14, chain 8/8, DKG omission 20/20).4e511a86with byte-identicaltinycloud-threshold/vectors/check/tree;tsc --noEmitandbun cli.tsre-verified at head.Merge effects
Merging to main runs the usual image build, which pushes the
mainandedgeimage tags. No deployment runs: deploying stays a manual dispatch.Details: TC-2226