Skip to content

Verification rows record the original positive verdict even when the proof is auto-rejected at capacity #54

Description

@cybermax4200

Why this matters now: Corrupts the audit/verification history that future analytics, disputes, and fraud investigations depend on.

Problem / What: When claimCompletionSlot reports the task is full, finalStatus flips to REJECTED but the stored Verification.verdict is still the original verdict ('approved' from result.verdict in verificationWorker.ts:94-101; parsed.data.verdict in proofController.ts:343-350; verdict in validatorService.ts:201-208). So proof.status = REJECTED while Verification.verdict = approved — a direct contradiction persisted to the DB.

Key Challenges: Capturing the effective verdict, not the intended one, and deciding whether to keep the auto-reject reason separate from the human/auto verdict. Needs a migration-safe write path since existing rows already disagree.

Acceptance Criteria:

  • A Verification row's verdict always matches the resulting Proof.status (or a new field effectiveVerdict is introduced and backfilled).
  • New integration test asserts consistency for the capacity-rejected case across all three finalizers.

Relevant files/functions: src/workers/verificationWorker.ts:90-117, src/controllers/proofController.ts:322-367, src/services/validatorService.ts:161-245, prisma/schema.prisma (Verification model).

Out of scope: Changing the capacity-rejection behavior itself.

Labels: advanced, database, bug

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignadvancedbugSomething isn't workingdatabase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions