Goal
Audit tests split into 5 stages, ordered by dependency. Each stage is independently mergeable.
Branches
Stage 1: Audit judgment logic + ValidatorID fix
PR #936 (merged): fix ComputeInitialAuditAssignment missing ValidatorID (#935) + 4 new tests (candidate filtering, regression, assignmentMap propagation, announcement signing). Also fix ServiceId typo.
Main already has 40 tests from #910 covering ClassifyJudgments, FilterJudgments, IsWorkReportAudited, IsBlockAudited, workReportsEqual, etc.
Stage 2: Judgment signing + tranche-index formula
PR #939 (open): 4 new tests + production fixes for #940 (BuildJudgements key bug) and a defensive GetTranchIndex underflow clamp.
BuildJudgements signature verification (GP §17.17): reconstruct ⟨Xe(w) ⌢ H(w)⟩ and verify against pubkey
BuildJudgements empty input: zero-iteration loop returns [] without panic
GetTranchIndex formula (GP §17.8): n = (T − P·Ht) / A, wall-clock sandwich pattern
GetTranchIndex future-slot guard: T < P·Ht clamps to 0 instead of u64 wrap
WaitNextTranche cases originally planned here all turned out to be duplicates of TestWaitNextTranche_* on main from #910. Dropped.
GetJudgement fetch / process error paths also dropped, already on main from #910.
Bug fix #940: BuildJudgements was passing Kappa[v].Ed25519 (public key, 32B) to ed25519.Sign which requires 64B private key, would panic.
Stage 3: CE encode/decode edge cases
PR #955 (open): 11 new tests on top of existing ce144_test (10) + ce145_test (14).
- CE144: truncated header, truncated evidence, tiny cores full roundtrip, tranche>0 evidence shape roundtrip
- CE145: invalid validity=2, wrong decode size, truncated guarantee, three Validate symmetric rules, trailing-bytes pin
Stage 4: obsoleted
The originally prepared 6 TestStage4_AuditMessageBus_* tests were line-for-line duplicates of TestAuditMessageBus_* added to main by #910. The remaining stream / send roundtrip stubs were unblocked by #925 (validator grid + QUIC stream dispatch) being merged, but the prepared branch also had an unused-import build error post-rebase, so the cleanest move was to drop the branch entirely.
feat/audit-stage4 branch was deleted from origin on 2026-04-27.
Followup: ComputeAnForValidator threshold + a0 top-10 cap
PR #957 (open) — closes #956: 18 new subtests across 4 functions, with one production refactor.
- Refactor: extract
isAssignedByThreshold from ComputeAnForValidator into a pure helper so the GP §17.15 threshold formula Y(sₙ(w))[0]·V/(256·F) < mₙ can be tested without invoking the Bandersnatch VRF.
isAssignedByThreshold boundary cases (tiny + full mode, mn = 1, 2; defensive mn = 0).
isAssignedByThreshold exhaustive byte-range count vs analytic ⌈256·F·mn/V⌉.
buildInitialAuditAssignmentFromCoreOrder top-10 cap (GP §17.5): with 12 non-nil reports, and with nils interspersed.
Other still-deferred items:
GetJudgement success path: blocked on Executor interface refactor in judgement.go
- VRF determinism end-to-end: needs Bandersnatch fixture plumbing
- Refine / Accumulate cost (§17.16+): needs PVM instrumentation
SingleNodeAuditingAndPublish end-to-end: heavy mock setup, low priority
Stage 5: Official conformance vectors
Blocked — waiting for jam-test-vectors to add stf/audit/. Infrastructure ready.
Docs
See docs/ce-audit-test-plan.md for full details.
Goal
Audit tests split into 5 stages, ordered by dependency. Each stage is independently mergeable.
Branches
feat/audit-stage1feat/audit-stage2feat/audit-stage3feat/audit-followupStage 1: Audit judgment logic + ValidatorID fix
PR #936 (merged): fix
ComputeInitialAuditAssignmentmissingValidatorID(#935) + 4 new tests (candidate filtering, regression, assignmentMap propagation, announcement signing). Also fixServiceIdtypo.Main already has 40 tests from #910 covering ClassifyJudgments, FilterJudgments, IsWorkReportAudited, IsBlockAudited, workReportsEqual, etc.
Stage 2: Judgment signing + tranche-index formula
PR #939 (open): 4 new tests + production fixes for #940 (
BuildJudgementskey bug) and a defensiveGetTranchIndexunderflow clamp.BuildJudgementssignature verification (GP §17.17): reconstruct ⟨Xe(w) ⌢ H(w)⟩ and verify against pubkeyBuildJudgementsempty input: zero-iteration loop returns [] without panicGetTranchIndexformula (GP §17.8): n = (T − P·Ht) / A, wall-clock sandwich patternGetTranchIndexfuture-slot guard: T < P·Ht clamps to 0 instead of u64 wrapWaitNextTranchecases originally planned here all turned out to be duplicates ofTestWaitNextTranche_*on main from #910. Dropped.GetJudgementfetch / process error paths also dropped, already on main from #910.Bug fix #940:
BuildJudgementswas passingKappa[v].Ed25519(public key, 32B) toed25519.Signwhich requires 64B private key, would panic.Stage 3: CE encode/decode edge cases
PR #955 (open): 11 new tests on top of existing ce144_test (10) + ce145_test (14).
Stage 4: obsoleted
The originally prepared 6
TestStage4_AuditMessageBus_*tests were line-for-line duplicates ofTestAuditMessageBus_*added to main by #910. The remaining stream / send roundtrip stubs were unblocked by #925 (validator grid + QUIC stream dispatch) being merged, but the prepared branch also had an unused-import build error post-rebase, so the cleanest move was to drop the branch entirely.feat/audit-stage4branch was deleted from origin on 2026-04-27.Followup: ComputeAnForValidator threshold + a0 top-10 cap
PR #957 (open) — closes #956: 18 new subtests across 4 functions, with one production refactor.
isAssignedByThresholdfromComputeAnForValidatorinto a pure helper so the GP §17.15 threshold formulaY(sₙ(w))[0]·V/(256·F) < mₙcan be tested without invoking the Bandersnatch VRF.isAssignedByThresholdboundary cases (tiny + full mode, mn = 1, 2; defensive mn = 0).isAssignedByThresholdexhaustive byte-range count vs analytic ⌈256·F·mn/V⌉.buildInitialAuditAssignmentFromCoreOrdertop-10 cap (GP §17.5): with 12 non-nil reports, and with nils interspersed.Other still-deferred items:
GetJudgementsuccess path: blocked onExecutorinterface refactor injudgement.goSingleNodeAuditingAndPublishend-to-end: heavy mock setup, low priorityStage 5: Official conformance vectors
Blocked — waiting for
jam-test-vectorsto addstf/audit/. Infrastructure ready.Docs
See
docs/ce-audit-test-plan.mdfor full details.