Skip to content

fix(validator): make reviewCount atomic with quorum finalization - #95

Merged
cybermax4200 merged 1 commit into
ecotask-network:mainfrom
greyhe0x:fix/80-validator-reputation-atomic
Aug 24, 2026
Merged

fix(validator): make reviewCount atomic with quorum finalization#95
cybermax4200 merged 1 commit into
ecotask-network:mainfrom
greyhe0x:fix/80-validator-reputation-atomic

Conversation

@greyhe0x

Copy link
Copy Markdown
Contributor

Summary

  • Remove the standalone reviewCount increment from castVote
  • Increment reviewCount inside the same Prisma transaction as validatorReputation updates in finalizeProof
  • Apply the same atomic accounting when quorum escalation records an inconclusive verification
  • Add a fault-injection test proving a rolled-back finalization leaves reviewCount unchanged

Closes #80

Test plan

  • npm test -- tests/services/validatorService.test.ts (15 tests pass)
  • Confirm reviewCount and validatorReputation stay consistent when finalization fails mid-transaction

Made with Cursor

Move reviewCount increments into the same transaction as validatorReputation
updates during finalizeProof and quorum escalation so a rolled-back
finalization cannot inflate review counts.
@cybermax4200
cybermax4200 merged commit 742a73a into ecotask-network:main Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validator reputation/reviewCount updates run outside the quorum transaction

3 participants