Skip to content

test: Audit / Node integration test plan staged milestones #931

@HanaYukii

Description

@HanaYukii

Goal

Audit tests split into 5 stages, ordered by dependency. Each stage is independently mergeable.

Branches

Stage Branch PR Status
1 + fix feat/audit-stage1 #936 merged ✓
2 + fix feat/audit-stage2 #939 open
3 feat/audit-stage3 #955 open
4 obsoleted, branch closed
followup feat/audit-followup #957 open
5 Blocked (upstream)

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.

Metadata

Metadata

Assignees

Labels

testTesting feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions